[Numpy-discussion] f2py - how to use .pyf files?
Fri Jul 18 17:39:55 CDT 2008
again f2py... Since I can't seem to figure out how to pass the
--fcompiler option to f2py via setup.py/distutils, I decided to just
do things for now via a plain makefile. But I'm struggling here too.
The problem is this: the call
f2py -c --fcompiler=gfortran -m text2 Text2.f90
works perfectly, and at some point in the output I see
Found executable /usr/bin/gfortran
and the result is a nice text2.so module. But I'd like to clean up a
bit the python interface to the fortran routines, so I did the usual
f2py -h text2.pyf Text2.f90
to create the .pyf, edited the pyf to adjust and 'pythonize' the
interface, and then when I try to build using this pyf, I get a crash
and the *same* gfortran option is now not recognized:
maqroll[felipe_fortran]> f2py -c --fcompiler=gfortran text2.pyf
Unknown vendor: "gfortran"
Traceback (most recent call last):
File "/usr/bin/f2py", line 26, in <module>
line 560, in main
line 536, in run_compile
ext = Extension(**ext_args)
line 45, in __init__
File "/usr/lib/python2.5/distutils/extension.py", line 106, in __init__
assert type(name) is StringType, "'name' must be a string"
AssertionError: 'name' must be a string
Note that it doesn't matter if I add Text2.f90 or not to the above
call, it still fails.
I could swear I'd done similar things in the past without any problems
(albeit with f77 sources), and the user guide
gives instructions very much along the lines of what I'm doing. Are
these changes since the integration into numpy, regressions, or
mistakes on how I'm calling it?
Thanks for any help,
More information about the Numpy-discussion