Listing Libraries on a Link Line
To link with , specify paths and libraries on the link line as shown below.
Intel® oneAPI Math Kernel Library
The syntax below is for dynamic linking. For static linking, replace each library name preceded with "
-l
" with the path to the library file. For example, replace
-lmkl_core
with
$MKLPATH/libmkl_core.a
, where
$MKLPATH
is the appropriate user-defined environment variable.
<files to link>
-L
<MKL path>
-I
<MKL include>
[-I
<MKL include>
intel64|{ilp64|lp64}
}]
[-Wl,-rpath,
<MKL path>
][-lmkl_blas{
95|
95_ilp64|95_lp64}]
[-lmkl_lapack{95|
95_ilp64|95_lp64}]-l
mkl_{
intel|
intel_ilp64|intel_lp64}
-l
mkl_{intel_thread|
tbb_thread|
sequential}
-l
mkl_core
[-liomp5] [-lpthread] [-lm] [-ldl]
[-ltbb -lstdc++]
In the case of dynamic linking, the
dynamic libraries to application run-path search paths for compliance with system integrity protection, introduced in OS X* 10.11. For more details, see:
-rpath
linker option adds the location of Intel® oneAPI Math Kernel Library
In the case of static linking,
for all components except BLAS and FFT, repeat interface, threading, and computational libraries two times (for example,
libmkl_intel_ilp64.a libmkl_intel_thread.a libmkl_core.a libmkl_intel_ilp64.a libmkl_intel_thread.a libmkl_core.a
). For the LAPACK component, repeat the threading and computational libraries three times.The order of listing libraries on the link line is essential
.