diff --git a/build.sh b/build.sh index 5a09b7a0a165e3..9559e57a5fd357 100755 --- a/build.sh +++ b/build.sh @@ -148,7 +148,14 @@ fi eval set -- "${OPTS}" -PARALLEL="$(($(nproc) / 4 + 1))" +NUM_CORES=0 +if [[ "$(uname -s)" == 'Darwin' ]]; then + NUM_CORES=$(sysctl -n hw.logicalcpu) +else + NUM_CORES=$(nproc) +fi + +PARALLEL="$((${NUM_CORES} / 4 + 1))" BUILD_FE=0 BUILD_BE=0 BUILD_CLOUD=0 diff --git a/thirdparty/download-thirdparty.sh b/thirdparty/download-thirdparty.sh index 8f6a9fafc71757..8c982b6f432a2b 100755 --- a/thirdparty/download-thirdparty.sh +++ b/thirdparty/download-thirdparty.sh @@ -54,9 +54,11 @@ SPEC_ARCHIVES=( ) while [[ $# -gt 0 ]]; do GIVEN_LIB=$1 + GIVEN_LIB_LOWER="$(echo ${GIVEN_LIB} | awk '{print tolower($0)}')" SPEC_LIB= for TP_ARCH in "${TP_ARCHIVES[@]}"; do - if [[ "${GIVEN_LIB,,}" = "${TP_ARCH,,}" ]]; then + TP_ARCH_LOWER="$(echo ${TP_ARCH} | awk '{print tolower($0)}')" + if [[ "${GIVEN_LIB_LOWER}" = "${TP_ARCH_LOWER}" ]]; then SPEC_LIB=${TP_ARCH} break fi