mirror of
https://github.com/vale981/ray
synced 2025-03-04 17:41:43 -05:00
build ray in parallel
This commit is contained in:
parent
28747d3c5e
commit
b99ea3ca4e
2 changed files with 18 additions and 5 deletions
13
build.sh
13
build.sh
|
@ -2,8 +2,19 @@
|
|||
|
||||
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
|
||||
|
||||
# Determine how many parallel jobs to use for make based on the number of cores
|
||||
unamestr="$(uname)"
|
||||
if [[ "$unamestr" == "Linux" ]]; then
|
||||
PARALLEL=$(nproc)
|
||||
elif [[ "$unamestr" == "Darwin" ]]; then
|
||||
PARALLEL=$(sysctl -n hw.ncpu)
|
||||
else
|
||||
echo "Unrecognized platform."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$ROOT_DIR/build"
|
||||
pushd "$ROOT_DIR/build"
|
||||
cmake ..
|
||||
make install
|
||||
make install -j$PARALLEL
|
||||
popd
|
||||
|
|
10
thirdparty/build_thirdparty.sh
vendored
10
thirdparty/build_thirdparty.sh
vendored
|
@ -7,12 +7,14 @@ TP_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
|
|||
PREFIX=$TP_DIR/installed
|
||||
|
||||
# Determine how many parallel jobs to use for make based on the number of cores
|
||||
if [[ "$OSTYPE" =~ ^linux ]]; then
|
||||
PARALLEL=$(grep -c processor /proc/cpuinfo)
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
unamestr="$(uname)"
|
||||
if [[ "$unamestr" == "Linux" ]]; then
|
||||
PARALLEL=$(nproc)
|
||||
elif [[ "$unamestr" == "Darwin" ]]; then
|
||||
PARALLEL=$(sysctl -n hw.ncpu)
|
||||
echo "Platform is macosx."
|
||||
else
|
||||
echo Unsupported platform $OSTYPE
|
||||
echo "Unrecognized platform."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue