Skip to content

Commit a512f1a

Browse files
authored
Move OPENBLAS settings from Base to LinearAlgebra (#42473)
* Move OPENBLAS settings from Base to LinearAlgebra * Use __init__ of openblas for setting openblas env variables
1 parent 9a2e763 commit a512f1a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

base/Base.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,10 +461,6 @@ end
461461

462462
if is_primary_base_module
463463
function __init__()
464-
# try to ensuremake sure OpenBLAS does not set CPU affinity (#1070, #9639)
465-
if !haskey(ENV, "OPENBLAS_MAIN_FREE")
466-
ENV["OPENBLAS_MAIN_FREE"] = "1"
467-
end
468464
# for the few uses of Libc.rand in Base:
469465
Libc.srand()
470466
# Base library init

stdlib/OpenBLAS_jll/src/OpenBLAS_jll.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ else
3232
end
3333

3434
function __init__()
35+
# make sure OpenBLAS does not set CPU affinity (#1070, #9639)
36+
if !haskey(ENV, "OPENBLAS_MAIN_FREE")
37+
ENV["OPENBLAS_MAIN_FREE"] = "1"
38+
end
39+
3540
global libopenblas_handle = dlopen(libopenblas)
3641
global libopenblas_path = dlpath(libopenblas_handle)
3742
global artifact_dir = dirname(Sys.BINDIR)

0 commit comments

Comments
 (0)