Fix compilation error of core on macOS (#9317)

Signed-off-by: Xiangyu Wang <xiangyu.wang@zilliz.com>
pull/9462/head^2
Xiangyu Wang 2021-10-08 20:48:56 +08:00 committed by GitHub
parent cd7f83eb95
commit e281b623d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -2,7 +2,17 @@
# Compile jobs variable; Usage: $ jobs=12 ./build.sh ...
if [[ ! ${jobs+1} ]]; then
jobs=$(nproc)
if command -v nproc &> /dev/null
# For linux
then
jobs=$(nproc)
elif command -v sysctl &> /dev/null
# For macOS
then
jobs=$(sysctl -n hw.logicalcpu)
else
jobs=4
fi
fi
SOURCE="${BASH_SOURCE[0]}"