Tips for Intel MKL 10.x Linking on Linux

Intel MKL 10.x  Linking on Linux

1. Tips

To link with Intel MKL , you can choose pure layered  model or the default model which is  backward compatible on link line.  (except cluster components).

  • For the pure layered model, you need to choose one library from the Interface layer, one library from the Threading layer, the Computational layer library (no choice here), and add run-time libraries.
  • In case of the default model, you need not change the link line (see the Dummy Libraries section  for details).Dummy Library means its default links to some specified libraries. Like Dummy library libmkl.so contains references to following Intel MKL libraries

               libmkl.so  ==>         lib/em64t/libmkl_intel_lp64.so,             
                                                 lib/em64t/libmkl_intel_thread.so, and
                                                 lib/em64t/libmkl_core.so.

  • In case of employing the pure layered model for static linking, the interface layer, threading layer, and computation layer libraries must be enclosed in grouping symbols, for example:

-Wl,–start-group -lmkl_intel_ilp64.a -lmkl_intel_thread.a -lmkl_core.a -Wl,–end-group

  • ILP64 means 64 bit integer and LP means 32 bit integer
  • ILP64 interface is provided for the following two reasons:

         – To support huge data arrays (with more than 2 billion elements)
         – To enable compiling your Fortran code with the -i8 compiler option.

  • The Intel Fortran Compiler supports the -i8 option for changing behavior of the INTEGERtype. By default the standard INTEGER type is 4-byte. The -i8 option makes the compiler treat INTEGER constants,

  • To bind your Fortran code with the ILP64 interface, you must compile your code with the -i8 compiler option. And vice-versa, if your code is compiled with -i8, you can bind it only with the ILP64 interface because the LP64 binary interface requires the INTEGER type to be 4-byte.

  • For the languages of C/C++, Intel MKL provides the MKL_INT type as a counterpart of the INTEGER type for Fortran. MKL_INT is a macro defined as the standard C/C++ type int by default. However, if the MKL_ILP64 macro is defined for the code compilation, MKL_INT is defined as a 64-bit integer type. To define the MKL_ILP64 macro, you may call the compiler with the -DMKL_ILP64 command-line option.

2.  References

This entry was posted in HPC. Bookmark the permalink.

1 Response to Tips for Intel MKL 10.x Linking on Linux

  1. samritmaity says:

    Thanks nisha. It helped a lot. 😀

Leave a comment