From ca8dba41e09debb575dce7bd9a3b7d5300067853 Mon Sep 17 00:00:00 2001 From: Christian Zentgraf Date: Tue, 29 Oct 2024 11:17:15 -0700 Subject: [PATCH] Unify and utilize NPROC variable for Linux setup scripts (#11366) Summary: This PR unifies the usage of the number of parallel build threads by using the defined NPROC variable. This variable is populated by the same mechanisms on macOS and Linux ensuring consistency and sharable functions for the script refactor. Pull Request resolved: https://github.com/facebookincubator/velox/pull/11366 Reviewed By: DanielHunte Differential Revision: D65148438 Pulled By: pedroerp fbshipit-source-id: 179b64ddbe210278cb91df6350896ab115bad58b --- scripts/setup-centos9.sh | 6 +++--- scripts/setup-ubuntu.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/setup-centos9.sh b/scripts/setup-centos9.sh index 04224adc90d1..1cf43630c4f1 100755 --- a/scripts/setup-centos9.sh +++ b/scripts/setup-centos9.sh @@ -102,7 +102,7 @@ function install_lzo { ( cd ${DEPENDENCY_DIR}/lzo ./configure --prefix=${INSTALL_PREFIX} --enable-shared --disable-static --docdir=/usr/share/doc/lzo-2.10 - make "-j$(nproc)" + make "-j${NPROC}" make install ) } @@ -117,10 +117,10 @@ function install_boost { # clang of version 15 when toolset clang-15 is used. # This reconciles the project-config.jam generation with what the b2 build system allows for customization. sed -i 's/using clang-15/using clang : 15/g' project-config.jam - ${SUDO} ./b2 "-j$(nproc)" -d0 install threading=multi toolset=clang-15 --without-python + ${SUDO} ./b2 "-j${NPROC}" -d0 install threading=multi toolset=clang-15 --without-python else ./bootstrap.sh --prefix=${INSTALL_PREFIX} - ${SUDO} ./b2 "-j$(nproc)" -d0 install threading=multi --without-python + ${SUDO} ./b2 "-j${NPROC}" -d0 install threading=multi --without-python fi ) } diff --git a/scripts/setup-ubuntu.sh b/scripts/setup-ubuntu.sh index 5874e98e9651..482e7ea3241d 100755 --- a/scripts/setup-ubuntu.sh +++ b/scripts/setup-ubuntu.sh @@ -128,10 +128,10 @@ function install_boost { # clang of version 15 when toolset clang-15 is used. # This reconciles the project-config.jam generation with what the b2 build system allows for customization. sed -i 's/using clang-15/using clang : 15/g' project-config.jam - ${SUDO} ./b2 "-j$(nproc)" -d0 install threading=multi toolset=clang-15 --without-python + ${SUDO} ./b2 "-j${NPROC}" -d0 install threading=multi toolset=clang-15 --without-python else ./bootstrap.sh --prefix=${INSTALL_PREFIX} - ${SUDO} ./b2 "-j$(nproc)" -d0 install threading=multi --without-python + ${SUDO} ./b2 "-j${NPROC}" -d0 install threading=multi --without-python fi ) }