Skip to content

Commit

Permalink
Move OPENBLAS settings from Base to LinearAlgebra (JuliaLang#42473)
Browse files Browse the repository at this point in the history
* Move OPENBLAS settings from Base to LinearAlgebra

* Use __init__ of openblas for setting openblas env variables
  • Loading branch information
ViralBShah authored and LilithHafner committed Mar 8, 2022
1 parent dcd60f1 commit c3bb077
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 0 additions & 4 deletions base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions stdlib/OpenBLAS_jll/src/OpenBLAS_jll.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c3bb077

Please sign in to comment.