Skip to content

Commit

Permalink
Unify and utilize NPROC variable for Linux setup scripts (#11366)
Browse files Browse the repository at this point in the history
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: #11366

Reviewed By: DanielHunte

Differential Revision: D65148438

Pulled By: pedroerp

fbshipit-source-id: 179b64ddbe210278cb91df6350896ab115bad58b
  • Loading branch information
czentgr authored and facebook-github-bot committed Oct 29, 2024
1 parent d471912 commit ca8dba4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions scripts/setup-centos9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
Expand All @@ -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
)
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
Expand Down

0 comments on commit ca8dba4

Please sign in to comment.