Skip to content

Commit

Permalink
In the sysimage.mk Makefile, set the JULIA_NUM_THREADS=1 environm…
Browse files Browse the repository at this point in the history
…ent variable when running the `generate_precompile.jl` script (#44281)
  • Loading branch information
DilumAluthge authored Feb 20, 2022
1 parent 7615063 commit e454858
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contrib/generate_precompile.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

if Threads.nthreads() != 1
@warn "Running this file with multiple Julia threads may lead to a build error" Threads.nthreads()
end

if Base.isempty(Base.ARGS) || Base.ARGS[1] !== "0"
Sys.__init_build()
# Prevent this from being put into the Main namespace
Expand Down
1 change: 1 addition & 0 deletions sysimage.mk
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ define sysimg_builder
$$(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
@$$(call PRINT_JULIA, cd $$(JULIAHOME)/base && \
if ! JULIA_BINDIR=$$(call cygpath_w,$(build_bindir)) WINEPATH="$$(call cygpath_w,$$(build_bindir));$$$$WINEPATH" \
JULIA_NUM_THREADS=1 \
$$(call spawn, $3) $2 -C "$$(JULIA_CPU_TARGET)" --output-$$* $$(call cygpath_w,$$@).tmp $$(JULIA_SYSIMG_BUILD_FLAGS) \
--startup-file=no --warn-overwrite=yes --sysimage $$(call cygpath_w,$$<) $$(call cygpath_w,$$(JULIAHOME)/contrib/generate_precompile.jl) $(JULIA_PRECOMPILE); then \
echo '*** This error is usually fixed by running `make clean`. If the error persists$$(COMMA) try `make cleanall`. ***'; \
Expand Down

0 comments on commit e454858

Please sign in to comment.