[SciPy-Dev] build issue on OS X 10.6 - fails on fftpack

Ralf Gommers ralf.gommers@googlemail....
Wed Mar 3 08:14:37 CST 2010


On Mon, Mar 1, 2010 at 11:03 AM, David Cournapeau <david@silveregg.co.jp>wrote:

> Ralf Gommers wrote:
> >
> >
> > On Mon, Mar 1, 2010 at 9:50 AM, David Cournapeau <david@silveregg.co.jp
> > <mailto:david@silveregg.co.jp>> wrote:
> >
> >     Ralf Gommers wrote:
> >
> >      > $ LDFLAGS="-lgfortran -arch x86_64" FFLAGS="-arch x86_64" python
> >
> >     Whenever you redefine one of the CFLAGS/FFLAGS/CXXFLAGS/LDFLAGS, it
> >     *overwrites* the default value (contrary to the usual behavior of
> having
> >     its value appended to the default value).
> >
> >
> > I followed the instructions under "Obtaining and Building NumPy and
> > SciPy on this page: http://www.scipy.org/Installing_SciPy/Mac_OS_X .
> > There it says that the above command *extends* the build flags. So that
> > info is wrong? Or maybe I'm still not understanding something.
>
> Both are true :) If you build with numscons, then the flags are
> extended. If you build with distutils, the flags are overriden.
>
> The wiki could be made clearer there.
>

When everything works for me I'll update the wiki. But first some more
questions.

This command:
$ LDFLAGS="-lgfortran -arch x86_64" FFLAGS="-arch x86_64" python
setupscons.py scons --package=scipy.linalg
fails:
Checking for ACCELERATE ... no
Checking for ATLAS ... no
Checking for MKL ... no
Checking for CBLAS ... (cached) no
Checking for CLAPACK ... (cached) no

But without trying to extend the flags:
$ python setupscons.py scons --package=scipy.linalg
it works:
Checking for ACCELERATE ... yes
Checking for CBLAS ... yes - ACCELERATE
Checking for CLAPACK ... (cached) no
Checking gfortran C compatibility runtime
...-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3
-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../.. -lgfortranbegin
-lgfortran
Checking if gfortran needs dummy main - MAIN__.
Checking gfortran name mangling - '_', '', lower-case.
Checking for ACCELERATE ... yes
Checking for F77 BLAS ... yes - ACCELERATE
Checking for ACCELERATE ... yes
Checking for F77 LAPACK ... yes - ACCELERATE


Any idea what is going on here? I'm using numscons 0.12.0, last commit is
76db80c1413d0b8f73761de713797355c7ccf4c0.

The extra flags are needed on SL, since if I build without them:
$ python setupscons.py scons -i
then the build finishes and I can import scipy, but running the test suite
gives a lot of errors like this:
ImportError: dlopen(/Users/rgommers/Code/scipy/_csr.so, 2): no suitable
image found.  Did find:
    /Users/rgommers/Code/scipy/_csr.so: mach-o, but wrong architecture




> >
> >
> >     here, by overwriting LDFLAGS, you remove all the link options
> necessary
> >     to build a bundle, and the linker believes you want to build an
> >     executable (hence the missing main symbol message, and all the
> >     unresolved symbols from libpython.dylib).
> >
> >
> > To be clear, I'm just trying to build scipy on my own machine
>
> The flag issue is a distutils issue, and happens whenever you call
> setup.py. You should not try to edit flags if you build with distutils,
> really - the overriding support implies that it should be used as last
> resort, and otherwise, everything should be handled within distutils.
>
> So is there an easy way to build scipy on SL with distutils, or should I
just stick to numscons if I get that to work?

Thanks,
Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20100303/712f7dac/attachment.html 


More information about the SciPy-Dev mailing list