[SciPy-dev] f2py + f90 file

Pearu Peterson pearu at cens.ioc.ee
Thu Feb 21 13:43:20 EST 2008


On Thu, February 21, 2008 8:36 pm, dmitrey wrote:
> hi all,
> I have an .f90 file with a routine that I intend to connect to Python
> via f2py
>
> (the file is http://users.bigpond.net.au/amiller/bvls.f90 )
>
> I have gfortran and f95 installed (KUBUNTU 7.10), *no f90* (f90 is
> absent in KUBUNTU software update channel as well).
>
> Both they work with the file correctly, so I can get both a.out and
> bvlc.o (however I don't know how to get *.so files)
>
> So f2py -c -m bvls bvls.f90 yields:
> ...
> Fortran f77 compiler: /usr/bin/g77 -g -Wall -fno-second-underscore -fPIC
> -O3 -funroll-loops -march=athlon64 -mmmx -m3dnow -msse2 -msse
> compile options: '-I/tmp/tmpK2eM1Z/src.linux-x86_64-2.5
> -I/usr/lib/python2.5/site-packages/numpy/core/include
> -I/usr/include/python2.5 -c'
> error: f90 not supported by GnuFCompiler needed for bvls.f90
>
> if I rename the file extension to f95 I have the same problem:
> error: f90 not supported by GnuFCompiler needed for bvls.f95
>
> Any suggestions?

You need to specify F90 complier explicitly (default compiler
for f2py is g77):

  f2py -c -m bvls bvls.f90 --fcompiler=gnu95

HTH,
Pearu




More information about the SciPy-Dev mailing list