From b6d2434909f15abeca03bb9b68333f5ff670ce9e Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Tue, 20 Sep 2022 08:07:35 +0200 Subject: [PATCH] set number of openblas threads to 1 while precompiling (#46792) --- base/loading.jl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index 433c7c5521c69..81919dfea0770 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -1684,12 +1684,14 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, concrete_d deps_eltype = sprint(show, eltype(concrete_deps); context = :module=>nothing) deps = deps_eltype * "[" * join(deps_strs, ",") * "]" trace = isassigned(PRECOMPILE_TRACE_COMPILE) ? `--trace-compile=$(PRECOMPILE_TRACE_COMPILE[])` : `` - io = open(pipeline(`$(julia_cmd()::Cmd) -O0 - --output-ji $output --output-incremental=yes - --startup-file=no --history-file=no --warn-overwrite=yes - --color=$(have_color === nothing ? "auto" : have_color ? "yes" : "no") - $trace - -`, stderr = internal_stderr, stdout = internal_stdout), + io = open(pipeline(addenv(`$(julia_cmd()::Cmd) -O0 + --output-ji $output --output-incremental=yes + --startup-file=no --history-file=no --warn-overwrite=yes + --color=$(have_color === nothing ? "auto" : have_color ? "yes" : "no") + $trace + -`, + "OPENBLAS_NUM_THREADS" => 1), + stderr = internal_stderr, stdout = internal_stdout), "w", stdout) # write data over stdin to avoid the (unlikely) case of exceeding max command line size write(io.in, """