[SciPy-dev] building lib.lapack without optimization

Pearu Peterson pearu at scipy.org
Tue Nov 30 06:47:28 CST 2004



On Tue, 30 Nov 2004, Nils Wagner wrote:

> Here are my findings...
>
> python2.3 setup_lapack.py build config_fc --noarch --opt="-O2" yields
>
> ======================================================================
> FAIL: check_heev_complex (__main__.test_clapack_complex)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "tests/test_lapack.py", line 51, in check_heev_complex
>   assert_array_almost_equal(dot(a,v[:,i]),w[i]*v[:,i])
> File "/usr/lib/python2.3/site-packages/scipy_test/testing.py", line 748, in 
> assert_array_almost_equal
>   assert cond,\
> AssertionError:
> Arrays are not almost equal (mismatch 33.3333333333%):
>       Array 1: [-1.2905481 -4.3758251e+00j -2.0410486 +1.3645462e+00j
>      3.5935487 +2.8312206e-07j]
>       Array 2: [-1.2905486-4.3758267j -2.041049 +1.3645459j  3.5935484-0.j 
> ]
>
>
> ======================================================================
> FAIL: check_heev_complex (__main__.test_flapack_complex)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "tests/test_lapack.py", line 51, in check_heev_complex
>   assert_array_almost_equal(dot(a,v[:,i]),w[i]*v[:,i])
> File "/usr/lib/python2.3/site-packages/scipy_test/testing.py", line 748, in 
> assert_array_almost_equal
>   assert cond,\
> AssertionError:
> Arrays are not almost equal (mismatch 33.3333333333%):
>       Array 1: [-1.2905481 -4.3758251e+00j -2.0410486 +1.3645462e+00j
>      3.5935487 +2.8312206e-07j]
>       Array 2: [-1.2905486-4.3758267j -2.041049 +1.3645459j  3.5935484-0.j 
> ]

So, -O2 fixes the problem. I'll make it default for gcc-3.3.3 compiler.

Also, if your lapack libraries are built with -O3 then rebuilding them 
with -O2 should fix the segmentation faults.

> So any optimization fails.

Note that in the failures the results are actually correct. Just the 
corresponding tests need some tuning.. So, I am not considering them as 
failures.

>>>> What gcc version are you using?
>>> gcc version 3.3.3 (SuSE Linux)
>> Btw, I am using gcc 3.3.5 (Debian Sid) with no problems.
>> 
> SuSE 9.2 comes with gcc 3.3.4.
> Do you have any experience with that version ?

I don't remember.

Pearu




More information about the Scipy-dev mailing list