[Numpy-discussion] (2012) Accessing LAPACK and BLAS from the numpy C API

Sturla Molden sturla@molden...
Sat Mar 10 15:56:34 CST 2012

Den 07.03.2012 21:02, skrev "V. Armando Solé":
> I had already used the information Robert Kern provided on the 2009 
> thread and obtained the PyCObject as:
> from scipy.linalg.blas import fblas
> dgemm = fblas.dgemm._cpointer
> sgemm = fblas.sgemm._cpointer
> but I did not find a way to obtain those pointers from numpy. That was 
> the goal of my post. My extension needs SciPy installed just to fetch 
> the pointer. It would be very nice to have a way to get similar 
> information from numpy.

The problem here is that NumPy's lapack_lite is compiled to C with f2c, 
and there is a handwritten C extension module (lapack_litemodule.c) to 
use it. Unlike SciPy, it does not use f2py to call Fortran LAPACK directly.

I am not sure why NumPy uses f2c'd routines instead of a dependency on 
BLAS and LAPACK like SciPy.

And by Murphy's law, function pointers to the f2c'd LAPACK routines are 
not exported from lapack_lite.pyd. So it does not even help to load it 
with ctypes as an ordinary DLL.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120310/8e0a76a4/attachment.html 

More information about the NumPy-Discussion mailing list