[SciPy-Dev] scipy.linalg.lapack + C(ython)

Sturla Molden sturla@molden...
Tue Aug 7 10:59:47 CDT 2012


On 02.08.2012 12:10, Robert Cimrman wrote:

> I need to write a C or Cython extension module that would involve repeated
> solves of a linear system with a dense matrix. For this, I would like to use
> the LAPACK function pointers provided by SciPy, to avoid dealing with LAPACK
> installation myself.
>
> I am aware of [1] so I know how to get to the right LAPACK function pointer,
> but it would help me a lot to look at an existing Cython or C code - has anyone
> done something similar?

Personally I feel that using the official C interfaces to BLAS and 
LAPACK (i.e. CBLAS and LAPACKE) are easier than dealing with Fortran 
interfaces (when using C or Cython). Particularly integer size and name 
mangling tend to very between Fortran compilers. With CBLAS and LAPACKE 
we know what the interface is in C, independent of the Fortran 
implementation. We can even use arrays that are C ordered, which most 
NumPy programs do.


Sturla










More information about the SciPy-Dev mailing list