diff --git a/base/Base.jl b/base/Base.jl index 1ca3c16deb24b..26ce2780527aa 100644 --- a/base/Base.jl +++ b/base/Base.jl @@ -461,10 +461,6 @@ end if is_primary_base_module function __init__() - # try to ensuremake sure OpenBLAS does not set CPU affinity (#1070, #9639) - if !haskey(ENV, "OPENBLAS_MAIN_FREE") - ENV["OPENBLAS_MAIN_FREE"] = "1" - end # for the few uses of Libc.rand in Base: Libc.srand() # Base library init diff --git a/stdlib/OpenBLAS_jll/src/OpenBLAS_jll.jl b/stdlib/OpenBLAS_jll/src/OpenBLAS_jll.jl index c69f3a262b298..f656621d957d6 100644 --- a/stdlib/OpenBLAS_jll/src/OpenBLAS_jll.jl +++ b/stdlib/OpenBLAS_jll/src/OpenBLAS_jll.jl @@ -32,6 +32,11 @@ else end function __init__() + # make sure OpenBLAS does not set CPU affinity (#1070, #9639) + if !haskey(ENV, "OPENBLAS_MAIN_FREE") + ENV["OPENBLAS_MAIN_FREE"] = "1" + end + global libopenblas_handle = dlopen(libopenblas) global libopenblas_path = dlpath(libopenblas_handle) global artifact_dir = dirname(Sys.BINDIR)