Linking on Intel(R) 64 Architecture Systems
The following examples illustrate linking that uses Intel(R) compilers.
Most examples use the
.f
Fortran source file. C/C++ users should instead specify a
.cpp
(C++) or
.c
(C) file and replace
ifort
with
icl
:- Static linking ofmyprog.fandOpenMP* threadedsupporting the LP64 interface:Intel® oneAPI Math Kernel Libraryifort myprog.f mkl_intel_lp64.libmkl_intel_thread.libmkl_core.liblibiomp5md.lib
- Dynamic linking ofmyprog.fandOpenMP* threadedsupporting the LP64 interface:Intel® oneAPI Math Kernel Libraryifort myprog.f mkl_intel_lp64_dll.libmkl_intel_thread_dll.libmkl_core_dll.liblibiomp5md.lib
- Static linking ofmyprog.fand sequential version ofsupporting the LP64 interface:Intel® oneAPI Math Kernel Libraryifort myprog.f mkl_intel_lp64.libmkl_sequential.libmkl_core.lib
- Dynamic linking ofmyprog.fand sequential version ofsupporting the LP64 interface:Intel® oneAPI Math Kernel Libraryifort myprog.f mkl_intel_lp64_dll.libmkl_sequential_dll.libmkl_core_dll.lib
- Static linking ofmyprog.fandOpenMP* threadedsupporting the ILP64 interface:Intel® oneAPI Math Kernel Libraryifort myprog.f mkl_intel_ilp64.libmkl_intel_thread.libmkl_core.liblibiomp5md.lib
- Dynamic linking ofmyprog.fandOpenMP* threadedsupporting the ILP64 interface:Intel® oneAPI Math Kernel Libraryifort myprog.fmkl_intel_ilp64_dll.libmkl_intel_thread_dll.libmkl_core_dll.liblibiomp5md.lib
- Dynamic linking of user codemyprog.fandOpenMP* threadedor sequentialIntel® oneAPI Math Kernel Librarysupporting the LP64 or ILP64 interface(Call appropriate functions or set environment variables to choose threaded or sequential mode and to set the interface):ifort myprog.f mkl_rt.lib
- Static linking ofmyprog.f, Fortran BLAS and 95 LAPACK interfaces, andOpenMP* threadedsupporting the LP64 interface:Intel® oneAPI Math Kernel Libraryifort myprog.f mkl_lapack95_lp64.libmkl_intel_lp64.libmkl_intel_thread.libmkl_core.liblibiomp5md.lib
- Static linking ofmyprog.candthreaded with Intel® Threading Building Blocks (Intel® TBB), provided that theIntel® oneAPI Math Kernel LibraryLIBenvironment variablecontains the path to Intel TBB library:icl myprog.c /link /libpath:%MKLPATH% -I%MKLINCLUDE% mkl_intel_lp64.lib mkl_tbb_thread.lib mkl_core.lib tbb12.lib /MD
- Dynamic linking ofmyprog.candthreaded with Intel® TBB, provided that theIntel® oneAPI Math Kernel LibraryLIBenvironment variable contains the path to Intel® TBB library:icl myprog.c /link /libpath:%MKLPATH% -I%MKLINCLUDE% mkl_intel_lp64_dll.lib mkl_tbb_thread_dll.lib mkl_core_dll.lib tbb12.lib /MD