Developer Guide for Intel® oneAPI Math Kernel Library for Windows*
Linking on Intel ® 64 Architecture Systems
The following examples illustrate linking that uses Intel ® compilers.
Most examples use the .f Fortran source file. C/C++ users should instead specify a .cpp (C++) or .c (C) file and replace ifx with icx.
In these examples,
MKLPATH=$MKLROOT/lib/intel64_lin
MKLINCLUDE=$MKLROOT/include
Static linking of myprog.f and OpenMP* threaded Intel® oneAPI Math Kernel Library (oneMKL) supporting the LP64 interface:
ifx myprog.f mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.libDynamic linking of myprog.f and OpenMP* threaded Intel® oneAPI Math Kernel Library (oneMKL) supporting the LP64 interface:
ifx myprog.f -L$MKLPATH -I$MKLINCLUDE -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lmifx myprog.f mkl_intel_lp64_dll.lib mkl_intel_thread_dll.lib mkl_core_dll.lib libiomp5md.libStatic linking of myprog.f and sequential version of Intel® oneAPI Math Kernel Library (oneMKL) supporting the LP64 interface:
ifx myprog.f mkl_intel_lp64.lib mkl_sequential.lib mkl_core.libDynamic linking of myprog.f and sequential version of Intel® oneAPI Math Kernel Library (oneMKL) supporting the LP64 interface:
ifx myprog.f mkl_intel_lp64_dll.lib mkl_sequential_dll.lib mkl_core_dll.libStatic linking of myprog.f and OpenMP* threaded Intel® oneAPI Math Kernel Library (oneMKL) supporting the ILP64 interface:
ifx myprog.f mkl_intel_ilp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.libDynamic linking of myprog.f and OpenMP* threaded Intel® oneAPI Math Kernel Library (oneMKL) supporting the ILP64 interface:
ifx myprog.f mkl_intel_ilp64_dll.lib mkl_intel_thread_dll.lib mkl_core_dll.lib libiomp5md.libDynamic linking of user code myprog.f and OpenMP* threaded or sequential Intel® oneAPI Math Kernel Library (oneMKL) (Call appropriate functions or set environment variables to choose threaded or sequential mode and to set the interface):
ifx myprog.f mkl_rt.libStatic linking of myprog.f, Fortran BLAS and 95 LAPACK interfaces, and OpenMP* threaded Intel® oneAPI Math Kernel Library (oneMKL) supporting the LP64 interface:
ifx myprog.f mkl_lapack95_lp64.lib mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.libStatic linking of myprog.c and Intel ® oneAPI Math Kernel Library (oneMKL) threaded with Intel ® Threading Building Blocks (Intel ® TBB), provided that the TBBROOT environment variable is defined:
icx myprog.c /link /libpath:%MKLPATH% -I%MKLINCLUDE% mkl_intel_lp64.lib mkl_tbb_thread.lib mkl_core.lib tbb12.lib /MDDynamic linking of myprog.c and Intel® oneAPI Math Kernel Library (oneMKL) threaded with Intel ® TBB, provided that the LD_LIBRARY_PATH environment variable contains the path to Intel ® TBB library:
icx myprog.c /link /libpath:%MKLPATH% -I%MKLINCLUDE% mkl_intel_lp64_dll.lib mkl_tbb_thread_dll.lib mkl_core_dll.lib tbb12.lib /MD