Skip to content

Commit ba215c0

Browse files
author
Jeff Hammond
authored
[BuildBot] Add option to set (i.e. reduce) build parallelism (#2301)
the default option of "all the cores" or "4" is imprudent on some systems, or when the user wants the system to be more responsive to other applications. this change was inspired by the thermal death (thankfully temporary) of my Raspberry Pi, which has 4 cores but overheats when building LLVM on all of them (a heatsink or fan would presumably resolve this). Signed-off-by: Hammond, Jeff R <[email protected]>
1 parent 43ba606 commit ba215c0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

buildbot/compile.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ def do_compile(args):
1313
except NotImplementedError:
1414
cpu_count = DEFAULT_CPU_COUNT
1515

16+
if args.build_parallelism:
17+
cpu_count = int(args.build_parallelism)
18+
1619
# Get absolute path to source directory
1720
if args.src_dir:
1821
abs_src_dir = os.path.abspath(args.src_dir)
@@ -51,6 +54,7 @@ def main():
5154
help="builder directory, which is the directory contains source and build directories")
5255
parser.add_argument("-s", "--src-dir", metavar="SRC_DIR", help="source directory")
5356
parser.add_argument("-o", "--obj-dir", metavar="OBJ_DIR", help="build directory")
57+
parser.add_argument("-j", "--build-parallelism", metavar="BUILD_PARALLELISM", help="build parallelism")
5458

5559
args = parser.parse_args()
5660

0 commit comments

Comments
 (0)