[SciPy-dev] Building newscipy against non-atlas blas/lapack libraries

Nils Wagner nwagner at mecha.uni-stuttgart.de
Mon Nov 7 04:55:01 EST 2005


Pearu Peterson wrote:
>On Mon, 7 Nov 2005, Nils Wagner wrote:
>
>  
>>>Using LAPACK_SRC approuch will not work as some LAPACK source files need
>>>to be compiled without optimization flags but currently scipy.distutils
>>>does not support switching off optimization for certain files. Using
>>>`config_fc --noopt` would switch off optimization for all Fortran sources.
>>>
>>>So, you need to build at least LAPACK library manually, see `Building
>>>the LAPACK library` section in
>>>
>>>  http://www.scipy.org/documentation/buildatlas4scipy.txt
>>>
>>>      
>>Following your advice, I have build the LAPACK library from scratch
>>using OPTS     = -O2.
>>
>>/home/nwagner> echo $LAPACK
>>/var/tmp/LAPACK/lapack_LINUX.a
>>/home/nwagner> echo $LAPACK_SRC
>>LAPACK_SRC: Undefined variable.
>>/home/nwagner> echo $BLAS_SRC
>>/var/tmp/src/blas
>>
>>Now scipy.test(10,10) yields one error
>>
>>======================================================================
>>FAIL: check_nils (scipy.linalg.matfuncs.test_matfuncs.test_signm)
>>----------------------------------------------------------------------
>>Traceback (most recent call last):
>> File
>>"/usr/local/lib/python2.4/site-packages/scipy/linalg/tests/test_matfuncs.py",
>>line 44, in check_nils
>>   assert_array_almost_equal(r,cr)
>> File "/usr/local/lib/python2.4/site-packages/scipy/test/testing.py",
>>line 735, in assert_array_almost_equal
>>   assert cond,\
>>AssertionError:
>>Arrays are not almost equal (mismatch 100.0%):
>>       Array 1: [[ -5.2848319e-01 +3.8543597e+00j  -6.2440787e+01
>>+6.0410538e+00j
>>   2.7508638e+01 +1.3623836e+01j   5.9339443e+00 +3.4...
>>       Array 2: [[ 11.9493333  -2.2453333  15.3173333  21.6533333
>>-2.2453333]
>>[ -3.8426667   0.4986667  -4.5906667  -7.1866667   0.498...
>>
>>
>>----------------------------------------------------------------------
>>Ran 1331 tests in 179.443s
>>
>>FAILED (failures=1)
>>
>>0.4.3.1440
>>0.4.2_1422
>>
>>
>>The repeated computation of logm(A) yields different results, but for
>>what reason ?
>>See the imaginary part  -9.91687203e+00j in the last loop.
>>
>>    
>>>>>A
>>>>>          
>>array([[ 3.1,  0. ],
>>      [ 0. ,  3.1]])
>>
>>    
>>>>>linalg.logm(A)
>>>>>          
>>array([[  1.13140211e+000,   1.49230383e-269],
>>      [  0.00000000e+000,   1.13140211e+000]])
>>    
>>>>>linalg.logm(A)
>>>>>          
>>array([[  1.13140211e+000,   1.33902098e-270],
>>      [  0.00000000e+000,   1.13140211e+000]])
>>    
>>>>>linalg.logm(A)
>>>>>          
>>array([[  1.13140211e+000,   1.62403951e-270],
>>      [  0.00000000e+000,   1.13140211e+000]])
>>    
>>>>>linalg.logm(A)
>>>>>          
>>array([[  1.13140211e+000,  -2.19984796e-269],
>>      [  0.00000000e+000,   1.13140211e+000]])
>>    
>>>>>linalg.logm(A)
>>>>>          
>>array([[ 1.13140211 +0.00000000e+00j,  0.         -9.91687203e+00j],
>>      [ 0.         +0.00000000e+00j,  1.13140211 +0.00000000e+00j]])
>>
>>Any pointer how to resolve these problems ?
>>
>>Newscipy should work without ATLAS.
>>    
>
>Agreed. But I cannot reproduce this problem with or without ATLAS.
>Try building scipy without optimization:
>
>   rm -rf build
>   python setup.py config_fc --noopt install
>   python -c 'import scipy;scipy.linalg.test()'
>
>And then also try building BLAS libraries manually.
>
>Also note that I have removed Numeric from my system (moving
>Numeric to Numeric.hide would be enough). Try the same.
>
>Pearu
>
>_______________________________________________
>Scipy-dev mailing list
>Scipy-dev at scipy.net
>http://www.scipy.net/mailman/listinfo/scipy-dev
>  


Hi Pearu,

I have also build a BLAS library from scractch.

/home/nwagner> echo $BLAS
/var/tmp/src/lapack/LAPACK/blas_LINUX.a
/home/nwagner> echo $LAPACK
/var/tmp/src/lapack/LAPACK/lapack_LINUX.a


If I import scipy now 

>>> import scipy
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.4/site-packages/scipy/__init__.py", line 32, in ?
    from scipy.basic.fft import fft, ifft
  File "/usr/local/lib/python2.4/site-packages/scipy/basic/fft.py", line 22, in ?
    from fft_lite import *
  File "/usr/local/lib/python2.4/site-packages/scipy/basic/fft_lite.py", line 23, in ?
    import scipy.lib.fftpack_lite as fftpack
  File "/usr/local/lib/python2.4/site-packages/scipy/lib/__init__.py", line 9, in ?
    import blas
  File "/usr/local/lib/python2.4/site-packages/scipy/lib/blas/__init__.py", line 9, in ?
    import fblas
ImportError: /usr/local/lib/python2.4/site-packages/scipy/lib/blas/fblas.so: undefined symbol: srotmg_

How can I fix this problem ?

Nils





More information about the SciPy-Dev mailing list