[Numpy-discussion] f2py and Fortran90 gfortran_filename error
Wed Feb 28 09:09:11 CST 2007
> Thanks for helping out Pearu,
> But it won't even create the .so file using that command. Using what
> you suggested, seems to work as it goes through many of the processes
> but then f2py stops at:
> error: don't know how to compile Fortran code on platform 'posix' with
> 'gnu95' compiler. Supported compilers are:
> Even more weird is on my laptop the situation is even worse. Check out
> this error which I seem to get regardless of whether I use the gnu95
> line like you suggested on the --f90exec option.
> thayes@seneca:~/fortran90/am562b/misc_finite$ f2py -c
> --fcompiler=gnu95 matsolve2.pyf matsolve.f90
> Unknown vendor: "gnu95"
> define_macros = [('NUMERIC_VERSION', '"\\"24.2\\""')]
> include_dirs = ['/usr/include/python2.4']
The problem is that you are using Numeric and f2py2e combination that do
not have gfortran support (in f2py2e, to be specific).
You can either switch to Numpy (that includes f2py with gfortran support)
or use your original command line with -lgfortran specified:
f2py -c matsolve2.pyf --f90exec=/usr/bin/gfortran matsolve.f90 -lgfortran
If you get more undefined symbol errors then find out which libraries
define these symbols and include the corresponding -l<libname> switches.
Note that it is recommended to switch using to numpy as f2py has better
F90 support there.
More information about the Numpy-discussion