[Numpy-discussion] Build questions, atlas, lapack...

Simon Burton simon at arrowtheory.com
Thu Jun 8 22:09:19 EDT 2006


On Thu, 8 Jun 2006 16:48:27 -0600
"Fernando Perez" <fperez.net at gmail.com> wrote:

> 
> In summary, I don't really know if this is actually finding what it
> wants or not, given the two messages.

I just went through this on debian sarge which is similar.

I put this in site.cgf:

[atlas]
library_dirs = /usr/lib/atlas/
atlas_libs = lapack, blas

Then I needed to set LD_LIBRARY_PATH to point to /usr/lib/atlas/sse2.

$ env LD_LIBRARY_PATH=/usr/lib/atlas/sse2 python2.4
Python 2.4.3 (#4, Jun  5 2006, 19:07:06)
[GCC 3.4.1 (Debian 3.4.1-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>
[1]+  Stopped                 env LD_LIBRARY_PATH=/usr/lib/atlas/sse2 python2.4

Look in /proc/PID/maps for the relevant libs:

$ ps -a|grep python
...
16953 pts/64   00:00:00 python2.4
$ grep atlas /proc/16953/maps
b6fa7000-b750e000 r-xp 00000000 00:0c 1185402    /usr/lib/atlas/sse2/libblas.so.3.0
b750e000-b7513000 rwxp 00567000 00:0c 1185402    /usr/lib/atlas/sse2/libblas.so.3.0
b7513000-b7a58000 r-xp 00000000 00:0c 1185401    /usr/lib/atlas/sse2/liblapack.so.3.0
b7a58000-b7a5b000 rwxp 00545000 00:0c 1185401    /usr/lib/atlas/sse2/liblapack.so.3.0
$

But to really test this is working I ran python under gdb and set
a break point on cblas_dgemm. Then a call to numpy.dot should
break inside the sse2/liblapack.so.3.0.

(also it's a lot faster with the sse2 dgemm)

$ env LD_LIBRARY_PATH=/usr/lib/atlas/sse2 gdb python2.4
GNU gdb 6.1-debian
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 conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-linux"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) break cblas_dgemm
Function "cblas_dgemm" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (cblas_dgemm) pending.
(gdb) run
Starting program: /home/users/simonb/bin/python2.4
[Thread debugging using libthread_db enabled]
[New Thread -1210476000 (LWP 17557)]
Python 2.4.3 (#4, Jun  5 2006, 19:07:06)
[GCC 3.4.1 (Debian 3.4.1-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Breakpoint 2 at 0xb7549db0
Pending breakpoint "cblas_dgemm" resolved <------- import numpy is in my pythonstartup
>>> a=numpy.empty((1024,1024),'d')
>>> b=numpy.empty((1024,1024),'d')
>>> numpy.dot(a,b)
[Switching to Thread -1210476000 (LWP 17557)]

Breakpoint 2, 0xb7549db0 in cblas_dgemm () from /usr/lib/atlas/sse2/liblapack.so.3
(gdb)

bingo.

Simon.


-- 
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Australia
Ph. 61 02 6249 6940
http://arrowtheory.com 




More information about the NumPy-Discussion mailing list