How to install Intel MKL

Intel Math Kernel Library (MKL) provides math routines optimized for Intel CPUs. It is available free for personal and community use.

  • Register and download MKL from here. I prefer to choose the full package.
  • For Linux, the downloaded file is a zipped tar file. For example: l_mkl_2019.3.199.tgz. Unzip its contents.
  • Run its installer script:
$ sudo ./

The installer takes you through a console install wizard. By default, it will install to /opt/intel. By default, it will install MKL libraries for C/C++ and Fortran. I typically request not to install the Fortran libraries which reduces the install size by half.

Tried with: Ubuntu 18.04


MATLAB parallel pool error


I ran a MATLAB script that uses a parallel pool of workers. It failed with this error:

The client lost connection to worker 4. This might be due to network problems, or the interactive communicating job might have errored

The corresponding matlab_crash_dump file had this stack trace starting from

[  0] 0x00007f995128a1c5        /usr/local/MATLAB/R2014a/bin/glnxa64/ mkl_blas_avx_sgemm_mscale+00001253
[  1] 0x00007f995115ba1c        /usr/local/MATLAB/R2014a/bin/glnxa64/ mkl_blas_avx_xsgemm+00000204
[  2] 0x00007f99505a1a5c        /usr/local/MATLAB/R2014a/bin/glnxa64/ mkl_blas_xsgemm+00000316
[  3] 0x00007f9950529720        /usr/local/MATLAB/R2014a/bin/glnxa64/
[  4] 0x00007f9950525d5a        /usr/local/MATLAB/R2014a/bin/glnxa64/ mkl_blas_sgemm+00001386
[  5] 0x00007f99503b8ba5        /usr/local/MATLAB/R2014a/bin/glnxa64/ sgemm+00000377
[  6] 0x00007f991b803154    /opt/intel/mkl/lib/intel64/ cblas_sgemm+00000372


To run a parallel pool of workers, we need to use the provided by Intel. I added the path of this library path, which was /opt/intel/mkl/lib/intel64 in my case, to my LD_LIBRARY_PATH. I also set the BLAS_VERSION environment variable to

After this I checked if everything worked fine by going to Parallel -> Manage cluster profiles -> Local -> Validation profiles -> Validate. All the parallel test tasks were validated successfully. My script too worked fine after this.

Tried with: MATLAB R2014a and Ubuntu 14.04