[Numpy-discussion] f2py - how to use .pyf files?

Robert Kern robert.kern@gmail....
Fri Jul 18 17:53:07 CDT 2008

On Fri, Jul 18, 2008 at 17:39, Fernando Perez <fperez.net@gmail.com> wrote:
> Howdy,
> 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
> customize Gnu95FCompiler
> 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

You still need "-m text2", I believe.

> 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"

It's --fcompiler=gnu95, not --fcompiler=gfortran

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco

More information about the Numpy-discussion mailing list