[SciPy-dev] building lib.lapack without optimization

Nils Wagner nwagner at mecha.uni-stuttgart.de
Wed Dec 1 04:42:42 CST 2004

Pearu Peterson wrote:

> On Wed, 1 Dec 2004, Nils Wagner wrote:
>> First of all,  I have rebuild my lapack library with -O2.
>> Secondly, I have installed ATLAS from scratch.
>> From my ATLAS directory, issue :
>>  make killall arch=ARCH
>>  make startup arch=ARCH
>>  make install arch=ARCH
>> Then I build a complete lapack library
>> ATLAS does not provide a full LAPACK library. However, there is a 
>> simple way to get ATLAS to provide its faster LAPACK routines to a 
>> full LAPACK library. ATLAS's internal routines are distinct from 
>> LAPACK's, so it is safe to compile ATLAS's LAPACK routines directly 
>> into a netlib-style LAPACK library. First, download and install the 
>> standard LAPACK library from the LAPACK homepage 
>> <http://www.netlib.org/lapack>. Then, in your ATLAS/lib/ARCH 
>> directory (where you should have a liblapack.a), issue the following 
>> commands:
>> mkdir tmp
>> cd tmp
>> ar x ../liblapack.a
>> cp <your LAPACK path & lib> ../liblapack.a
>> ar r ../liblapack.a *.o
>> cd ..
>> rm -rf tmp
>> Again, scipy.test() failed with a segmentation fault. Am I missing 
>> something ?
> I think from the success of using Fortran blas/lapack libraries it is 
> now clear that the issue is not in scipy.
> If you update scipy CVS tree, install scipy_core, then running in 
> Lib/lapack
>   python tests/test_lapack.py -v 10
> should show test name before crashing python.
 python2.3 tests/test_lapack.py -v 10
  Found 66 tests for __main__
check_gebal (__main__.test_flapack_complex) ... ok
check_heev (__main__.test_flapack_complex)Segmentation fault

> Then study the corresponding test and try to find the simplest way to 
> reproduce the segmentation fault. This probably means calling some 
> function from flapack.so. Try using different arguments for this 
> function to see if some combination does succeed. 

Python 2.3.3 (#1, Apr  6 2004, 01:47:39)
[GCC 3.3.3 (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import scipy
 >>> scipy.lib.lapack.flapack.cheev([[1,2],[2,2]])
(array([-0.56155282,  3.56155276],'f'), array([[-0.78820544+0.j,  
       [ 0.61541224+0.j,  0.78820544+0.j]],'F'), 0)
 >>> scipy.lib.lapack.flapack.cheev([[1,2,3],[2,2,3],[3,3,6]])
Segmentation fault
 >>> scipy.lib.lapack.flapack.cheev([[1j,2j],[3,2]])
Segmentation fault

> If not, create a C program that is using the corresponding routine to 
> prove a possible bug in ATLAS or compiler. Then report your findings 
> to scipy-dev and we'll try to find a workaround for you.

gcc main.c -L/var/tmp/LAPACK -llapack -lg2c

/home/nwagner> gdb a.out
GNU gdb 6.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-suse-linux"...Using host libthread_db 
library "/lib/tls/libthread_db.so.1".

(gdb) run
Starting program: /home/nwagner/a.out

Program received signal SIGSEGV, Segmentation fault.
0x400961db in cheev_ () from /usr/lib/liblapack.so.3

I do not understand the usage of /usr/lib/liblapack.so.3. This library 
comes with SuSE as an rpm...


> Another option for you would be arrange a temporary account to your 
> machine so that I could login and try to do some diagnostics myself.
> Regards,
> Pearu
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-dev

Dr.-Ing. Nils Wagner

Institut A für Mechanik
Universität Stuttgart

Pfaffenwaldring 9
D-70550 Stuttgart

Tel.: (+49) 0711 685 6262
Fax.: (+49) 0711 685 6282

E-mail: nwagner at mecha.uni-stuttgart.de
URL   : http://www.mecha.uni-stuttgart.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-c
Size: 415 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-dev/attachments/20041201/fcc97551/attachment.bin 

More information about the Scipy-dev mailing list