mirror of
https://github.com/vale981/ray
synced 2025-03-12 14:16:39 -04:00
21 lines
522 B
Bash
21 lines
522 B
Bash
![]() |
#!/usr/bin/env bash
|
||
|
|
||
|
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 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-g" -DCMAKE_CXX_FLAGS="-g" ..
|
||
|
make install -j$PARALLEL
|
||
|
popd
|