From e8829e21e7a0bb8ce69e8d16f2aa44bb440230f9 Mon Sep 17 00:00:00 2001 From: Stephan Oeste Date: Wed, 6 Jul 2022 14:41:11 +0200 Subject: [PATCH] Limit make to max cpus in prod install --- production/install | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/production/install b/production/install index 9f2533c61..74c6f1061 100755 --- a/production/install +++ b/production/install @@ -6,11 +6,13 @@ case `uname -s` in FreeBSD) OS=FreeBSD + NPROC=$(sysctl hw.ncpu | awk '{print $2}') ;; Linux) if [ "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then OS=Debian + NPROC=$(nproc --all) else echo "Your distribution of Linux is not yet supported by this installation script" exit 1 @@ -964,7 +966,7 @@ if [ "${BITCOIN_INSTALL}" = ON ];then echo "[*] Building Bitcoin from source repo" osSudo "${BITCOIN_USER}" sh -c "cd ${BITCOIN_REPO_NAME} && ./autogen.sh --quiet" osSudo "${BITCOIN_USER}" sh -c "cd ${BITCOIN_REPO_NAME} && MAKE=gmake CC=cc CXX=c++ CPPFLAGS=-I/usr/local/include ./configure --with-gui=no --disable-wallet --disable-tests" - osSudo "${BITCOIN_USER}" sh -c "cd ${BITCOIN_REPO_NAME} && gmake -j48" + osSudo "${BITCOIN_USER}" sh -c "cd ${BITCOIN_REPO_NAME} && gmake -j${NPROC}" echo "[*] Installing Bitcoin binaries into OS" osSudo "${ROOT_USER}" sh -c "cd ${BITCOIN_HOME}/${BITCOIN_REPO_NAME} && gmake install" @@ -1009,7 +1011,7 @@ if [ "${ELEMENTS_INSTALL}" = ON ];then echo "[*] Building Elements from source repo" osSudo "${ELEMENTS_USER}" sh -c "cd ${ELEMENTS_REPO_NAME} && ./autogen.sh --quiet" osSudo "${ELEMENTS_USER}" sh -c "cd ${ELEMENTS_REPO_NAME} && MAKE=gmake CC=cc CXX=c++ CPPFLAGS=-I/usr/local/include ./configure --with-gui=no --disable-wallet --disable-tests" - osSudo "${ELEMENTS_USER}" sh -c "cd ${ELEMENTS_REPO_NAME} && gmake -j48" + osSudo "${ELEMENTS_USER}" sh -c "cd ${ELEMENTS_REPO_NAME} && gmake -j${NPROC}" echo "[*] Installing Elements binaries into OS" osSudo "${ROOT_USER}" sh -c "cd ${ELEMENTS_HOME}/${ELEMENTS_REPO_NAME} && gmake install"