From 0ef70985aff0ecc77786037c0dccc18ceceb4510 Mon Sep 17 00:00:00 2001 From: Chris Elrod Date: Tue, 30 Jul 2024 13:38:45 +0000 Subject: [PATCH] Import CpuId only on x86_64 or i686 (#521) * CpuId can only be loaded on x86 * Bump patch * ignore CpuId for statle deps --- Project.toml | 2 +- src/LinearSolve.jl | 13 ++++++++----- test/qa.jl | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index 01c20dad..b24e80f7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "LinearSolve" uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" authors = ["SciML"] -version = "2.31.0" +version = "2.31.1" [deps] ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" diff --git a/src/LinearSolve.jl b/src/LinearSolve.jl index f166f6b4..d8490e86 100644 --- a/src/LinearSolve.jl +++ b/src/LinearSolve.jl @@ -41,13 +41,16 @@ import PrecompileTools import Krylov using SciMLBase import Preferences - import CpuId - const CRC = ChainRulesCore -if Preferences.@load_preference("LoadMKL_JLL", !occursin("EPYC", CpuId.cpubrand())) - using MKL_jll - const usemkl = MKL_jll.is_available() +@static if Sys.ARCH === :x86_64 || Sys.ARCH === :i686 + import CpuId + if Preferences.@load_preference("LoadMKL_JLL", !occursin("EPYC", CpuId.cpubrand())) + using MKL_jll + const usemkl = MKL_jll.is_available() + else + const usemkl = false + end else const usemkl = false end diff --git a/test/qa.jl b/test/qa.jl index 9b404506..faa9e701 100644 --- a/test/qa.jl +++ b/test/qa.jl @@ -6,7 +6,7 @@ using LinearSolve, Aqua Aqua.test_piracies(LinearSolve, treat_as_own = [LinearProblem]) Aqua.test_project_extras(LinearSolve) - Aqua.test_stale_deps(LinearSolve, ignore = [:MKL_jll]) + Aqua.test_stale_deps(LinearSolve, ignore = [:MKL_jll, :CpuId]) Aqua.test_unbound_args(LinearSolve) Aqua.test_undefined_exports(LinearSolve) end