[SciPy-user] scipy 0.5.2, fortran, distutils on Intel Core 2 Duo, Mac OS X

Robert Kern robert.kern at gmail.com
Tue Jan 23 20:43:50 EST 2007


Erik Sherwood wrote:
> I'm trying to use numpy.distutils to compile fortran sources on a  
> MacBook Pro Core 2 Duo machine, with python 2.4, scipy0.5.2, numpy  
> 1.0.1 (all installed using fink). I have g95, also installed with fink.
> 
> fortran is called using a call to numpy.distutils.core.setup

The setup() function isn't meant to be called like that, if I understand
correctly what you are doing. It needs command-line arguments in sys.argv. While
the interactive mode stuff is novel to numpy.distutils, the need for
command-line arguments is a restriction in distutil's design. distutils is not
really programmatically drivable. I recommend writing a real setup.py script and
drive it by calling it as a subprocess.

If I don't correctly understand what is going on, please describe it more.
Preferably with code and exactly what you type at the command line to run that code.

> It's not clear to me why gfortran is being used instead of g95. If I  
> get a list of fortran compilers in interactive mode, I get
> 
> List of available Fortran compilers:
>    --fcompiler=g95    G95 Fortran Compiler (0.90)
>    --fcompiler=gnu95  GNU 95 Fortran Compiler (4.2.0)
> 
> What do I need to do to use g95 instead of gfortran?

Use --fcompiler=g95 as arguments to the build_ext command (and build_clib if you
are building FORTRAN libraries using distutils).

> Also, I had posted before about the problem of being taken to  
> interactive mode when calling distutils.core.setup on Mac OS X. I  
> believe there was a patch for 0.5.1, but apparently it wasn't  
> included in 0.5.2. What needs to be changed to avoid interactive  
> mode? (Or which subversion revision had the patch?)

As it's part of numpy, not scipy, no there was no change between scipy 0.5.1 and
0.5.2. However, removing the interactive mode won't solve your problem. Without
command-line arguments, setup() will simply do nothig.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco



More information about the SciPy-User mailing list