Skip to content

Commit f1a01cc

Browse files
Better safeguard on unloadable MKL
Tries to safeguard julia-actions/setup-julia#300 JuliaLang/julia#55878 where the user has requested an incorrect architecture and thus we may believe we can load MKL until we check `MKL_jll.is_available() == false`. The reason is because we're being lied to about `@static if Sys.ARCH === :x86_64 || Sys.ARCH === :i686` which then makes it take this branch and then MKL does not exist. We could instead check `isapple` another type of workaround here and 99% of users would be perfectly fine, but if this is safe this is slightly better for the 1 remaining Intel Apple user that exists in the wild somewhere.
1 parent f46bfc1 commit f1a01cc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/LinearSolve.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,14 @@ const CRC = ChainRulesCore
5252
# MKL_jll < 2022.2 doesn't support the mixed LP64 and ILP64 interfaces that we make use of in LinearSolve
5353
# In particular, the `_64` APIs do not exist
5454
# https://www.intel.com/content/www/us/en/developer/articles/release-notes/onemkl-release-notes-2022.html
55-
using MKL_jll: MKL_jll, libmkl_rt
55+
using MKL_jll: MKL_jll
5656
const usemkl = MKL_jll.is_available() && pkgversion(MKL_jll) >= v"2022.2"
57+
58+
@static if usemkl
59+
using MKL_jll: libmkl_rt
60+
else
61+
global libmkl_rt
62+
end
5763
else
5864
global libmkl_rt
5965
const usemkl = false

0 commit comments

Comments
 (0)