From c843f00dc8c34e0e8f73904e055074eb49f90c59 Mon Sep 17 00:00:00 2001 From: Alexis Montoison Date: Sun, 9 Oct 2022 10:57:00 -0400 Subject: [PATCH] Test that we can use Apple Accelerate by default on Mac --- src/HSL.jl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/HSL.jl b/src/HSL.jl index 378d963..dae4dcf 100644 --- a/src/HSL.jl +++ b/src/HSL.jl @@ -17,7 +17,14 @@ function __init__() if VERSION ≥ v"1.7" config = LinearAlgebra.BLAS.lbt_get_config() if !any(lib -> lib.interface == :lp64, config.loaded_libs) - LinearAlgebra.BLAS.lbt_forward(OpenBLAS32_jll.libopenblas_path) + if !Sys.isapple() + LinearAlgebra.BLAS.lbt_forward(OpenBLAS32_jll.libopenblas_path) + else + blas = "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/libBLAS.dylib" + lapack = "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/libLAPACK.dylib" + LinearAlgebra.BLAS.lbt_forward(blas, verbose = true, clear = false) + LinearAlgebra.BLAS.lbt_forward(lapack, verbose = true, clear = false) + end end end if (@isdefined libhsl_ma57) || (@isdefined libhsl_ma97) || (@isdefined libmc21)