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

Fernando Perez fperez.net at gmail.com
Thu Jun 8 21:25:59 CDT 2006


On 6/8/06, Simon Burton <simon at arrowtheory.com> wrote:
> 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.

[...]


> 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

OK, thanks a LOT for that gdb trick: it provides a very nice way to
understand what's actually going on.  self.note("really, learn better
use of gdb")

Using that, though, it would then seem as if the build DID
successfully find everything without any further action on my part:

longs[dist]> gdb python
GNU gdb 6.4-debian
...

(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: /usr/bin/python

...

Python 2.4.3 (#2, Apr 27 2006, 14:43:58)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(no debugging symbols found)
>>> import numpy
Breakpoint 2 at 0x40429860
Pending breakpoint "cblas_dgemm" resolved
>>> a=numpy.empty((1024,1024),'d')
>>> b=numpy.empty((1024,1024),'d')
>>> numpy.dot(a,b)
[Switching to Thread 1075428416 (LWP 3919)]

Breakpoint 2, 0x40429860 in cblas_dgemm () from /usr/lib/sse2/libcblas.so.3
======================================================

Note that on my system, LD_LIBRARY_PATH does NOT contain that dir:

longs[dist]> env | grep LD_LIB
LD_LIBRARY_PATH=/usr/local/lf9560/lib:/usr/local/intel/mkl/8.0.2/lib/32:/usr/local/intel/compiler90/lib:/home/fperez/usr/lib:/home/fperez/usr/local/lib:

and I built everything with a plain

setup.py install --prefix=~/tmp/local

without /any/ tweaks to site.cfg, no LD_LIBRARY_PATH modifications or
anything else.  I just installed atlas-sse2* and lapack3*, but NOT
refblas3*.

Basically it seems that the build process does the right thing out of
the box, and the warning is spurious.  Since I was being extra-careful
in this build, I didn't want to let any warning of that kind go
unchecked.

It might still be worth fixing that warning to prevent others from
going on a similar wild goose chase, but I'm not comfortable touching
that code (I don't know if anyone besides Pearu is).

Thanks for the help!

Cheers,

f




More information about the Numpy-discussion mailing list