Using MKL doesn't work

I installed MKL via add MKL and when I checked if it works, it says

julia> using LinearAlgebra

julia> BLAS.get_config()
└ [ILP64]

julia> using MKL

julia> BLAS.get_config()
└ [ILP64]

I searched around and didn’t find a similar question. Do anyone have any idea?

Some intermediate output when installing:

julia> using MKL
 │ Package MKL not found, but a package named MKL is available from a registry. 
 │ Install package?
 │   (v1.9) pkg> add MKL 
 └ (y/n/o) [y]: y
   Resolving package versions...
    Updating `/u/subspace_s4/huan1754/.julia/environments/v1.9/Project.toml`
⌃ [33e6dc65] + MKL v0.3.0
    Updating `/u/subspace_s4/huan1754/.julia/environments/v1.9/Manifest.toml`
⌃ [33e6dc65] + MKL v0.3.0
⌅ [9b87118b] + PackageCompiler v1.7.7
⌅ [05181044] + RelocatableFolders v0.1.3
  [6c6a2e73] + Scratch v1.2.1
        Info Packages marked with ⌃ and ⌅ have new versions available, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m`
Precompiling project...
  3 dependencies successfully precompiled in 29 seconds. 137 already precompiled.
  1 dependency had warnings during precompilation:
┌ MKL [33e6dc65-8f57-5167-99aa-e5a354878fb2]
│   Downloading artifact: MKL

Did you try also using MKL?

Hi, thanks for the quick reply.

Where should I put it? In the code snippet above, I put it right after using LinearAlgebra but it does not work.

That’s a very old version of MKL.jl (the current one is 0.6.2). I’d first try to figure out why it can’t be updated.

Otherwise, I’d run ] build MKL and then try again.

Ah thanks. Now I see the problem, I omitted one error message because it disappeared when I tried ] add MKL again. When ] build MKL, it was accessing julia/base/sysimg.jl which I do not have permission. Is there a way to work around this?

 Building MKL → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/e01175ff53c062c52b6cbe441a4382e132f7c82e/build.log`
ERROR: Error building `MKL`: 
[ Info: Splicing in code to load MKL in /u/subspace_s4/software/julia-1.9.0/bin/../share/julia/base/sysimg.jl
ERROR: LoadError: SystemError: opening file "/u/subspace_s4/software/julia-1.9.0/bin/../share/julia/base/sysimg.jl": Permission denied
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
    @ Base ./error.jl:176
  [2] #systemerror#82
    @ ./error.jl:175 [inlined]
  [3] systemerror
    @ ./error.jl:175 [inlined]
  [4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Bool, append::Nothing)
    @ Base ./iostream.jl:293
  [5] open
    @ ./iostream.jl:275 [inlined]
  [6] open(fname::String, mode::String; lock::Bool)
    @ Base ./iostream.jl:356
  [7] open(fname::String, mode::String)
    @ Base ./iostream.jl:355
  [8] open(::Base.var"#414#415"{String, Tuple{}}, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:393
  [9] open
    @ ./io.jl:392 [inlined]
 [10] write
    @ ./io.jl:459 [inlined]
 [11] insert_MKL_load(base_dir::String)
    @ Main ~/.julia/packages/MKL/1aXoN/src/install.jl:69
 [12] change_blas_library(libblas::String)
    @ Main ~/.julia/packages/MKL/1aXoN/src/install.jl:116
 [13] enable_mkl_startup()
    @ Main ~/.julia/packages/MKL/1aXoN/src/install.jl:103
 [14] top-level scope
    @ ~/.julia/packages/MKL/1aXoN/deps/build.jl:9
 [15] include(fname::String)
    @ Base.MainInclude ./client.jl:478
 [16] top-level scope
    @ none:5
in expression starting at /homes/huan1754/.julia/packages/MKL/1aXoN/deps/build.jl:9

Can you try a new version of MKL first?
New MKL + recent julia versions shouldn’t need this.

1 Like