Intel MKL on Mac

Intel Math Kernel Library (Intel MKL) is …

a library of optimized math routines for science, engineering, and financial applications. 

Wikipedia (

Intel MKL include BLAS, LAPACK, FFT, and so on. And, it’s free.

I installed intel MKL on Mac and this is the log.

Download intel MKL

Visit intel MKL web site. And, “Choose and Download”.

Choose “macOS”.

Choose “Register & Download”.

Fill out the fields and submit.

Now, you can download intel MKL.

Install MKL

Open the download file and install it.

Setting Environment Variables

In your .bashrc or .bash_profile, add the following. You may modify the path to “”.

source /opt/intel/mkl/bin/ intel64


Write the following code and save as “blas_mkl.cpp”.

Compile and Run.

> g++ -DMKL_ILP64 -m64 -I${MKLROOT}/include  ${MKLROOT}/lib/libmkl_intel_ilp64.a ${MKLROOT}/lib/libmkl_intel_thread.a ${MKLROOT}/lib/libmkl_core.a -liomp5 -lpthread -lm -ldl -o blas_mkl blas_mkl.cpp
> ./blas_mkl

You can find the link line using Intel® Math Kernel Library Link Line Advisor.



Leave a Comment

Your email address will not be published. Required fields are marked *