Debian stable has an older numpy, so I'll document a custom installation here. It isn't hard, it's just that getting the linear algebra libraries working optimally was hard (the main problem was the illegal instruction thing below)

Packages to consider installing: lapack-dev, lapack3-dev, atlas3-* (dev stuff and headers), refblas3-dev.

Test Script

This test script will print out the time it takes to invert a big matrix.

time python2.4 -c $'N=1000 ; import numpy,math; a=numpy.arange(N**2, dtype=float); a=a.reshape(N,N) \nfor x in range(N):\n a[x,x]=10 \nprint a; print numpy.linalg.inverse(a)'

Who

Computer/proc/comments

matrix size

time

rkd

boltzmann/2.4GHz P4 / no atlas

1000

13 s

rkd

boltzmann/2.4GHz P4 / with atlas

1000

3 s

rkd

zarankiewicz/3GHz P4 dual core / no atlas

1000

s

rkd

zarankiewicz/3GHz P4 dual core / with atlas

1000

s

Illegal Instruction

Sometimes it dies with "Illegal Instruction". I found something that looks similar here: http://www.scipy.net/pipermail/scipy-user/2006-April/007804.html, but I'm not sure if that would fix it. I didn't want to do the libc recompiling. If you remove the atlas3-* dev packages, it won't use atlas and it won't be trigered, but then the inversions are really slow. If you install lapack-dev (not just lapack3-dev), it will pull in atlas2-* and give high performance and not die. We'll deal with the rest of it later.

If you use a newer libc (probably Ubuntu does), I bet you won't have this problem.

DebianNotes/Numpy (last edited 2008-03-10 01:39:19 by localhost)