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

Pearu Peterson pearu at scipy.org
Mon Nov 7 02:58:17 EST 2005



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




More information about the SciPy-Dev mailing list