mirror of
https://github.com/wassname/ray.git
synced 2026-07-01 12:37:14 +08:00
build ray in parallel
This commit is contained in:
@@ -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
|
||||
|
||||
Vendored
+6
-4
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user