[fix](build) The nproc command does not exist in macos by default, use sysctl -n hw.logicalcpu instead to get the number of logical cores available (#11379)
This commit is contained in:
11
thirdparty/build-thirdparty.sh
vendored
11
thirdparty/build-thirdparty.sh
vendored
@ -59,7 +59,14 @@ fi
|
||||
|
||||
eval set -- "$OPTS"
|
||||
|
||||
PARALLEL=$(($(nproc) / 4 + 1))
|
||||
KERNEL="$(uname -s)"
|
||||
|
||||
if [[ "${KERNEL}" == 'Darwin' ]]; then
|
||||
PARALLEL=$(($(sysctl -n hw.logicalcpu) / 4 + 1))
|
||||
else
|
||||
PARALLEL=$(($(nproc) / 4 + 1))
|
||||
fi
|
||||
|
||||
if [[ $# -ne 1 ]]; then
|
||||
while true; do
|
||||
case "$1" in
|
||||
@ -142,8 +149,6 @@ elif [[ "$CC" == *clang ]]; then
|
||||
libhdfs_cxx17=-std=c++1z
|
||||
fi
|
||||
|
||||
KERNEL="$(uname -s)"
|
||||
|
||||
# prepare installed prefix
|
||||
mkdir -p "${TP_DIR}/installed/lib64"
|
||||
pushd "${TP_DIR}/installed"/
|
||||
|
||||
Reference in New Issue
Block a user