The problem of calling “MKL pardiso” in Julia

Background:

  • I have a large sparse matrix written by Julia that requires solutions, and I want to use MKL pardiso to improve speed.
  • I’ve found the pardiso.jl page and read README.

What I’ve done:

  • Install Pardiso in Julia:
using Pkg
Pkg.add("Pardiso")

  • Download MKL:

As I understand it, MKL pardiso is included in the MKL library.So I download from web.

After registering, I received an email with a download link. On the download page, I chose Intel math kernel library for windows.

Then I got the documents:w_mkl_2019.4.245.exe,I installed it completely on the computer.


  • Build Pardiso.jl:
Pkg. build ("Pardiso")

julia> using Pardiso
┌ Warning: No Pardiso library found when Pkg.build("Pardiso") ran, this package will not currently be usable. See the installation instructions and rerun Pkg.build("Pardiso").
└ @ Pardiso C:\Users\huoze\.julia\packages\Pardiso\66TFF\src\Pardiso.jl:105

Question:

As mentioned above, I made a mistake in Julia. I think my MKL did not configure environment variables correctly, but I don’t know how to do this step.

julia> versioninfo()
Julia Version 1.1.1
Commit 55e36cc308 (2019-05-16 04:10 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, ivybridge)

(Or do I have other mistakes that I haven’t found?)

Please tell me how to do about this?

You need to set the environment variables before calling built, MKLROOT.

See “Implementation stage #1: Environment Variables” in this link: Intel Developer Zone

Thank you very much.:smile: I have configured MKLROOT in the system according to the link, but when I tried the following code, Julia showed the following error:

using Pardiso
using SparseArrays

ps = MKLPardisoSolver()

A = sparse(rand(10, 10))
B = rand(10, 2)
X = zeros(10, 2)
solve!(ps, X, A, B)
Julia has exited. Press Enter to start a new session.
INTEL MKL ERROR: 操作系统无法运行 %1。 mkl_intel_thread.dll.
Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll.

This is due to the problem of the mkl_intel_thread.dll file. What is the reason :thinking:?

julia> using Pardiso

julia> Pardiso.show_build_log()
Pardiso library
===============
Looking for libraries with name: libpardiso600-WIN-X86-64.dll, libpardiso500-WIN-X86-64.dll.
INFO: use the `JULIA_PARDISO` environment variable to set a path to the folder where the Pardiso library is located
Looking in "C:\Users\huoze\.julia\packages\Pardiso\66TFF\deps" for libraries
did not find libpardiso, assuming PARDISO 5/6 is not installed

MKL Pardiso
=============
found MKLROOT environment variable, using it

I also noticed that I found one in the mailbox where Intel sent me the MKL download link.lic file, I did not see in the document about it introduction, what is the role of this file?

I’ve been having trouble configuring MKL for several days.:sob:I even tried to install MKL.jl directly,But there are also the following mistakes:

Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll.

When installing MKL.jl, I have added the system variable path of mkl_intel_thread.dll,Worse, my Julia can’t start now…:broken_heart:

Googling mkl_intel_thread cannot load gives many results of people having the same problem. It is likely your MKL installation is faulty somehow.

You can reinstall julia easily.

hello, I Have this throuble, Could you help me?

Info: Precompiling Pardiso [46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2] └
@ Base loading.jl:1317 ERROR: LoadError: InitError: could not load library
“C:\Users\Compumar.julia\artifacts\6de083f4770c1a6b49d179e2aa0f30c4bffde4a4\bin\mkl_core.dll” Acceso denegado. Stacktrace:

Thank you
Ariel

I had the same problem on my windows 10 system, according to the prompt, I changed the file permissions and no more problems:

  1. Open in the folder C:\Users\Compumar.julia\artifacts\6de083f4770c1a6b49d179e2aa0f30c4bffde4a4\bin\

  2. right click mkl_core.dll, change file permissions:

  3. After this, you may have several more files to perform the same operation, please follow julia’s error prompt.

Hope it can help you. :smile: