clapack interface and mkl

clapack interface and mkl

Being a c++ programmer, I got tired of transating the lapack calls into c++ template functions and decided to make use of an already existing library, namely lapack bindings, that connects lapack calls to boost ublas structures (classes).
These are header-only "libraries", that allow for a clapack interface of the lapack functions. In particular, no need is there, to use a clapack library (i.e. .lib).
I was thinking therefore, to include numeric bindings in my code and link everything with mkl.
I was wondering, therefore, if the c interface of mkl's lapack and the one from clapack, are identical
(or, compatible in case some type-promotions are to be allowed).
Thank you in advance for your help,

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Petros,Intel MKL supports LAPACKE that is C LAPACK extention interface. As far as I know, this interfaces is aligned w/ NETLIB version of LAPACKE.BTW, it was recently announced that Eigen C++ package now supports MKL backend. So, you can consider this as an alternative library for highly abstracted C++ computations.,Konstantin

Hi Konsantin,
The problem w/ Eigen is that it does not allow for using your own allocator with the matrix containers, forbidding me from using a thread-scallable allocator.
However, as far as I understand CLAPACK is a LAPACK "passed through f2c". I guess my question is if the mkl interface is the one that would be obtained by doing exactly this and if this is guaranteed to be so.
Thank you for yor help,

Hi Petros,

The CLAPACK has exactly the same interface like the Fortran LAPACK, where all parameters are passed by reference. And this is exactly the interface MKL provides for all variants of names bindings like dgetrf DGETRF dgetrf_ DGETRF. Just take care of integers size if you are on 64bit architecture: use lp64 for 4byte integers and ilp64 for 8byte integers.

And just in case MKL also provides additional interfaces. One of these is LAPACKE. which supposed to be more in C style: withnon vector input parameters passed by value and possibility to not worry about workspaces, plus support of column major storage. This is whatKonstantin talked about.


Hi Alexander,
Thank you very much for your response.

Leave a Comment

Please sign in to add a comment. Not a member? Join today