Use sysctl to get number of CPUs if on MacOS

release/4.3a0
Yashas Ambati 2025-02-26 10:38:00 -05:00
parent 26ea15c40e
commit 1cb51b81f4
1 changed files with 9 additions and 2 deletions

View File

@ -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