Ahoy numpy gurus :-) Would it be possible to adapt the setup.py and/or numpy/distutils to set the right variables on Mac OS X 10.7? (see below). I have looked a bit into the setup.py and the distutils package of numpy but I am a bit lost. Do you think it's possible to teach numpy to use different CC, CXX? And the FFLAGS and the switch --fcompiler=gnu95 arg? Building scipy on OS X Lion 10.7.x currently fails because of some llvm incompatibilies and the gfortran. While it's easy to get gfortran e.g. via http://mxcl.github.com/homebrew/ it's hard to `pip install scipy` or manual install because you have to:
export CC=gcc-4.2 export CXX=g++-4.2 export FFLAGS=-ff2c python setup.py build --fcompiler=gnu95
This way, numpy and then scipy builds successfully. Scipy uses the distutil settings from numpy -- as far as I get it -- and therefore scipy cannot add these variables. Right? It would be great if numpy and scipy would build right out-of-the-box on OS X, again. I'd love to provide a patch but I am lost in the depth of distutils... Samuel
On Mon, Sep 19, 2011 at 3:03 PM, Samuel John <scipy@samueljohn.de> wrote:
Ahoy numpy gurus :-)
Would it be possible to adapt the setup.py and/or numpy/distutils to set the right variables on Mac OS X 10.7? (see below). I have looked a bit into the setup.py and the distutils package of numpy but I am a bit lost.
Do you think it's possible to teach numpy to use different CC, CXX?
This is possible, but numpy probably shouldn't mess with these variables. As a user you can set them permanently by adding them to your bash_profile for example. And the FFLAGS This needs to be solved. Perhaps the solution involves more wrappers for broken vecLib/Accelerate functions in scipy? Does anyone know which routines are broken on 10.7? For 10.6 I found this discussion helpful: http://www.macresearch.org/lapackblas-fortran-106. It is claimed there that while '-ff2c' fixes complex routines, it breaks SDOT when used with '-m64'. SDOT is used in linalg.
and the switch --fcompiler=gnu95 arg?
This shouldn't be necessary if you only have gfortran installed. Ralf
Building scipy on OS X Lion 10.7.x currently fails because of some llvm incompatibilies and the gfortran. While it's easy to get gfortran e.g. via http://mxcl.github.com/homebrew/it's hard to `pip install scipy` or manual install because you have to:
export CC=gcc-4.2 export CXX=g++-4.2 export FFLAGS=-ff2c python setup.py build --fcompiler=gnu95
This way, numpy and then scipy builds successfully. Scipy uses the distutil settings from numpy -- as far as I get it -- and therefore scipy cannot add these variables. Right?
It would be great if numpy and scipy would build right out-of-the-box on OS X, again.
I'd love to provide a patch but I am lost in the depth of distutils...
Samuel
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Ralf, thanks for your answer. However, in short: I want `pip install numpy; pip install scipy` to work on OS X Lion without extra effort :-) On 19.09.2011, at 19:05, Ralf Gommers wrote:
Do you think it's possible to teach numpy to use different CC, CXX?
This is possible, but numpy probably shouldn't mess with these variables. As a user you can set them permanently by adding them to your bash_profile for example.
The problem is that most things do work fine with the default gcc which has the llvm backend on OS X Lion (10.7) /usr/bin/gcc -> llvm-gcc-4.2. But somehow scipy has problems with that backend. I do not want to set CC CXX permanently. I made a homebrew formula for numpy, which takes care of these things. But the policy of the homebrew team is to avoid duplicates which can be installed via pip. Therefore I am asking for support if someone could point me to the place where the compiler is chosen. I'd propose to add an OS X 10.7 switch there in order to avoid the llvm.
And the FFLAGS
This needs to be solved. Perhaps the solution involves more wrappers for broken vecLib/Accelerate functions in scipy? Does anyone know which routines are broken on 10.7? For 10.6 I found this discussion helpful: http://www.macresearch.org/lapackblas-fortran-106. It is claimed there that while '-ff2c' fixes complex routines, it breaks SDOT when used with '-m64'. SDOT is used in linalg.
I don't know nothing of such things. :-( If there is really something broken with vecLib/Accelerate, a ticket on Apple's bugtracker rdar should be opened.
and the switch --fcompiler=gnu95 arg?
This shouldn't be necessary if you only have gfortran installed.
Ah ok. Thanks! cheers, Samuel
Building scipy on OS X Lion 10.7.x currently fails because of some llvm incompatibilies and the gfortran. While it's easy to get gfortran e.g. via http://mxcl.github.com/homebrew/ it's hard to `pip install scipy` or manual install because you have to:
export CC=gcc-4.2 export CXX=g++-4.2 export FFLAGS=-ff2c python setup.py build --fcompiler=gnu95
This way, numpy and then scipy builds successfully. Scipy uses the distutil settings from numpy -- as far as I get it -- and therefore scipy cannot add these variables. Right?
It would be great if numpy and scipy would build right out-of-the-box on OS X, again.
I'd love to provide a patch but I am lost in the depth of distutils...
On Tue, Sep 20, 2011 at 5:13 AM, Samuel John <scipy@samueljohn.de> wrote:
Ralf, thanks for your answer.
However, in short:
I want `pip install numpy; pip install scipy` to work on OS X Lion without extra effort :-)
On 19.09.2011, at 19:05, Ralf Gommers wrote:
Do you think it's possible to teach numpy to use different CC, CXX?
This is possible, but numpy probably shouldn't mess with these variables. As a user you can set them permanently by adding them to your bash_profile for example.
The problem is that most things do work fine with the default gcc which has the llvm backend on OS X Lion (10.7) /usr/bin/gcc -> llvm-gcc-4.2. But somehow scipy has problems with that backend. I do not want to set CC CXX permanently. I made a homebrew formula for numpy, which takes care of these things. But the policy of the homebrew team is to avoid duplicates which can be installed via pip. Therefore I am asking for support if someone could point me to the place where the compiler is chosen. I'd propose to add an OS X 10.7 switch there in order to avoid the llvm.
And the FFLAGS
This needs to be solved. Perhaps the solution involves more wrappers for broken vecLib/Accelerate functions in scipy? Does anyone know which routines are broken on 10.7? For 10.6 I found this discussion helpful: http://www.macresearch.org/lapackblas-fortran-106. It is claimed there that while '-ff2c' fixes complex routines, it breaks SDOT when used with '-m64'. SDOT is used in linalg.
I don't know nothing of such things. :-( If there is really something broken with vecLib/Accelerate, a ticket on Apple's bugtracker rdar should be opened.
and the switch --fcompiler=gnu95 arg?
This shouldn't be necessary if you only have gfortran installed.
Ah ok. Thanks!
I will try to look at this problem next week, when I will receive a new laptop with Lion on it. If I forget about it, please ping me at the end of next week, we need to fix this, cheers, David
Hi! On 20.09.2011, at 14:41, David Cournapeau wrote:
Ralf, thanks for your answer.
However, in short:
I want `pip install numpy; pip install scipy` to work on OS X Lion without extra effort :-) [...] I will try to look at this problem next week, when I will receive a new laptop with Lion on it. If I forget about it, please ping me at
On Tue, Sep 20, 2011 at 5:13 AM, Samuel John <scipy@samueljohn.de> wrote: the end of next week, we need to fix this,
Congratulation to your new Mac :-) When I download scipy.10.0b2 and get gfortran via homebrew: brew install gfortran (which is not the issue here) cd scipy-0.10.0b2 python setup.py build python setup.py install Then, scipy.test() causes segfaults or malloc errors:
samuel@ubi:~/Downloads/scipy-0.10.0b2 $ cd .. samuel@ubi:~/Downloads $ ipython Python 2.7.2 (default, Sep 16 2011, 11:18:55) Type "copyright", "credits" or "license" for more information.
IPython 0.11 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details.
In [1]: import scipy
In [2]: scipy.test() Running unit tests for scipy NumPy version 1.6.1 NumPy is installed in /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy SciPy version 0.10.0b2 SciPy is installed in /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy Python version 2.7.2 (default, Sep 16 2011, 11:18:55) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] nose version 1.1.2 ...................................................................................................................................................................................F.FSegmentation fault: 11 samuel@ubi:~/Downloads $ ipython Python 2.7.2 (default, Sep 16 2011, 11:18:55) Type "copyright", "credits" or "license" for more information.
IPython 0.11 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details.
In [1]: import scipy
In [2]: scipy.test() Running unit tests for scipy NumPy version 1.6.1 NumPy is installed in /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy SciPy version 0.10.0b2 SciPy is installed in /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy Python version 2.7.2 (default, Sep 16 2011, 11:18:55) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] nose version 1.1.2 ...................................................................................................................................................................................F.FFPython(93907,0x7fff7201b960) malloc: *** error for object 0x105ce5630: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug Abort trap: 6
However, when setting the CC, CXX and FFLAGS explicitly to avoid llvm: export CC=gcc-4.2 export CXX=g++-4.2 export FFLAGS=-ff2c python setup.py build python setup.py install Then scipy.test() works fine:
In [2]: scipy.test() Running unit tests for scipy NumPy version 1.6.1 NumPy is installed in /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy SciPy version 0.10.0b2 SciPy is installed in /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy Python version 2.7.2 (default, Sep 16 2011, 11:18:55) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] nose version 1.1.2 ............................................................................................................................................................................................................................K............................................................................................................/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/interpolate/fitpack2.py:674: UserWarning: The coefficients of the spline returned have been computed as the minimal norm least-squares solution of a (numerically) rank deficient system (deficiency=7). If deficiency is large, the results may be inaccurate. Deficiency may strongly depend on the value of eps. warnings.warn(message) ....../usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/interpolate/fitpack2.py:605: UserWarning: The required storage space exceeds the available storage space: nxest or nyest too small, or s too small. The weighted least-squares spline corresponds to the current set of knots. warnings.warn(message) ........................K..K....../usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/numeric.py:1920: RuntimeWarning: invalid value encountered in absolute return all(less_equal(absolute(x-y), atol + rtol * absolute(y))) ............................................................................................................................................................................................................................................................................................................................................................................................................................................/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/io/wavfile.py:31: WavFileWarning: Unfamiliar format bytes warnings.warn("Unfamiliar format bytes", WavFileWarning) /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/io/wavfile.py:121: WavFileWarning: chunk not understood warnings.warn("chunk not understood", WavFileWarning) ...............................................................................................................................................................................................................................SSSSSS......SSSSSS......SSSS...............................................................................S............................................................................................................................................................................................................................................................K..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................SSSSSSSSSSS.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K...............................................................K...........................................................................................................................................................KK.............................................................................................................................................................................................................................................................................................................................................................................................................................................K.K.............................................................................................................................................................................................................................................................................................................................................................................................K........K..............SSSSSSS............................................................................................................................................................................................................................................................................................................................................................................................../usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/stats/distributions.py:4110: RuntimeWarning: overflow encountered in exp return exp(c*x-exp(x)-gamln(c)) ................................./usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/stats/distributions.py:4592: RuntimeWarning: invalid value encountered in sqrt vals = 2*(bt+1.0)*sqrt(b-2.0)/((b-3.0)*sqrt(b)) .........................................................................................................................................................................................................................................................................................................S................................................................................................................................................................................................/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/stats/distributions.py:5107: RuntimeWarning: divide by zero encountered in divide return where((lam <= 0) | (abs(x) < 1.0/arr(lam)), Px, 0.0) ....................................................................................................................................................................................................................................................................................................................................................................................................................... ---------------------------------------------------------------------- Ran 5651 tests in 53.627s
OK (KNOWNFAIL=12, SKIP=36) Out[2]: <nose.result.TextTestResult run=5651 errors=0 failures=0>
Samuel
participants (3)
-
David Cournapeau
-
Ralf Gommers
-
Samuel John