Skip to content

Commit f2ae3b4

Browse files
vtjnashKristofferC
andauthored
fix Julia v1.13 support (#124)
Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com>
1 parent 01de2fd commit f2ae3b4

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/Pardiso.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ else
3838
const PARDISO_FUNC = :pardiso
3939
end
4040

41-
const libmkl_rt = Ref{String}("")
41+
libmkl_rt = ""
4242

4343
export PardisoSolver, MKLPardisoSolver
4444
export set_iparm!, set_dparm!, set_matrixtype!, set_solver!, set_phase!, set_msglvl!, set_nprocs!
@@ -145,17 +145,17 @@ panua_is_available() = panua_is_loaded() && panua_is_licensed()
145145

146146

147147
function __init__()
148-
global MKL_LOAD_FAILED
148+
global MKL_LOAD_FAILED, libmkl_rt
149149
if LOCAL_MKL_FOUND
150150
if Sys.iswindows()
151-
libmkl_rt[] = "mkl_rt"
151+
libmkl_rt = "mkl_rt"
152152
elseif Sys.isapple()
153-
libmkl_rt[] = "@rpath/libmkl_rt.dylib"
153+
libmkl_rt = "@rpath/libmkl_rt.dylib"
154154
else
155-
libmkl_rt[] = "libmkl_rt"
155+
libmkl_rt = "libmkl_rt"
156156
end
157157
elseif MKL_jll.is_available()
158-
libmkl_rt[] = MKL_jll.libmkl_rt_path
158+
libmkl_rt = MKL_jll.libmkl_rt
159159
end
160160

161161
if !haskey(ENV, "PARDISOLICMESSAGE")
@@ -168,7 +168,7 @@ function __init__()
168168

169169
if mkl_is_available()
170170
try
171-
libmklpardiso = Libdl.dlopen(libmkl_rt[])
171+
libmklpardiso = Libdl.dlopen(libmkl_rt)
172172
mklpardiso_f = Libdl.dlsym(libmklpardiso, "pardiso")
173173
catch e
174174
@error("MKL Pardiso did not manage to load, error thrown was: $(sprint(showerror, e))")
@@ -178,7 +178,7 @@ function __init__()
178178

179179
# This is apparently needed for MKL to not get stuck on 1 thread when
180180
# libpardiso is loaded in the block below...
181-
if libmkl_rt[] !== ""
181+
if libmkl_rt !== ""
182182
get_nprocs_mkl()
183183
end
184184

src/mkl_pardiso.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ show(io::IO, ps::MKLPardisoSolver) = print(io, string("$MKLPardisoSolver:\n",
3838

3939
set_nprocs!(ps::MKLPardisoSolver, n::Integer) = set_nprocs_mkl!(n)
4040
set_nprocs_mkl!(n::Integer) =
41-
ccall((:mkl_domain_set_num_threads, libmkl_rt[]), Cvoid, (Ptr{Int32}, Ptr{Int32}), Ref((Int32(n))), Ref(MKL_DOMAIN_PARDISO))
41+
ccall((:mkl_domain_set_num_threads, libmkl_rt), Cvoid, (Ptr{Int32}, Ptr{Int32}), Ref((Int32(n))), Ref(MKL_DOMAIN_PARDISO))
4242
get_nprocs(ps::MKLPardisoSolver) = get_nprocs_mkl()
4343
get_nprocs_mkl() =
44-
ccall((:mkl_domain_get_max_threads, libmkl_rt[]), Int32, (Ptr{Int32},), Ref(MKL_DOMAIN_PARDISO))
44+
ccall((:mkl_domain_get_max_threads, libmkl_rt), Int32, (Ptr{Int32},), Ref(MKL_DOMAIN_PARDISO))
4545

4646
valid_phases(ps::MKLPardisoSolver) = keys(MKL_PHASES)
4747
phases(ps::MKLPardisoSolver) = MKL_PHASES
4848

4949
function ccall_pardisoinit(ps::MKLPardisoSolver)
5050
ERR = Ref{MklInt}(0)
51-
ccall((:pardisoinit, libmkl_rt[]), Cvoid,
51+
ccall((:pardisoinit, libmkl_rt), Cvoid,
5252
(Ptr{Int}, Ptr{MklInt}, Ptr{MklInt}),
5353
ps.pt, Ref(MklInt(ps.mtype)), ps.iparm)
5454
check_error(ps, ERR[])
@@ -63,7 +63,7 @@ function ccall_pardiso(ps::MKLPardisoSolver, N, nzval::Vector{Tv}, colptr, rowva
6363
NRHS = MklInt(NRHS)
6464

6565
ERR = Ref{MklInt}(0)
66-
ccall((PARDISO_FUNC, libmkl_rt[]), Cvoid,
66+
ccall((PARDISO_FUNC, libmkl_rt), Cvoid,
6767
(Ptr{Int}, Ptr{MklInt}, Ptr{MklInt}, Ptr{MklInt}, Ptr{MklInt},
6868
Ptr{MklInt}, Ptr{Tv}, Ptr{MklInt}, Ptr{MklInt}, Ptr{MklInt},
6969
Ptr{MklInt}, Ptr{MklInt}, Ptr{MklInt}, Ptr{Tv}, Ptr{Tv},

0 commit comments

Comments
 (0)