Skip to content

Commit 7d61d19

Browse files
Conditionally load MKL_jll based on preference
1 parent 1c05968 commit 7d61d19

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/LinearSolve.jl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,22 @@ PrecompileTools.@recompile_invalidations begin
3838

3939
# wrap
4040
import Krylov
41-
4241
using SciMLBase
43-
44-
using MKL_jll
45-
4642
import Preferences
4743
end
4844

49-
if Preferences.@load_preference("TriggerMKLLBT", true)
45+
@static if Preferences.@load_preference("TriggerMKLLBT", true)
46+
using MKL_jll
5047
using MKL
48+
const usemkl = MKL_jll.is_available()
49+
else
50+
const usemkl = false
5151
end
5252

5353
using Reexport
5454
@reexport using SciMLBase
5555
using SciMLBase: _unwrap_val
5656

57-
const usemkl = MKL_jll.is_available()
58-
5957
abstract type SciMLLinearSolveAlgorithm <: SciMLBase.AbstractLinearAlgorithm end
6058
abstract type AbstractFactorization <: SciMLLinearSolveAlgorithm end
6159
abstract type AbstractKrylovSubspaceMethod <: SciMLLinearSolveAlgorithm end

0 commit comments

Comments
 (0)