# The problem of calling “MKL pardiso” in Julia

**URL:** <https://discourse.julialang.org/t/the-problem-of-calling-mkl-pardiso-in-julia/25830>\
**Category:** Numerics\
**Created:** [June 29, 2019, 4:20am UTC](https://discourse.julialang.org/t/the-problem-of-calling-mkl-pardiso-in-julia/25830 "2019-06-29T04:20:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![FujiwaraTakumiEH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fujiwaratakumieh/32/37975_2.png) [@FujiwaraTakumiEH](https://discourse.julialang.org/u/FujiwaraTakumiEH)\
**Post date:** [June 29, 2019, 4:20am UTC](https://discourse.julialang.org/t/the-problem-of-calling-mkl-pardiso-in-julia/25830/1 "2019-06-29T04:20:07Z")

</div>

## 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](https://github.com/JuliaSparse/Pardiso.jl#mkl-pardiso) page and read README.

## What I’ve done：

- Install Pardiso in Julia:

```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](https://software.seek.intel.com/performance-libraries).

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`:

```julia
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
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?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 29, 2019, 2:50pm UTC](https://discourse.julialang.org/t/the-problem-of-calling-mkl-pardiso-in-julia/25830/2 "2019-06-29T14:50:42Z")

</div>

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

See “Implementation stage #1: Environment Variables” in this link: [Intel Developer Zone](https://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-2017-getting-started)

---

<div class="post-metadata">

**Author:** ![FujiwaraTakumiEH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fujiwaratakumieh/32/37975_2.png) [@FujiwaraTakumiEH](https://discourse.julialang.org/u/FujiwaraTakumiEH)\
**Post date:** [July 1, 2019, 5:17am UTC](https://discourse.julialang.org/t/the-problem-of-calling-mkl-pardiso-in-julia/25830/3 "2019-07-01T05:17:00Z")

</div>

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

```julia
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
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 🤔?

```julia
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?

---

<div class="post-metadata">

**Author:** ![FujiwaraTakumiEH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fujiwaratakumieh/32/37975_2.png) [@FujiwaraTakumiEH](https://discourse.julialang.org/u/FujiwaraTakumiEH)\
**Post date:** [July 1, 2019, 10:45am UTC](https://discourse.julialang.org/t/the-problem-of-calling-mkl-pardiso-in-julia/25830/4 "2019-07-01T10:45:34Z")

</div>

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

```julia
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…💔

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [July 1, 2019, 10:48am UTC](https://discourse.julialang.org/t/the-problem-of-calling-mkl-pardiso-in-julia/25830/5 "2019-07-01T10:48:33Z")

</div>

> [@FujiwaraTakumiEH](#):
>
> load mkl\_intel\_thread

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

> [@FujiwaraTakumiEH](#):
>
> Worse, my Julia can’t start now…

You can reinstall julia easily.

---

<div class="post-metadata">

**Author:** ![gauchoo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gauchoo/32/24180_2.png) [@gauchoo](https://discourse.julialang.org/u/gauchoo)\
**Post date:** [April 19, 2021, 1:56pm UTC](https://discourse.julialang.org/t/the-problem-of-calling-mkl-pardiso-in-julia/25830/6 "2021-04-19T13:56:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![FujiwaraTakumiEH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fujiwaratakumieh/32/37975_2.png) [@FujiwaraTakumiEH](https://discourse.julialang.org/u/FujiwaraTakumiEH)\
**Post date:** [April 21, 2021, 4:19am UTC](https://discourse.julialang.org/t/the-problem-of-calling-mkl-pardiso-in-julia/25830/7 "2021-04-21T04:19:01Z")

</div>

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. 😄
