Developer Guide
Developer Guide for Intel® oneAPI Math Kernel Library macOS*
A newer version of this document is available. Customers should click here to go to the newest version.
Listing Libraries on a Link Line
To link with Intel® oneAPI Math Kernel Library, specify paths and libraries on the link line as shown below.
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}]
-lmkl_{intel|intel_ilp64|intel_lp64}
-lmkl_{intel_thread|tbb_thread|sequential}
-lmkl_core
[-liomp5] [-lpthread] [-lm] [-ldl] [-ltbb -lstdc++]
In the case of dynamic linking, the -rpathlinker option adds the location of Intel® oneAPI Math Kernel Library dynamic libraries to application run-path search paths for compliance with system integrity protection, introduced in OS X* 10.11. For more details, see:
- System Integrity Protection Guide (https://developer.apple.com/library/tvos/documentation/Security/Conceptual/System_Integrity_Protection_Guide/System_Integrity_Protection_Guide.pdf)
- Run-Path Dependent Libraries (https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/RunpathDependentLibraries.html)
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.