Skip to content

Commit e454858

Browse files
authored
In the sysimage.mk Makefile, set the JULIA_NUM_THREADS=1 environment variable when running the generate_precompile.jl script (#44281)
1 parent 7615063 commit e454858

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

contrib/generate_precompile.jl

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

3+
if Threads.nthreads() != 1
4+
@warn "Running this file with multiple Julia threads may lead to a build error" Threads.nthreads()
5+
end
6+
37
if Base.isempty(Base.ARGS) || Base.ARGS[1] !== "0"
48
Sys.__init_build()
59
# Prevent this from being put into the Main namespace

sysimage.mk

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ define sysimg_builder
7777
$$(build_private_libdir)/sys$1-o.a $$(build_private_libdir)/sys$1-bc.a : $$(build_private_libdir)/sys$1-%.a : $$(build_private_libdir)/sys.ji
7878
@$$(call PRINT_JULIA, cd $$(JULIAHOME)/base && \
7979
if ! JULIA_BINDIR=$$(call cygpath_w,$(build_bindir)) WINEPATH="$$(call cygpath_w,$$(build_bindir));$$$$WINEPATH" \
80+
JULIA_NUM_THREADS=1 \
8081
$$(call spawn, $3) $2 -C "$$(JULIA_CPU_TARGET)" --output-$$* $$(call cygpath_w,$$@).tmp $$(JULIA_SYSIMG_BUILD_FLAGS) \
8182
--startup-file=no --warn-overwrite=yes --sysimage $$(call cygpath_w,$$<) $$(call cygpath_w,$$(JULIAHOME)/contrib/generate_precompile.jl) $(JULIA_PRECOMPILE); then \
8283
echo '*** This error is usually fixed by running `make clean`. If the error persists$$(COMMA) try `make cleanall`. ***'; \

0 commit comments

Comments
 (0)