mirror of
https://github.com/vale981/ray
synced 2025-03-05 10:01: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)
|
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"
|
mkdir -p "$ROOT_DIR/build"
|
||||||
pushd "$ROOT_DIR/build"
|
pushd "$ROOT_DIR/build"
|
||||||
cmake ..
|
cmake ..
|
||||||
make install
|
make install -j$PARALLEL
|
||||||
popd
|
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
|
PREFIX=$TP_DIR/installed
|
||||||
|
|
||||||
# Determine how many parallel jobs to use for make based on the number of cores
|
# Determine how many parallel jobs to use for make based on the number of cores
|
||||||
if [[ "$OSTYPE" =~ ^linux ]]; then
|
unamestr="$(uname)"
|
||||||
PARALLEL=$(grep -c processor /proc/cpuinfo)
|
if [[ "$unamestr" == "Linux" ]]; then
|
||||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
PARALLEL=$(nproc)
|
||||||
|
elif [[ "$unamestr" == "Darwin" ]]; then
|
||||||
PARALLEL=$(sysctl -n hw.ncpu)
|
PARALLEL=$(sysctl -n hw.ncpu)
|
||||||
|
echo "Platform is macosx."
|
||||||
else
|
else
|
||||||
echo Unsupported platform $OSTYPE
|
echo "Unrecognized platform."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue