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
{{ message }}
Repository navigation
f2py throws AssertionError on fortran 90 files which declare routines with C bindings (Trac #1679) #2275
When running f2py on a fortran 90 file with the following contents:
interface
function my_func(x) bind(c,name='my_func')
use iso_c_binding
real(c_double), intent(in) :: x
real(c_double) :: my_func
end function
end interface
It causes an exception in f2py, ending with the following line:
File "C:\Python26\lib\site-packages\numpy\f2py\crackfortran.py", line 665, in markoutercomma
assert not f,`f,line,l,cc`
AssertionError: (1, "x@)@ bind@(@c,name='my_func'", "x@)@ bind@(@c,name='my_func'", ')')
As far as I understand this is just a bug in the parser, since f2py shouldn't care that my fortran code is internally calling C routines.
Activity
numpy-gitbot commentedon Oct 19, 2012
@pearu wrote on 2010-12-02
Fixed in numpy git repo.
numpy-gitbot commentedon Oct 19, 2012
Milestone changed to
1.6.0by @mwiebe on 2011-05-31dhermes commentedon Sep 14, 2017
It seems this issue has had a regression: https://gist.github.com/dhermes/b27be5cc4c73d9665beff24b6c18af4f
Observed with
numpy==1.13.1in Python 3.6.charris commentedon Sep 15, 2017
@dhermes AFAICT from checking back to NumPy 1.6, your example has never worked. I note that it isn't quite the same as the example in this issue.
charris commentedon Sep 15, 2017
@dhermes You should open a new issue for your problem.
dhermes commentedon Sep 15, 2017
Done (#9693). Thanks for the reply @charris!