building numpy20 on native blas/lapack

Benyang Tang btang at pacific.jpl.nasa.gov
Wed Apr 25 13:49:32 EDT 2001


Thanks. I added the lapack library to setup.py. It worked. The setup.py now looks like this:

# delete all but the first one in this list if using your own LAPACK/BLAS
sourcelist = ['Src/lapack_litemodule.c',]
# set these to use your own BLAS
library_dirs_list = ['/usr/lib','/usr/local/lib','/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66']
libraries_list = ['blas','lapack','g2c','m']

However, numpy does not get any speed gain by linking to the native blas/lapack. Here I tested the multiplication of 2 real*4 matrixes:
Multiplication of 100X100 matrixes takes  0.01
Multiplication of 200X200 matrixes takes  0.11
Multiplication of 300X300 matrixes takes  0.41
Multiplication of 400X400 matrixes takes  1.47
Multiplication of 500X500 matrixes takes  3.10
Multiplication of 600X600 matrixes takes  5.51

The timing is roughly the same as that when linking to the compiled blas_lite.

Robert Kern wrote:
> 
> dgesvd is a LAPACK function, not a BLAS function. You need a LAPACK library,
> and not just a BLAS. If you don't have an optimized version, then go to
> http://netlib.org/lapack to get the FORTRAN version. Compile it per the
> instructions and link it in before the BLAS library in the library_list.
> I don't know where to get convenient RPMs.
> 
> 
> --
> Robert Kern
> kern at caltech.edu
> 
> "In the fields of hell where the grass grows high
>  Are the graves of dreams allowed to die."
>   -- Richard Harter

-- 
<> Benyang Tang               
<> 300-323, JPL                  
<> 4800 Oak Grove Drive          
<> Pasadena, CA 91109, USA



More information about the Python-list mailing list