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

LAPACK95 Interface to MKL Lapack routines in MKL 8.0

John_L_4
Beginner
314 Views
I'm confused about the LAPACK95 interface library supplied with MKL 8.0 when used in Fortran applications.
What good is it to link in mkl_lapack95.lib with my program?
In Fortran 90/95, if I want to use the LAPACK95 interface, then I need to have a USE statement.A USE statementrequires the existence of a MOD file, which you can only get by compiling a file, in this case the mkl_lapack.f90 file (found in the MKL include directory). That means I (effectively) need to add mkl_lapack.f90 to my project.
The MKL documentation makes no mention of this fact as far as I can tell. The Getting Started file implies that all you need is a command like:
ifort myprog.f mkl_lapack95.lib mkl_c.lib libguide.lib
in order to use the LAPACK95 interface, which is not true. Where is the MOD file in the above command line?
Where is the documentation explaining all of the above?
John
0 Kudos
2 Replies
TimP
Honored Contributor III
314 Views
It's good practice to incorporate use mkl_lapack, but it's not necessary, assuming you can get the calling sequence right. If the documentation uses the word interface in a way which conflicts with the terminology specific to fortran, I can see that it could create confusion. You have a good point; the documentation should suggest the USE syntax in a way consistent with the documentation of the run-time libraries in the Fortran documentation.
0 Kudos
John_L_4
Beginner
314 Views
I believe it is necessary to have a "use mkl95_lapack", at least in Fortran. If all I do inside Visual Studio is add mkl_lapack95.lib to my Additional Dependencies list of libraries and try to link, I get unresolved externals (the paths to MKL are set properly).
For example, if my code has:
call sysv(a_matrix, b_matrix)
and I don't "use mkl95_lapack" in that source file, I get an unresolved external at link time, regardless of whether I link in mkl_lapack95.lib.

The reason is simple: mkl_lapack.f90 produces a Fortran 90/95 module. Nothing in that module is available except through a USE statement. The mkl_lapack95.lib file might contain the object code compiled from the mkl_lapack.f90 source, but it's useless without the MOD file as far as I know. I stand to be corrected if that's not the case.
0 Kudos
Reply