From 49b702a3219126c362a34f4b01ad21fdb480fcd3 Mon Sep 17 00:00:00 2001 From: Paulo Valente <16843419+polvalente@users.noreply.github.com> Date: Mon, 15 Jul 2024 21:15:22 -0300 Subject: [PATCH] fix: use sysctl for mac --- scripts/build_and_package.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/build_and_package.sh b/scripts/build_and_package.sh index bfa67bf..f48ae4d 100755 --- a/scripts/build_and_package.sh +++ b/scripts/build_and_package.sh @@ -4,7 +4,15 @@ set -e IREE_BUILD_TARGET=$1 -NUM_JOBS=-j$(($(nproc) - 2 )) +get_nproc() { + if [ "$(uname -s)" = "Darwin" ]; then + sysctl -n hw.ncpu + else + nproc + fi +} + +NUM_JOBS=-j$(get_nproc) mkdir -p iree-runtime/artifacts