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>
/{
ia32|
intel64|{ilp64|lp64}
}]
[-lmkl_blas{
95|
95_ilp64|95_lp64}]
[-lmkl_lapack{95|
95_ilp64|95_lp64}][
<cluster components>
]
-l
mkl_{
intel|
intel_ilp64|intel_lp64|intel_sp2dp|
gf|
gf_ilp64|gf_lp64}
-l
mkl_{intel_thread|
gnu_thread|pgi_thread|
tbb_thread|
sequential}
-l
mkl_core
[-liomp5] [-lpthread] [-lm] [-ldl]
[-ltbb -lstdc++]
In the case of static linking,
enclose the cluster components, interface, threading, and computational libraries in grouping symbols (for example,
-Wl,--start-group $MKLPATH/libmkl_cdft_core.a $MKLPATH/libmkl_blacs_intelmpi_ilp64.a $MKLPATH/libmkl_intel_ilp64.a $MKLPATH/libmkl_intel_thread.a $MKLPATH/libmkl_core.a -Wl,--end-group)
.
The order of listing libraries on the link line is essential
, except for the libraries enclosed in the grouping symbols above
.