Main navigation

How to use the Intel-MKL Libraries

Installed location: /u/local/compilers/intel/current/current/mkl

Intel-MKL includes both BLAS and LAPACK routines. See how Intel-MKL compares with competing libraries:

 

How to run Intel-MKL from a FORTRAN program

To compile and link a single threaded BLAS or LAPACK routine with the Intel-MKL library enter:

ifort pgm.f(90) -o pgm-sequential \
$MKLROOT/lib/em64t/libmkl_solver_lp64_sequential.a \
-Wl,--start-group \
$MKLROOT/lib/em64t/libmkl_intel_lp64.a \
$MKLROOT/lib/em64t/libmkl_sequential.a \
$MKLROOT/lib/em64t/libmkl_core.a \
-Wl,--end-group \
-lpthread

To compile and link a multiple threaded BLAS or LAPACK routine with the Intel-MKL library enter:

ifort pgm.f(90) -o pgm-omp \
$MKLROOT/lib/em64t/libmkl_solver_lp64.a \
-Wl,--start-group \
$MKLROOT/lib/em64t/libmkl_intel_lp64.a \
$MKLROOT/lib/em64t/libmkl_intel_thread.a \
$MKLROOT/lib/em64t/libmkl_core.a \
-Wl,--end-group \
-openmp \
-lpthread

  • Replace pgm.f(90) with the name of the file containing your source code
  • Replace pgm with the name of the executable to be created
  • Set MKLROOT /u/local/compilers/intel/current/current/mkl

Note: The number of threads will be equal to the number of processors present on the node where the compilation and linking was performed.

For other Intel-MKL routines, select the appropriate libraries from the $MKLROOT/lib/em64t directory.

How to run Intel-MKL from a C program

For C replace ifort with icc. For C++ replace ifort with icpc. Note that for C++, you might additionally have to declare any functions you call as being “extern” as in the following example for sgesv:

extern "C" void sgesv(int *, int *, float *, int *, int *, float *, int *, int * );

Code the function name and the argument list for the function you are calling.

Documentation

See the documentation on the Hoffman2 Cluster at /u/local/compilers/intel/current/current/Documentation/en_US/mkl/

Report Typos and Errors
UCLA OIT

© 2016 UC REGENTS TERMS OF USE & PRIVACY POLICY