Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

C interface for LAPACK routines?

ltkeene
Beginner
580 Views

Hello all, I've downloaded a trial verison of the latest release of MKL but find the documentation very disjointed and confusing. At the moment I simply need to solve a small (3x3) system of linear equations. Is there a C interface for the LAPACK routines (where I assume I find this functionality)? The documentation only talks about Fortran.

Thank you in advance.

0 Kudos
4 Replies
Gennady_F_Intel
Moderator
580 Views

Yes, the documentation only talks only about Fortran, because of there are no special C interface, but you can use Fortran interface from C code.

As an example please look at the Forum question ( http://software.intel.com/en-us/forums/showthread.php?t=61117)where MKL customer call dgesvx rountine from C code.

--Gennady

0 Kudos
TimP
Honored Contributor III
580 Views
Quoting - ltkeene

Hello all, I've downloaded a trial verison of the latest release of MKL but find the documentation very disjointed and confusing. At the moment I simply need to solve a small (3x3) system of linear equations. Is there a C interface for the LAPACK routines (where I assume I find this functionality)? The documentation only talks about Fortran.

Thank you in advance.

You could use the Clapack interface with MKL, if that is your question. MKL would be an inefficient way to work with such a small system anyway. As MKL BLAS is a work-alike implementation of the public netlib BLAS, the public documentation applies.

0 Kudos
Gennady_F_Intel
Moderator
580 Views

As an additional info:

CLapack intefaces you find into mkl_lapack.h, but as I said

MKL documentation contains only Fortran interface description. As an example the function for computes the solution to the system of linear equations with a square matrix A and multiple right-hand sides, and provides error bounds on the solution.

//mkl_lapack.h

//void dgesvx( char *fact, char *trans, MKL_INT *n, MKL_INT *nrhs, double *a, MKL_INT *lda, double *af, MKL_INT *ldaf, MKL_INT *ipiv, char *equed, double *r, double *c, double *b, MKL_INT *ldb, double *x, MKL_INT *ldx, double *rcond, double *ferr, double *berr, double *work, MKL_INT *iwork, MKL_INT *info );

But all parameters of this function you can find into MKL manual for Fortran 77 or F95:

//Fortran 77

//call dgesvx( fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, c, b, ldb, x, ldx, rcond, ferr, berr, work, iwork, info )

Gennady

0 Kudos
Gennady_F_Intel
Moderator
580 Views
Hello. please pay attention on the topic
Todd posted yesterday about C interface for LAPACK routines.
Please send your recomendations to Michael and Creg about that.
--Gennady

0 Kudos
Reply