Julia with Intel® Math Kernel Library for Improved Performance


This guide is intended to help users of Julia language to get better performance by using Intel® Math Kernel Library (Intel® MKL) for their high performance compute intensive applications that rely on mathematical routines.

Download Julia source code

Download Open source Julia as a zip file or use your GitHub* account to download Julia source.


Intel MKL can be obtained from the following options

•  A. Download a FREE evaluation version of the Intel MKL product
•  B. Download the FREE non-commercial* version of the Intel MKL product.

Intel MKL can also be obtained by downloading free evaluation versions or non-commercial versions of the following products.

•  Intel® Parallel Studio XE

If you already have a commercial license of MKL and compilers, we recommend you to use the latest versions.


Set up the Intel MKL envrionment, for Intel64 architecture with 8 bytes integer support (ILP64)

$source /opt/intel/mkl/bin/mklvars.sh intel64 ilp64

and for ia32 architecture

$source /opt/intel/mkl/bin/mklvars.sh ia32

Edit Make.inc file located in julia folder and change USE_MKL = 0  variable to USE_MKL = 1

Also, change the MKLLIB variable to point to the appropriate library, by default it is set to intel64 architecture.

MKLLIB = $(MKLROOT)/lib/intel64

Alternately, you can also pass USE_MKL=1 option to make.

Building Julia with Intel MKL

Once you have set the Intel MKL environment and modified the Make.inc file to use MKL, building Julia with Intel MKL support is straightforward and proceed to building and installing Julia using the following command

$make install

To rebuild a pre-built Julia source installed with Intel MKL support, delete the OpenBLAS, ARPACK, and SuiteSparse dependencies from deps folder of and run

$make cleanall install

We would like to hear your feedback on using julia with MKL support on installation, performance or any suggestions.

For more complete information about compiler optimizations, see our Optimization Notice.



This can be automated by adding MKL.jl in Julia:

follow my steps as I said here:

To Install:

julia>]add https://github.com/JuliaComputing/MKL.jl

After building which takes some time restart, Julia.

If you get the Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll. error, that means the required dlls are not on the path. You need to add the location that it was installed to your path. On windows usually that is C:\Users\%USERNAME%\.julia\packages\MKL\36eeJ\deps\usr\bin . You can add it to your windows path by running the following command in Windows cmd:

setx PATH=%PATH%;C:\Users\%USERNAME%\.julia\packages\MKL\36eeJ\deps\usr\bin

To Check Installation:

Once the install has completed, you’ll have

julia> using LinearAlgebra

julia> BLAS.vendor() :mkl

The company I work for has developed a machine learning developers kit exclusively in and for Julia.  With respect to Intel, is this a relevant tool?  We are currently considering open sourcing it so I am looking for feedback.

Thank you in advance for your help.

Problems building Julia with MKL...#6367

After a successful build of Julia with gfortran 4.8.2 on OS X Mavericks (10.9) with Haswell processor using OpenBLAS 0.3.9rc2 (see #6272), I decided to delete everything and try to see if I could build Julia using MKL. After I deleted everything and installed MKL version (composer_xe_2013_sp1.2.139), I downloaded Julia source again, modified make.user and tried to build it.

The build process made it very far, as you can see from the length of the gist, (https://gist.github.com/esd100/9905847) but failed with the error seen on the github Julia page.

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.