8000 mono, or-tools: cap build parallelism to nproc/4 by bryan-minimal · Pull Request #132 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/mono/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ sed -i 's/cmake_minimum_required (VERSION 2\.8\.10)/cmake_minimum_required (VERS
--with-monotouch=no \
--with-xammac=no

make -j$(nproc)
# Cap parallelism to nproc/4 (matches packages/foundationdb). Mono's
# bootstrap (byacc + jay + corlib + the runtime) is memory-greedy at
# -j32 and OOMs the whole build.
JOBS=$(( $(nproc) / 4 ))
[ "$JOBS" -lt 1 ] && JOBS=1

make -j"$JOBS"
make DESTDIR=$OUTPUT_DIR install

# Remove .la files for reproducibility
Expand Down
8 changes: 7 additions & 1 deletion packages/or-tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ cmake -G Ninja \
# protoc and other build-time tools need to find their shared libs
export LD_LIBRARY_PATH="$(pwd)/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

ninja -j$(nproc)
# Cap parallelism to nproc/4 (matches packages/foundationdb). or-tools'
# inline-built deps (protobuf, abseil, HiGHS, eigen) link together at peak
# and explode memory at -j32, OOMing the whole build.
JOBS=$(( $(nproc) / 4 ))
[ "$JOBS" -lt 1 ] && JOBS=1

ninja -j"$JOBS"

DESTDIR="$OUTPUT_DIR" ninja install
0