Skip to content

Commit 7669c4b

Browse files
committed
libblastrampoline_jll: Run __init__ eagerly
This allows LBT to be used during a sysimage (`--trim`) build.
1 parent fed86d9 commit 7669c4b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

stdlib/libblastrampoline_jll/src/libblastrampoline_jll.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,17 @@ function __init__()
5757
global libblastrampoline_path = string(libblastrampoline.path)
5858
global artifact_dir = dirname(Sys.BINDIR)
5959
LIBPATH[] = dirname(libblastrampoline_path)
60+
empty!(LIBPATH_list)
6061
push!(LIBPATH_list, LIBPATH[])
6162
end
6263

64+
# Running this __init__() eagerly initializes several of the above global
65+
# with build-time values (which are not correct to use at run-time), but
66+
# thankfully these will be reset by __init__() before they are used.
67+
#
68+
# This allows BLAS / LinearAlgebra to be used in a sysimage (`--trim`) build.
69+
__init__()
70+
6371
if Base.generating_output()
6472
precompile(eager_mode, ())
6573
precompile(is_available, ())

0 commit comments

Comments
 (0)