The Intel® Compiler option “-mkl”, “Qmkl” options provide users a quick and efficient way to link Intel® Math Kernel Library (Intel® MKL) in an application. With the option, users are free from complex link command, and just need to add simple options to link Intel MKL.
It is a compiler option, tells the compiler to link to certain parts of Intel MKL.
Linux* and OS X*:
[lib]: Indicates which Intel MKL library files should be linked. Possible values are:
Tells the compiler to link using the threaded libraries in Intel MKL. This is the default if the option is specified with no lib.
Tells the compiler to link using the sequential libraries in the Intel MKL.
Tells the compiler to link using the cluster-specific libraries and the sequential libraries in the Intel MKL. Cluster-specific libraries are not available for OS X*.
OFF The compiler does not link to the Intel MKL.
The below example are using Intel Fortran Compiler for Linux*, 64bit as sample. You may find the other equivalents for Windows* and OS X* by Intel® Math Kernel Library Link Line Advisor
Command line example
-mkl (same as -mkl:parallel)
$ ifort -o test test.f90 -mkl [-static-intel] if static linking.
$ifort -o test test.f90 -mkl:sequential [-static-intel] if static linking.
$ifort -o test test.f90 -mkl:cluster [-static-intel] if static linking
Intel MKL package also contains IDE integration with Microsoft Visual Studio*, which is an easy to add Intel MKL into the applications. Check the article here to learn more information:
Note: If you are using 64bit integer in 64bit application, the quick compiler option or one button haven't covered it yet. Please add the library manually according to Intel® Math Kernel Library Link Line Advisor
For more combination, please also refer to Intel® Math Kernel Library Link Line Advisor