Skip to content

Better safeguard on unloadable MKL#793

Merged
ChrisRackauckas merged 2 commits intomainfrom
mkl_guard
Oct 3, 2025
Merged

Better safeguard on unloadable MKL#793
ChrisRackauckas merged 2 commits intomainfrom
mkl_guard

Conversation

@ChrisRackauckas
Copy link
Copy Markdown
Member

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.

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

@static if usemkl
using MKL_jll: libmkl_rt
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
using MKL_jll: libmkl_rt
using MKL_jll: libmkl_rt

@static if usemkl
using MKL_jll: libmkl_rt
else
global libmkl_rt
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
global libmkl_rt
global libmkl_rt

@ChrisRackauckas ChrisRackauckas merged commit 7ced75a into main Oct 3, 2025
131 of 138 checks passed
@ChrisRackauckas ChrisRackauckas deleted the mkl_guard branch October 3, 2025 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant