Skip to content

Commit e821d32

Browse files
staticfloatViralBShah
authored andcommitted
dsptrf bug fixed in macOS v13.4+
Tell the user what version they're running if it fails
1 parent 00b2fae commit e821d32

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/AppleAccelerate.jl

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ end
3232
Load Accelerate, replacing the current LBT forwarding tables if `clear` is `true`.
3333
Attempts to load the ILP64 symbols if `load_ilp64` is `true`, and errors out if unable.
3434
"""
35-
function load_accelerate(;clear::Bool = true, verbose::Bool = false, load_ilp64::Bool = true)
35+
function load_accelerate(;clear::Bool = true, verbose::Bool = false, load_ilp64::Bool = true, use_external_lapack::Bool = true)
3636
# Silently exit on non-Accelerate-capable platforms
3737
@static if !Sys.isapple()
3838
return
@@ -44,7 +44,7 @@ function load_accelerate(;clear::Bool = true, verbose::Bool = false, load_ilp64:
4444

4545
# Check to see if we can load ILP64 symbols
4646
if load_ilp64 && dlsym_e(libacc_hdl, "dgemm\$NEWLAPACK\$ILP64") == C_NULL
47-
error("Unable to load ILP64 interface from '$(libacc)'; are you running macOS 13.3+?")
47+
error("Unable to load ILP64 interface from '$(libacc)'; You are running macOS version $(get_macos_version()), you need v13.3+")
4848
end
4949

5050
# First, load :lp64 symbols, optionally clearing the current LBT forwarding tables
@@ -53,11 +53,6 @@ function load_accelerate(;clear::Bool = true, verbose::Bool = false, load_ilp64:
5353
forward_accelerate(:ilp64; new_lapack=true, verbose)
5454
end
5555

56-
# dsptrf has a bug in the current $NEWLAPACK symbols; to work around this, we
57-
# overlay an external LAPACK_jll on top. Eventually, we may read in the
58-
# Info.plist, determine the version, and stop doing this.
59-
use_external_lapack = true
60-
6156
# Next, load an external LAPACK, if requested
6257
if use_external_lapack
6358
if load_ilp64
@@ -90,7 +85,9 @@ function __init__()
9085
# Default to loading the ILP64 interface on macOS 13.3+
9186
ver = get_macos_version()
9287
load_ilp64 = ver !== nothing && ver >= v"13.3"
93-
load_accelerate(; load_ilp64)
88+
# dsptrf has a bug in the initial release of the $NEWLAPACK symbols, so if we're
89+
# on a version older than macOS 13.4, use an external LAPACK:
90+
load_accelerate(; load_ilp64, use_external_lapack = ver < v"13.4")
9491
end
9592

9693
end # module

0 commit comments

Comments
 (0)