[SciPy-user] Building with a non-standard gfortran

David M. Cooke cookedm@physics.mcmaster...
Fri Nov 23 01:31:10 CST 2007

On Nov 20, 2007, at 09:03 , Adam Mercer wrote:

> Hi
> Using MacPorts, the gfortran compiler, from gcc-4.2.x, is installed as
> gfortran-mp-4.2.  I have been trying to build scipy with this compiler
> and found that that numpy I need to build and install with
> $ python setup.py config_fc --fcompiler gnu95 \
>    --f77exec /opt/local/bin/gfortran-mp-4.2 \
>    --f90exec /opt/local/bin/gfortran-mp-4.2 build
> $ python setup.py install --prefix=${NUMPY_LOCATION}
> however using the above for scipy fails on the install phase with it
> being unable to locate a fortran compiler.  I therefore need to
> install scipy with
> $ python setup.py config_fc --fcompiler gnu95 \
>    --f77exec /opt/local/bin/gfortran-mp-4.2 \
>    --f90exec /opt/local/bin/gfortran-mp-4.2 install --prefix=$ 
> Is this expected, as I would have expected install to inherit the
> options that where used during the build phase?

The options used in the build phase aren't stored, so, yes, they need  
to be respecified. For numpy it doesn't matter, as the Fortran  
compiler isn't used. Since we use distutils, you can set the config_fc  
options in a file (either globally for the user in a  
~/.pydistutils.cfg, or per-package in a setup.cfg next to the setup.py  
you're running) by adding the following section to the appropiate file


|David M. Cooke              http://arbutus.physics.mcmaster.ca/dmc/

More information about the SciPy-user mailing list