From 1cb51b81f40d7c67b14b2f603d8f6685cce31aad Mon Sep 17 00:00:00 2001 From: Yashas Ambati Date: Wed, 26 Feb 2025 10:38:00 -0500 Subject: [PATCH] Use sysctl to get number of CPUs if on MacOS --- build_tools/wheels/cibw_before_all.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build_tools/wheels/cibw_before_all.sh b/build_tools/wheels/cibw_before_all.sh index 1c1d13581..4f0f33f16 100644 --- a/build_tools/wheels/cibw_before_all.sh +++ b/build_tools/wheels/cibw_before_all.sh @@ -49,5 +49,12 @@ cmake $PROJECT_DIR \ -DCMAKE_INSTALL_PREFIX=$PROJECT_DIR/gtsam_install cd $PROJECT_DIR/build/python -make -j $(nproc) install -make -j $(nproc) python-stubs + +if [ "$(uname)" == "Linux" ]; then + make -j $(nproc) install + make -j $(nproc) python-stubs +elif [ "$(uname)" == "Darwin" ]; then + make -j $(sysctl -n hw.logicalcpu) install + make -j $(sysctl -n hw.logicalcpu) python-stubs +fi +