[Numpy-discussion] numpy distutils breaks scipy install on mac

Robert Kern robert.kern@gmail....
Tue Dec 8 15:47:33 CST 2009

On Tue, Dec 8, 2009 at 15:36, Mark Sienkiewicz <sienkiew@stsci.edu> wrote:
> When I compile scipy on a mac, the build fails with:
> ...
> gfortran:f77: scipy/fftpack/src/dfftpack/dcosqb.f
> f951: error: unrecognized command line option "-arch"
> f951: error: unrecognized command line option "-arch"
> f951: error: unrecognized command line option "-arch"
> f951: error: unrecognized command line option "-arch"
> error: Command "/sw/bin/gfortran -Wall -ffixed-form
> -fno-second-underscore -arch i686 -arch x86_64 -fPIC -O3 -funroll-loops
> -I/usr/stsci/pyssgdev/2.5.4/numpy/core/include -c -c
> scipy/fftpack/src/dfftpack/dcosqb.f -o
> build/temp.macosx-10.3-i386-2.5/scipy/fftpack/src/dfftpack/dcosqb.o"
> failed with exit status 1
> I have
> % gfortran --version
> GNU Fortran (GCC) 4.3.0
> Copyright (C) 2008 Free Software Foundation, Inc.
> % which gfortran
> /sw/bin/gfortran
> (This /sw/bin apparently means it was installed by "fink".  My IT
> department did this.  This is not the recommended compiler from AT&T,
> but it seems a likely configuration to encounter in the wild, and I
> didn't expect a problem. )
> I traced the problem to numpy/distutils/fcompiler/gnu.py in the class
> Gnu94FCompiler.  The function _universal_flags() tries to detect which
> processor types are recognized by the compiler, presumably in an attempt
> to make a macintosh universal binary.  It adds "-arch whatever" for each
> architecture that it thinks it detected.  Since gfortran does not
> recognize "-arch", the compile fails.
> ( Presumably, some other version of gfortan does accept -arch, or this
> code wouldn't be here, right? )

Right. The -arch flag was added by Apple to GCC and their patch really
should be applied to all builds of GCC compilers for the Mac. It is
deeply disappointing that Fink ignored this. The only Mac gfortran
build that I can recommend is here:


_can_target() should be fixed to be more accurate, though, so if you
find a patch that works for you, please let us know.

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 NumPy-Discussion mailing list