How to create a MKL "Dummy" Library

Background:
In order to provide maximum support for numerous combination of programming language, interface, compiler type, threading model, we re-architected Intel® MKL since MKL 10.0. This new Intel® MKL architecture provides 4 layered libraries so that users can choose linking combinations according to the wanted compiler, interface and threading runtimes. See Intel® Math Kernel Library Link Line Advisor .

Some users who used to previous MKL version may be confused by the change.
For example, in earlier MKL, you may have the link line
-lmkl_lapack -lmkl -lguide -lpthread

In new MKL, the new layered link line are like
-lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread (intel compiler on lp64 machine)

In order to support backward compatibility, during the time from MKL 10 to MKL 10.2,  we also introduce dummy libraries as temporary solution to help customers move to the layered linking model. The names of dummy libraries are same as the library in earlier version, but they do not contain any functionality, but only dependencies on a set of layered libraries.

For example, the link line may still work in MKL v. 10.1.3
-lmkl_lapack -lmkl -lguide -lpthread 

But please notes here the libmkl_lapack.so,  libmkl.so are dummy library.  They are actually equal to 
-lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core

Dummy library removed and recommended solution:
As the claim in Compatibility libraries (also known as dummy libraries) no more available,  since MKL 10.2, we remove the dummy libraries completely. You are strongly encouraged to link Intel MKL library with layered mode.  

Please refer to Intel® Math Kernel Library Link Line Advisor 

or the map table in For easily migrating from Intel® MKL 9.x to 10.x

For some users who may still want to use one library instead of the "complex" combination of layered libraries, you may create the "dummy" library manually.

Intel® MKL for Linux

For example, you had one library libmkl.so from earlier version which worked and you hope keep use the name in your link line or makefile, you can create a "dummy" library manually,

For example, you are using intel compiler, threading mode, lp64 interface, create the dummy library by command

$ vi libmkl.so

add the below text in the fake file

GROUP (-lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core)

Keep it into the MKL library directory.

If you had used static library -lmkl_em64t,    

   $ vi libmkl_em64.a

Add the text

GROUP (libmkl_intel_lp64.a libmkl_intel_thread.a libmkl_core.a)

Keep it into the mkl library directory.

Intel® MKL for windows

In case of Windows you may create c file with the following code:

// dynamic library link

#pragma comment(lib, "mkl_intel_c_dll")
#pragma comment(lib, "mkl_intel_thread_dll")
#pragma comment(lib, "mkl_core_dll")
#pragma comment(lib, "libiomp5md")

 // static library link
//#pragma comment(lib, "mkl_intel_c")
//#pragma comment(lib, "mkl_intel_thread")
//#pragma comment(lib, "mkl_core")
//#pragma comment(lib, "libiomp5md")

void dummy_func_somethingrandom_1234217846()

{ return; }

Compiling this code with any compiler and making lib out of it:

>cl -c mkl_ia32.c

>lib mkl_ia32.obj

The fake function is essential, since in some cases Microsoft Visual Stuio linker can report an error while linking library without any functions in it.

TroubleShooting regarding dummy library: 

  1. Problem with Linking Applications to Intel MKL 10.0 for Linux* Dummy Shared Librares
  2. Errors linking Intel® compilers with Intel® MKL 10.x
  3. "MKL FATAL ERROR: Cannot load neither xxxx" with Intel MKL 10.x
  4. If you are link mkl library pure layaered library by configure as below

./configure --mkl_lib='/opt/intel/mkl/10.2.x.0xx/lib/em64t/libmkl_intel_lp64.a
/opt/intel/mkl/10.2.x.0xx/lib/em64t/libmkl_sequential.a
/opt/intel/mkl/10.2.x.0xx/lib/em64t/libmkl_core.a'

Please note the mark '  ' are required.

For more complete information about compiler optimizations, see our Optimization Notice.