[SciPy-dev] Re: scipy distutils from CVS does not build code for fortran libraries

Pearu Peterson pearu at scipy.org
Fri Mar 26 13:00:55 CST 2004



On Fri, 26 Mar 2004, [ISO-8859-15] Berthold Höllmann wrote:

> what version of the sun FORTRAN compiler does the
> 
>    "config_fc --fcompiler=sun"
> 
> switch expect. We have 
> 
> f90 -V
> f90: Sun WorkShop 6 update 2 Fortran 95 6.2 Patch 111690-07 2002/06/26
> Usage: f90 [ options ] files.  Use 'f90 -flags' for details
> 
> installed. It does not know the "-f77" switch.

The sunfcompiler.py is probably tested only for 7.1 version:

$ f90 -V
f90: Sun Fortran 95 7.1 2003/03/12
Usage: f90 [ options ] files.  Use 'f90 -flags' for details

I have fixed (hopefully) sunfcompiler.py in CVS for Sun WorkShop 6.

> It turns out, my problem is the "/bin/bash" wrapper around the f90
> call. Why is exec_command.py running
> 
>    spawnvpe(0,'/bin/sh',['/bin/sh', '-c', 'f90', '-f77', '-ftrap=%none', '-xcode=pic32', '-c', 'lib/numfort/NB.F', '-o', 'build.Engmodel/temp.solaris-2.8-sun4u-2.2/lib/numfort/NB.o'],os.environ)
> 
> instead of 
> 
>    spawnvpe(0,'f90',['f90', '-f77', '-ftrap=%none', '-xcode=pic32', '-c', 'lib/numfort/NB.F', '-o', 'build.Engmodel/temp.solaris-2.8-sun4u-2.2/lib/numfort/NB.o'],os.environ)
> 
> ? My problem can be shown with
> 
> hoel at donau:test /bin/sh -c "f90 -f77 -ftrap=%none -xcode=pic32 -c lib/engforcegen/cylforces.f -o build.Engmodel/temp.solaris-2.8-sun4u-2.2/lib/engforcegen/cylforces.o"
> f90: Warning: Option -f77 passed to ld, if ld is invoked, ignored otherwise
> ERROR: Cannot open source file "lib/engforcegen/cylforces.f".
> hoel at donau:test /bin/sh -c f90 -f77 -ftrap=%none -xcode=pic32 -c lib/engforcegen/cylforces.f -o build.Engmodel/temp.solaris-2.8-sun4u-2.2/lib/engforcegen/cylforces.o
> Usage: f90 [ options ] files.  Use 'f90 -flags' for details
> hoel at donau:test echo $?
> 0
> 
> "-c" requires the command to be called as string intead of a
> tuple/list of arguments.

Strange, `man bash` allows `bash -c string arg0 arg1 ..`

> I changed lines 348-351 to:
> 
>         if type(command) is type([]):
>             argv = [sh,'-c', " ".join(command)]
>         else:
>             argv = [sh,'-c',command]
> 
> and it now seems to work for me.

This is now in scipy CVS as well.

Thanks,
Pearu




More information about the Scipy-dev mailing list