Skip to main content »

Trinity College Dublin

Linking against MKL

Versions of MKL available

On the main clusters (lonsdale, parsons, kelvin), the following versions of the Intel Math Kernel Library (MKL) are available:

  • MKL 11 (stand-alone module mkl/64/11.0.074)
  • MKL 12 aka Composer 2011 (loaded as part of the Intel 12 compiler: intel/12.1/composer_xe_2011_sp1.9.293)
  • MKL 14 aka Composer 2013 (loaded as part of the Intel 14 compiler: intel/14.0/composer_xe_2013_sp1.2.144)

Note that loading the module will give you an environment variable MKLROOT which you can use in your Makefile.

Linking against MKL

As there are a number of compiler and linker options available for MKL, and they depend on the version number, we recommend in the first instance to use the Intel Math Kernel Library Link Line Advisor page:

That page will give you the recommended set of options, depending on the OS, compiler version, options like BLAS or LAPACK etc.

Sample use

The following assumes a number of options: Linux OS, 64-bit arch, non-threaded, BLAS and LAPACK required.

Compiler options:

-I$(MKLROOT)/include/intel64/lp64 -mkl=sequential

Linker options:

 -L$(MKLROOT)/lib/intel64 -lmkl_blas95_lp64 -lmkl_lapack95_lp64 -lpthread -lm

Last updated 27 May 2014Contact Research IT.