From c3c5c8644cae5d8ae0eb94eb9332d8881b020d83 Mon Sep 17 00:00:00 2001 From: cyan Date: Tue, 28 Jan 2025 13:22:30 +0100 Subject: [PATCH] fix MAKE_JOB_COUNT on darwin, and use it on ios and macos scripts (#1981) --- scripts/functions.sh | 2 +- scripts/ios/build_monero_all.sh | 2 +- scripts/macos/build_monero_all.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/functions.sh b/scripts/functions.sh index 3b613da22..b4b12416a 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -26,7 +26,7 @@ then export MAKE_JOB_COUNT="$(expr $(printf '%s\n%s' $(( $(grep MemTotal: /proc/meminfo | cut -d: -f2 | cut -dk -f1) * 4 / (1048576 * 9) )) $(nproc) | sort -n | head -n1) '|' 1)" elif [[ "$(uname)" == "Darwin" ]]; then - export MAKE_JOB_COUNT="(expr $(printf '%s\n%s' $(( $(sysctl -n hw.memsize) * 4 / (1073741824 * 9) )) $(sysctl -n hw.logicalcpu) | sort -n | head -n1) '|' 1)" + export MAKE_JOB_COUNT="$(expr $(printf '%s\n%s' $(( $(sysctl -n hw.memsize) * 4 / (1073741824 * 9) )) $(sysctl -n hw.logicalcpu) | sort -n | head -n1) '|' 1)" else # Assume windows eh? export MAKE_JOB_COUNT="$(expr $(printf '%s\n%s' $(( $(grep MemTotal: /proc/meminfo | cut -d: -f2 | cut -dk -f1) * 4 / (1048576 * 9) )) $(nproc) | sort -n | head -n1) '|' 1)" diff --git a/scripts/ios/build_monero_all.sh b/scripts/ios/build_monero_all.sh index e90b9c088..79a3c61f8 100755 --- a/scripts/ios/build_monero_all.sh +++ b/scripts/ios/build_monero_all.sh @@ -19,7 +19,7 @@ for COIN in monero wownero zano; do pushd ../monero_c rm -rf external/ios/build - ./build_single.sh ${COIN} aarch64-apple-ios -j$NPROC + ./build_single.sh ${COIN} aarch64-apple-ios -j$MAKE_JOB_COUNT popd done diff --git a/scripts/macos/build_monero_all.sh b/scripts/macos/build_monero_all.sh index 09b08c620..f46674242 100755 --- a/scripts/macos/build_monero_all.sh +++ b/scripts/macos/build_monero_all.sh @@ -39,7 +39,7 @@ else WOWNERO_LIBS="$WOWNERO_LIBS -arch ${ARCH} ${WOWNEROC_RELEASE_DIR}/${HOST}_libwallet2_api_c.dylib" pushd ../monero_c - ./build_single.sh ${COIN} ${HOST} $NPROC + ./build_single.sh ${COIN} ${HOST} -j$MAKE_JOB_COUNT unxz -f ./release/${COIN}/${HOST}_libwallet2_api_c.dylib.xz popd done