This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new edf92f10ff [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)
edf92f10ff is described below

commit edf92f10ffac37c624ee68bb4a05bd9e39d2ee4a
Author: Yiqun Zhang <[email protected]>
AuthorDate: Tue Aug 2 09:11:14 2022 +0800

    [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)
---
 thirdparty/build-thirdparty.sh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh
index 569427e329..3953142f52 100755
--- a/thirdparty/build-thirdparty.sh
+++ b/thirdparty/build-thirdparty.sh
@@ -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"/


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to