From b18b1d04a4b5b5a28d1e92a654033783372add32 Mon Sep 17 00:00:00 2001 From: Zhigao Tong Date: Wed, 16 Mar 2022 17:19:53 +0800 Subject: [PATCH] Limit build release parallelism (#4301) ref pingcap/tiflash#4141 --- release-centos7-llvm/scripts/build-tiflash-release.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release-centos7-llvm/scripts/build-tiflash-release.sh b/release-centos7-llvm/scripts/build-tiflash-release.sh index c424d465742..d3eda1dff4e 100755 --- a/release-centos7-llvm/scripts/build-tiflash-release.sh +++ b/release-centos7-llvm/scripts/build-tiflash-release.sh @@ -35,6 +35,7 @@ set -ueox pipefail SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" SRCPATH=$(cd ${SCRIPTPATH}/../..; pwd -P) +NPROC=${NPROC:-$(nproc || grep -c ^processor /proc/cpuinfo)} INSTALL_DIR="${SRCPATH}/release-centos7-llvm/tiflash" rm -rf ${INSTALL_DIR} && mkdir -p ${INSTALL_DIR} @@ -51,7 +52,7 @@ cmake "${SRCPATH}" ${DEFINE_CMAKE_PREFIX_PATH} \ -DRUN_HAVE_STD_REGEX=0 \ -GNinja -cmake --build . --target tiflash --parallel +cmake --build . --target tiflash --parallel ${NPROC} cmake --install . --component=tiflash-release --prefix="${INSTALL_DIR}" # unset LD_LIBRARY_PATH before test