summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Krivopalov2018-03-04 17:17:00 -0800
committerVladimir Krivopalov2018-03-04 17:17:00 -0800
commit15f4aaeff6f65063b93e645b727b75826ad6b73a (patch)
treee5d0af6b70b0393c34cdb4da028c50c13e99e751
parent1cd274843330a7632cfaab7a4745dee467f5a56b (diff)
downloadaur-15f4aaeff6f65063b93e645b727b75826ad6b73a.tar.gz
Use only half of the available CPU threads for compilation to prevent running out of memory
Signed-off-by: Vladimir Krivopalov <vladimir.krivopalov@gmail.com>
-rw-r--r--PKGBUILD7
1 files changed, 6 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 30c5eade2dd8..1a18b3b0b123 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -58,7 +58,12 @@ build() {
sed -i -e 's@sizeof(byte)@sizeof(CryptoPP::byte)@g' md5_hasher.hh repair/repair.cc
sed -i -e 's@reinterpret_cast<const byte@reinterpret_cast<const CryptoPP::byte@g' md5_hasher.hh repair/repair.cc
./configure.py --mode=release
- ninja -j`nproc --all` build/release/scylla build/release/iotune
+ JOBS=`nproc --all`
+ # It turns out that on maximum jobs compiler often runs out of memory and crashes
+ # Let's be conservative and assign only half of the available CPU threads
+ # It will make compilation slower but increase the chance of success
+ if [ "$JOBS" -gt 1 ]; then JOBS=$((JOBS / 2)); fi
+ ninja -j${JOBS} build/release/scylla build/release/iotune
cp dist/common/systemd/scylla-server.service.in build/scylla-server.service
sed -i -e "s#@@SYSCONFDIR@@#${_sysconfdir}/sysconfig#g" build/scylla-server.service
}