
I have spent a day attempting to get a version of scipy that passes unit tests on Mac OS X 10.7. I hope the results of my investigations (below) are useful to others trying to do the same thing. Ben == Introduction I have attempted to obtain a version of scipy on Mac OS X 10.7 that passes unit tests, both by downloading it, or by compiling against the system's python, using the three C compilers available, and various compile flags. == Conclusions 1. Both Enthought Python 7.1 and the scipy superpack crash during scipy unit tests. 2. Compilation with the default C compiler (llvm-gcc-4.2) also leads to a crash during unit tests. 3. Compilation using either of the other C compilers (gcc-4.2 or clang) allows scipy to complete unit tests, only if the fortran flag --ff2c is used. In both cases, scipy passes almost all tests -- producing errors on one, and failing two more. With gcc-4.2, numpy passes all tests. With clang, numpy fails one test. 4. The following recipe was most successful for me: * Remove everything in /usr/local and /Library/Python/2.7/site-packages (BEWARE! These directories may well contain stuff you care about) * Install gfortran from here: http://r.research.att.com/gfortran-lion-5666-3.pkg mkdir ~/tmp cd ~/tmp git clone git://github.com/numpy/numpy.git cd numpy export CC=gcc-4.2 export CXX=g++-4.2 export FFLAGS=-ff2c python setupegg.py build --fcompiler=gfortran sudo python setupegg.py install cd ~/tmp git clone git://github.com/scipy/scipy.git cd scipy export CC=gcc-4.2 export CXX=g++-4.2 export FFLAGS=-ff2c python setupegg.py build --fcompiler=gfortran sudo python setupegg.py install (repeat for matplotlib, ipython ...) == Details of test results = Enthought python 7.1 numpy.test(): OK scipy.test(): Crash (Segmentation fault) = Scipy superpack numpy.test(): 3 failures: FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, 1, inf, inf, inf) FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, -1, inf, inf, inf) FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, 0.0, inf, inf, inf) FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, -0.0, inf, inf, inf) FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, inf, inf, inf, inf) FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, -inf, inf, inf, inf) FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, nan, inf, inf, inf) FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, -inf, 1, 0.0, inf) scipy.test(): Crash (Abort trap) = Compilation from scratch (see above for recipe) = llvm-gcc-4.2 = (no compiler flags) numpy.test(): OK scipy.test(): Crash (Segmentation fault: 11) = gcc-4.2 = CC=gcc-4.2 CXX=g++-4.2 numpy.test(): OK scipy.test(): Hang (during ARPACK tests) = clang = CC=clang CXX=clang++ numpy.test(): 1 failure: FAIL: Test basic arithmetic function errors AssertionError: Type <type 'numpy.complex64'> did not raise fpe error ''. scipy.test(): Hang (during ARPACK tests) = llvm-gcc-4.2 and -ff2c = FFLAGS=-ff2c numpy.test(): OK scipy.test(): Crash (Segmentation fault: 11) = gcc-4.2 and -ff2c = CC=gcc-4.2 CXX=g++-4.2 FFLAGS=-ff2c numpy.test(): OK scipy.test(): 1 error, 2 failures: ERROR: test_arpack.test_hermitian_modes(True, <gen-hermitian>, 'F', 2, 'SA', None, None, <function aslinearoperator at 0x1098cd500>) FAIL: test_iterative.test_convergence(<function bicg at 0x1098cdd70>, <nonsymposdef>) FAIL: test_expon (test_morestats.TestAnderson) = clang and -ff2c = CC=clang CXX=clang++ FFLAGS=-ff2c numpy.test(): 1 failure: FAIL: Test basic arithmetic function errors AssertionError: Type <type 'numpy.complex64'> did not raise fpe error ''. scipy.test(): 1 error, 2 failures: ERROR: test_arpack.test_hermitian_modes(True, <gen-hermitian>, 'F', 2, 'SA', None, None, <function aslinearoperator at 0x1098cd500>) FAIL: test_iterative.test_convergence(<function bicg at 0x1098cdd70>, <nonsymposdef>) FAIL: test_expon (test_morestats.TestAnderson)

Hey Ben, hey scipy community! great description. Helped a lot. I wonder why "pip install scipy" does not do this. Who feels responsible for the pip install? What is the suggested (default) way of installing scipy? There is (not yet) a homebrew script. Do we want one? Opinions? cheers, Samuel On 09.08.2011, at 18:09, Ben Willmore wrote:
I have spent a day attempting to get a version of scipy that passes unit tests on Mac OS X 10.7. I hope the results of my investigations (below) are useful to others trying to do the same thing.
Ben
== Introduction
I have attempted to obtain a version of scipy on Mac OS X 10.7 that passes unit tests, both by downloading it, or by compiling against the system's python, using the three C compilers available, and various compile flags.
== Conclusions
1. Both Enthought Python 7.1 and the scipy superpack crash during scipy unit tests.
2. Compilation with the default C compiler (llvm-gcc-4.2) also leads to a crash during unit tests.
3. Compilation using either of the other C compilers (gcc-4.2 or clang) allows scipy to complete unit tests, only if the fortran flag --ff2c is used. In both cases, scipy passes almost all tests -- producing errors on one, and failing two more. With gcc-4.2, numpy passes all tests. With clang, numpy fails one test.
4. The following recipe was most successful for me:
* Remove everything in /usr/local and /Library/Python/2.7/site-packages (BEWARE! These directories may well contain stuff you care about)
* Install gfortran from here: http://r.research.att.com/gfortran-lion-5666-3.pkg
mkdir ~/tmp cd ~/tmp git clone git://github.com/numpy/numpy.git cd numpy export CC=gcc-4.2 export CXX=g++-4.2 export FFLAGS=-ff2c python setupegg.py build --fcompiler=gfortran sudo python setupegg.py install
cd ~/tmp git clone git://github.com/scipy/scipy.git cd scipy export CC=gcc-4.2 export CXX=g++-4.2 export FFLAGS=-ff2c python setupegg.py build --fcompiler=gfortran sudo python setupegg.py install
(repeat for matplotlib, ipython ...)
== Details of test results
= Enthought python 7.1 numpy.test(): OK scipy.test(): Crash (Segmentation fault)
= Scipy superpack numpy.test(): 3 failures: FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, 1, inf, inf, inf) FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, -1, inf, inf, inf) FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, 0.0, inf, inf, inf) FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, -0.0, inf, inf, inf) FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, inf, inf, inf, inf) FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, -inf, inf, inf, inf) FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, nan, inf, inf, inf) FAIL: test_umath_complex.TestCsqrt.test_special_values(<ufunc 'sqrt'>, -inf, 1, 0.0, inf) scipy.test(): Crash (Abort trap)
= Compilation from scratch (see above for recipe)
= llvm-gcc-4.2 = (no compiler flags) numpy.test(): OK scipy.test(): Crash (Segmentation fault: 11)
= gcc-4.2 = CC=gcc-4.2 CXX=g++-4.2 numpy.test(): OK scipy.test(): Hang (during ARPACK tests)
= clang = CC=clang CXX=clang++ numpy.test(): 1 failure: FAIL: Test basic arithmetic function errors AssertionError: Type <type 'numpy.complex64'> did not raise fpe error ''. scipy.test(): Hang (during ARPACK tests)
= llvm-gcc-4.2 and -ff2c = FFLAGS=-ff2c numpy.test(): OK scipy.test(): Crash (Segmentation fault: 11)
= gcc-4.2 and -ff2c = CC=gcc-4.2 CXX=g++-4.2 FFLAGS=-ff2c numpy.test(): OK scipy.test(): 1 error, 2 failures: ERROR: test_arpack.test_hermitian_modes(True, <gen-hermitian>, 'F', 2, 'SA', None, None, <function aslinearoperator at 0x1098cd500>) FAIL: test_iterative.test_convergence(<function bicg at 0x1098cdd70>, <nonsymposdef>) FAIL: test_expon (test_morestats.TestAnderson)
= clang and -ff2c = CC=clang CXX=clang++ FFLAGS=-ff2c numpy.test(): 1 failure: FAIL: Test basic arithmetic function errors AssertionError: Type <type 'numpy.complex64'> did not raise fpe error ''. scipy.test(): 1 error, 2 failures: ERROR: test_arpack.test_hermitian_modes(True, <gen-hermitian>, 'F', 2, 'SA', None, None, <function aslinearoperator at 0x1098cd500>) FAIL: test_iterative.test_convergence(<function bicg at 0x1098cdd70>, <nonsymposdef>) FAIL: test_expon (test_morestats.TestAnderson)
_______________________________________________ SciPy-Dev mailing list SciPy-Dev@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-dev

On Fri, Sep 9, 2011 at 9:15 AM, Samuel John <scipy@samueljohn.de> wrote:
Hey Ben, hey scipy community!
great description. Helped a lot. I wonder why "pip install scipy" does not do this.
The problem is that gcc-llvm seems to have changed the ABI. pip cannot help at all here (pip is a simple installer: it just knows where to download a tarball, read its dependencies, and install them in the correct order for simple cases). cheers, David

On Fri, Sep 9, 2011 at 3:15 PM, Samuel John <scipy@samueljohn.de> wrote:
Hey Ben, hey scipy community!
great description. Helped a lot. I wonder why "pip install scipy" does not do this. Who feels responsible for the pip install? What is the suggested (default) way of installing scipy?
Binary installers on Windows and OS X, or a package like EPD or Python(x,y). On Linux just get it though the package manager.
There is (not yet) a homebrew script. Do we want one?
That may be useful. I'm not a user of homebrew myself, but have only heard good things about it so far. So please go for it!
Ralf

I upgraded to Lion rather than doing a clean install, and I'd previously installed the fortran compiler, but I found that to get scipy on my machine I had to download and install the one listed for Lion in the scipy web site instructions (I think homebrew works for this too). Just an FYI for all you troubleshooters out there. http://www.scipy.org/Installing_SciPy/Mac_OS_X

On Sat, Sep 10, 2011 at 22:15, Ralf Gommers <ralf.gommers@googlemail.com> wrote:
On Fri, Sep 9, 2011 at 3:15 PM, Samuel John <scipy@samueljohn.de> wrote:
There is (not yet) a homebrew script. Do we want one?
That may be useful. I'm not a user of homebrew myself, but have only heard good things about it so far. So please go for it!
I've been working on a homebrew script that creates a virtualenv with numpy/scipy/matplotlib and a few other dependencies as part of the CellProfiler project. It has some constraints specific to our project, but it might be useful to someone else trying to make a more general homebrew recipe. The homebrew fork is here: https://github.com/thouis/homebrew The recipe is 'cellprofiler-dev'. Ray Jones

FYI: I did some work to avoid the currently present problem of building scipy with pip on OS X Lion because of the llvm-gcc and gfortran issue. Here we go: /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" brew install gfortran brew install https://raw.github.com/samueljohn/homebrew-alt/samuel/duplicates/numpy.rb brew install https://raw.github.com/samueljohn/homebrew-alt/samuel/other/scipy.rb Then to install matplotlib: cd to your site-packages: pip install -v -e git+https://github.com/matplotlib/matplotlib#egg=matplotlib-dev A pity that pip install numpy, pip install scipy and pip install matplotlib seems to be broken. bests Samuel
participants (6)
-
Ben Willmore
-
David Cournapeau
-
Michaux Kelley
-
Ralf Gommers
-
Samuel John
-
Thouis (Ray) Jones