How to install Intel MKL on windows - isaar/MSolve GitHub Wiki

  1. Download Intel MKL from Intel's website (free of charge).

    1. Go to https://software.seek.intel.com/performance-libraries
    2. Fill out and submit the form.
    3. You will receive an email with further instructions to download the Intel Performance Libraries.
  2. Install MKL on your machine.

  3. Locate the directories where the dlls are installed.

    1. There are usually 3 directories: mkl\ (MKL and other dlls), compiler\ (openMP dlls) and tbb\ (Thread Building Blocks dlls).
    2. For example, on my machine and as of the time this is written, the newest ones are located in C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.2.185\windows\redist\intel64_win.
  4. From here on, you have the following options:

    1. Manually copy all dlls from these 3 directories to the same directory as your executables.

      • For example, to debug the tests in LinearAlgebra.Tests project, I would have to copy all these dlls to <path_to_msolve_repository>\MSolve\ISAAR.MSolve.LinearAlgebra.Tests\bin\Debug\netcoreapp2.0. The executable that will use the dlls is ISAAR.MSolve.LinearAlgebra.Tests.dll (well it is not exactly an executable, but close enough).
      • This has to be repeated for each Console Application project that uses MKL.
      • This approach will need an additional ~500 MB of disc space for each Console Application project that uses MKL.
    2. Add the paths of these directories to your PATH environmental variable.

      • Search how to open Advanced system settings on Google. For me (win10 64bit, english), I need to open Control Panel\All Control Panel Items\System and choose Advanced system settings from the left column.
      • In the new System Properties window, go to tab Advanced and click on Environmental Variables.
      • In the new Environmental Variables window, there are 2 PATH (or "Path") variables, 1 for the current user and 1 for the whole system. Choose one and click on Edit.
      • In the new Edit environmental variable window, for each of the 3 MKL directories, click on New and copy paste its path.
      • Continuing the previous example, the paths that need to be pasted are:
        1. C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.2.185\windows\redist\intel64_win\mkl
        2. C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.2.185\windows\redist\intel64_win\compiler
        3. C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.2.185\windows\redist\intel64_win\tbb\vc_mt
      • In previous Windows OS, the Environmental Variables window is not as neat. You must write the paths you want at the end of the long PATH string. To separate them use the ; symbol.
      • Confirm your changes by clicking OK to exit all these windows.
      • Restart Visual Studio.
      • This approach does not require any extra disc space. The PATH variable is available to all MSolve projects and other programs you might write or download. However it will cause cluttering of the PATH variable and maybe conflicts if you add the dll directories of various versions of Intel MKL (e.g. for x86 and x64 builds).