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

Berthold Höllmann hoel at gl-group.com
Fri Mar 26 05:18:53 CST 2004

Berthold Höllmann <hoel at gl-group.com> writes:

> Hello,
> I tried to compile a project of ours under solaris5. I gave
> all the ".o" files are missing. Just another problem with "exec_command"?

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.

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 $?

"-c" requires the command to be called as string intead of a
tuple/list of arguments.

I changed lines 348-351 to:

        if type(command) is type([]):
            argv = [sh,'-c', " ".join(command)]
            argv = [sh,'-c',command]

and it now seems to work for me.

Kind regards

Berthold Höllmann
Germanischer Lloyd AG
CAE Development
Vorsetzen 35
20459 Hamburg
Phone: +49(0)40 36149-7374
Fax: +49(0)40 36149-7320
e-mail: hoel at gl-group.com
Internet: http://www.gl-group.com 
This e-mail contains confidential information for the exclusive attention of the intended addressee. Any access of third parties to this e-mail is unauthorised. Any use of this e-mail by unintended recipients such as copying, distribution, disclosure etc. is prohibited and may be unlawful. When addressed to our clients the content of this e-mail is subject to the General Terms and Conditions of GL's Group of Companies applicable at the date of this e-mail.  
GL's Group of Companies does not warrant and/or guarantee that this message at the moment of receipt is authentic, correct and its communication free of errors, interruption etc.  

More information about the Scipy-dev mailing list