You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
subroutinea(fcn)
implicit noneexternal fcn
real(8) :: fcn
real(8) :: x, y
x =0d0
y = fcn(x)
end
Version B: one line for external
subroutinea(fcn)
implicit nonereal(8), external:: fcn
real(8) :: x, y
x =0d0
y = fcn(x)
end
Output:
Running f2py source.f90 -h header.pyf produces the following results.
Version a correctly outputs a pyf header
! -*- f90 -*-
! Note: the context of this file is case sensitive.
python module a__user__routines
interface a_user_interface
functionfcn(x) result (y) ! in external1.f90:a:unknown_interface
real(kind=8) :: x
real(kind=8) :: y
endfunction fcn
end interface a_user_interface
end python module a__user__routines
subroutinea(fcn) ! in external1.f90
use a__user__routines
external fcn
endsubroutine a
! This file was auto-generated with f2py (version:2).
! See http://cens.ioc.ee/projects/f2py2e/
Version B incorrectly produces a header without external function
! -*- f90 -*-
! Note: the context of this file is case sensitive.
subroutineb(fcn) ! in external2.f90
real(kind=8) :: fcn
endsubroutine b
! This file was auto-generated with f2py (version:2).
! See http://cens.ioc.ee/projects/f2py2e/
NumPy/Python version information:
1.19.4 3.9.0 (default, Oct 27 2020, 14:15:17)
[Clang 12.0.0 (clang-1200.0.32.21)]
The text was updated successfully, but these errors were encountered:
External functions (e.g. #14919 or https://stackoverflow.com/questions/44073679/errors-when-using-a-fortran-call-back-function-in-f2py) do not generate correct headers in f2py if declared in F90 style.
Reproducing code example:
Version A: two lines for external
Version B: one line for external
Output:
Running
f2py source.f90 -h header.pyf
produces the following results.Version a correctly outputs a pyf header
Version B incorrectly produces a header without external function
NumPy/Python version information:
1.19.4 3.9.0 (default, Oct 27 2020, 14:15:17)
[Clang 12.0.0 (clang-1200.0.32.21)]
The text was updated successfully, but these errors were encountered: