Skip to content

Commit 75087e8

Browse files
XXXXRT666fs-eire
authored andcommitted
Fix build.sh --parallel 1 incorrectly triggering parallel build (#26264)
### Description This PR fixes an issue where running ```bash bash build.sh ...... --parallel 1 ...... ``` still triggers a parallel build. The previous logic only added -j when num_parallel_jobs != 1, which caused Ninja/Make/Xcode to use all CPU cores by default. ### Motivation and Context When building ONNX Runtime, using parallel 4 caused an out-of-memory (OOM) error in my computer. However, changing it to parallel 1 still triggered parallel compilation and caused OOM again.
1 parent 6cf8d12 commit 75087e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/ci_build/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ def build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, targe
13331333
cmd_args.extend(["--target", *targets])
13341334

13351335
build_tool_args = []
1336-
if num_parallel_jobs != 1:
1336+
if num_parallel_jobs != 0:
13371337
if is_windows() and args.cmake_generator != "Ninja" and not args.build_wasm:
13381338
# https://github.com/Microsoft/checkedc-clang/wiki/Parallel-builds-of-clang-on-Windows suggests
13391339
# not maxing out CL_MPCount

0 commit comments

Comments
 (0)