[Numpy-discussion] fortran 90 compiler problem

humufr@yah... humufr@yah...
Wed Oct 10 15:51:53 CDT 2007


This is the log I have when I'm trying to use f2py with a fortran 90 file. 
The last line seems to tell me that f2py cannot see gfortran and g95 even if 
it detected them when I installed f2py.

thanks,

N.

gfortran and g95 are installed and I can use them:

> gfortran
gfortran: no input files

>gfortran -c hello.f90
> ls hello*
hello.f90 hello.o

> g95 
g95: no input files

>g95 -c hello.f90
> ls hello*
hello.f90 hello.o

and now

>f2py -c -m hello hello.f90
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler 
opti
ons
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler 
opt
ions
running build_src
building extension "hello" sources
f2py options: []
f2py:> /tmp/tmpg5exdv/src.linux-i686-2.5/hellomodule.c
creating /tmp/tmpg5exdv
creating /tmp/tmpg5exdv/src.linux-i686-2.5
Reading fortran codes...
        Reading file 'hello.f90' (format:free)
Post-processing...
        Block: hello
                        Block: foo
Post-processing (stage 2)...
Building modules...
        Building module "hello"...
                Constructing wrapper function "foo"...
                  foo(a)
        Wrote C/API module "hello" to 
file "/tmp/tmpg5exdv/src.linux-i686-2.5/he
llomodule.c"
  adding '/tmp/tmpg5exdv/src.linux-i686-2.5/fortranobject.c' to sources.
  adding '/tmp/tmpg5exdv/src.linux-i686-2.5' to include_dirs.
copying /home/gruel/usr/lib/python2.5/site-packages/numpy/f2py/src/fortranobject
.c -> /tmp/tmpg5exdv/src.linux-i686-2.5
copying /home/gruel/usr/lib/python2.5/site-packages/numpy/f2py/src/fortranobject
.h -> /tmp/tmpg5exdv/src.linux-i686-2.5
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize GnuFCompiler
Found executable /usr/bin/g77
gnu: no Fortran 90 compiler found
gnu: no Fortran 90 compiler found
customize GnuFCompiler
gnu: no Fortran 90 compiler found
gnu: no Fortran 90 compiler found
customize GnuFCompiler using build_ext
building 'hello' extension
compiling C sources
C compiler: 
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-pro                               
totypes -fPIC

creating /tmp/tmpg5exdv/tmp
creating /tmp/tmpg5exdv/tmp/tmpg5exdv
creating /tmp/tmpg5exdv/tmp/tmpg5exdv/src.linux-i686-2.5
compile 
options: '-I/tmp/tmpg5exdv/src.linux-i686-2.5 -I/home/gruel/usr/lib/pyth                               
on2.5/site-packages/numpy/core/include -I/usr/include/python2.5 -c'
gcc: /tmp/tmpg5exdv/src.linux-i686-2.5/hellomodule.c
gcc: /tmp/tmpg5exdv/src.linux-i686-2.5/fortranobject.c
compiling Fortran sources
Fortran f77 
compiler: /usr/bin/g77 -g -Wall -fno-second-underscore -fPIC -O3 -fu                               
nroll-loops -march=pentium-m -mmmx -msse2 -msse -fomit-frame-pointer
compile 
options: '-I/tmp/tmpg5exdv/src.linux-i686-2.5 -I/home/gruel/usr/lib/pyth                               
on2.5/site-packages/numpy/core/include -I/usr/include/python2.5 -c'
error: f90 not supported by GnuFCompiler needed for hello.f90



On Wednesday 10 October 2007 16:15:32 Robert Kern wrote:
> humufr@yahoo.fr wrote:
> > 		Hello,
> >
> > I'm using the last svn version of numpy (.
> >
> > I tried the solution found on the mail list:
> >
> > python setup.py config_fc --fcompiler=gnu95 build
> >
> > the two interesting part (at least for me) in the building process are:
> >
> > customize GnuFCompiler Found executable /usr/bin/g77
> > gnu: no Fortran 90 compiler found
> > gnu: no Fortran 90 compiler found
> > customize GnuFCompiler
> > gnu: no Fortran 90 compiler found
> > gnu: no Fortran 90 compiler found
> > customize GnuFCompiler using config
> >
> > and later:
> > customize G95FCompiler Found executable /usr/local/bin/g95
> >
> > but I still have the same answer when I'm trying to do: f2py -c -m hello
> > hello.f90
> >
> > customize GnuFCompiler Found executable /usr/bin/g77
> > gnu: no Fortran 90 compiler found gnu: no Fortran 90
> > compiler found customize GnuFCompiler
> > gnu: no Fortran 90 compiler found
> > gnu: no Fortran 90 compiler found
>
> This is a correct message and does not imply that no Fortran 90 compiler
> exists. The GnuFCompiler ("gnu") only looks at g77, which is not a Fortran
> 90 compiler. That message only applies to the "gnu" compiler, not any
> other.
>
> > and so:
> >
> > error: f90 not supported by GnuFCompiler needed for hello.f90
> >
> > I can't compile my fortran module because of this. I'll attach the file
> > obtain with
> >
> > python setup.py -v config_fc --fcompiler=gnu95 build
> >
> > And I have the same result for g95.
> >
> > thank you for numpy and f2py.
>
> Please give us the build log that actually failed and the command that you
> used to obtain it. The one you show, for numpy, succeeded.


More information about the Numpy-discussion mailing list