-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
DOC: Explain distribution for f2py
with meson-python
#25199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm commenting here but happy to open a new issue/PR, depending on how the decision is to go forward. When building Fortran extension modules, one might only want to use C FILE ADD.F
C
SUBROUTINE ADD(A,B,C)
C
CF2PY INTENT(OUT) :: C
CF2PY INTENT(IN) :: A
CF2PY INTENT(IN) :: B
CF2PY DOUBLE PRECISION :: A
CF2PY DOUBLE PRECISION :: B
CF2PY DOUBLE PRECISION :: C
DOUBLE PRECISION A
DOUBLE PRECISION B
DOUBLE PRECISION C
C = A + B
END
C
SUBROUTINE HELLO()
C
PRINT*,"Hello from fortran"
END ! File add.pyf
! -*- f90 -*-
! Note: the context of this file is case sensitive.
python module add ! in
interface ! in :add
subroutine add(a,b,c) ! in :add:add.f
double precision intent(in) :: a
double precision intent(in) :: b
double precision intent(out) :: c
end subroutine add
end interface
end python module add
! This file was auto-generated with f2py (version:1.26.1).
! See:
! https://web.archive.org/web/20140822061353/http://cens.ioc.ee/projects/f2py2e Generating the C sources as follows works as expected: f2py add.pyf However, generating the C sources as follows: f2py -m add add.pyf add.f --lower also adds the interface to I see this being fixed one of two ways:
I would appreciate comments on how to deal with this and can submit a PR for either scenario. |
Uh oh!
There was an error while loading. Please reload this page.
Some older issues (e.g. #19441, #22211 (comment)) and parts of the documentation very briefly cover distribution of extensions with F2PY sources. It seems (anecdotally) that telling people to go look at SciPy hasn't been super helpful so, a proper documentation section would be nice.
The text was updated successfully, but these errors were encountered: