You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,20 +4,23 @@
4
4
5
5
MKL.jl is a Julia package that allows users to use the Intel MKL library for Julia's underlying BLAS and LAPACK, instead of OpenBLAS, which Julia ships with by default. Julia includes [libblastrampoline](https://github.com/staticfloat/libblastrampoline), which enables picking a BLAS and LAPACK library at runtime. A [JuliaCon 2021 talk](https://www.youtube.com/watch?v=t6hptekOR7s) provides details on this mechanism.
6
6
7
-
This package requires Julia 1.7+
7
+
This package requires Julia 1.7+.
8
8
9
-
## Usage
10
-
11
-
If you want to use `MKL.jl` in your project, make sure it is the first package you load before any other package. It is essential that MKL be loaded before other packages so that it can find the Intel OMP library and avoid [issues resulting out of GNU OMP being loaded first](https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/700).
9
+
## Installation
12
10
13
-
## Installation (Julia 1.7 and newer):
11
+
To install the package execute
14
12
15
-
Adding the package will replace the system BLAS and LAPACK with MKL provided ones at runtime. Note that the MKL package has to be loaded in every new Julia process. Upon quitting and restarting, Julia will start with the default OpenBLAS.
16
13
```julia
17
14
julia>using Pkg; Pkg.add("MKL")
18
15
```
19
16
20
-
## To Check Installation:
17
+
## Usage
18
+
19
+
Loading the package (`using MKL`) will replace the system BLAS and LAPACK with MKL provided ones at runtime. Make sure it is the first package you load before any other package. It is essential that MKL be loaded before other packages so that it can find the Intel OMP library and avoid [issues resulting out of GNU OMP being loaded first](https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/700).
20
+
21
+
Note that the MKL package has to be loaded in every new Julia process. Upon quitting and restarting, Julia will start with the default OpenBLAS.
22
+
23
+
## Check
21
24
22
25
```julia
23
26
julia>using LinearAlgebra
@@ -41,12 +44,10 @@ Note that you can put `using MKL` into your `startup.jl` to make Julia automatic
41
44
42
45
We use ILP64 by default on 64-bit systems, and LP64 on 32-bit systems.
43
46
44
-
## Using a preinstalled Intel MKL
47
+
## Using a system-provided Intel MKL
45
48
46
-
If you already have an Intel MKL installation available (as on most HPC clusters), you can use the the environment variable `JULIA_MKL_PATH` or the [preference](https://github.com/JuliaPackaging/Preferences.jl)`mkl_path` to hint MKL.jl to the `libmkl_rt` library. Specifically, the options are:
49
+
If you want to use a system-provided Intel MKL installation, you can set the [preference](https://github.com/JuliaPackaging/Preferences.jl)`mkl_path` to hint MKL.jl to the corresponding`libmkl_rt` library. Specifically, the options are:
47
50
48
51
*`mkl_jll` (default): Download and install MKL via [MKL_jll.jl](https://github.com/JuliaBinaryWrappers/MKL_jll.jl).
49
-
*`system`: The package will try to automatically locate the libmkl_rt library (i.e. find it on the linker search path).
52
+
*`system`: The package will try to automatically locate the system-provided libmkl_rt library (i.e. find it on the linker search path).
50
53
*`path/to/my/libmkl_rt.<EXT>`: Explicit path to the `libmkl_rt.<EXT>` where `<EXT>` is the shared library extension of the system at hand (e.g. `.so`, `.dll`, `.dylib`)
51
-
52
-
Note that, in contrast to the preference, the environment variable only has an effect when MKL.jl is (re-)precompiled. To force a change of the MKL path after the compilation has happened, use the function `MKL.set_mkl_path`, which takes the options listed above as input. The usecase for the environment variable convenience is for automated installs such as CI systems, where the initial default choice should be set with no human interaction whatsoever.
0 commit comments