mirror of https://github.com/milvus-io/milvus.git
Support to get nproc on macOS in the compilation (#8281)
Signed-off-by: Xiangyu Wang <xiangyu.wang@zilliz.com>pull/8064/head
parent
3437d37add
commit
43ad33ecea
|
@ -2,7 +2,17 @@
|
|||
|
||||
# Compile jobs variable; Usage: $ jobs=12 ./core_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]}"
|
||||
|
|
Loading…
Reference in New Issue