Skip to content

Commit

Permalink
chore: Update install_dependency.sh script (#72)
Browse files Browse the repository at this point in the history
The `install_dependency.sh` script has been updated to include error checking and command tracing. This change improves the script's reliability and makes it easier to debug.
  • Loading branch information
xiaguan authored Jul 10, 2024
1 parent b77b659 commit d88a71c
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions scripts/install_dependency.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eu # Enable error checking and command tracing

setup_ubuntu() {
sudo apt update
sudo apt install -yqq libglib2.0-dev libgoogle-perftools-dev build-essential cmake google-perftools xxhash
Expand All @@ -23,7 +25,7 @@ setup_xgboost() {
if [[ $GITHUB_ACTIONS == "true" ]]; then
make
else
make -j
make -j $(nproc)
fi
sudo make install
}
Expand All @@ -38,7 +40,7 @@ setup_lightgbm() {
if [[ $GITHUB_ACTIONS == "true" ]]; then
make
else
make -j
make -j $(nproc)
fi
sudo make install
}
Expand All @@ -51,19 +53,19 @@ setup_zstd() {
mkdir _build;
pushd _build/;
cmake ..
make -j
make -j $(nproc)
sudo make install
}

CURR_DIR=$(pwd)

if [ -n "$(uname -a | grep Ubuntu)" ]; then
setup_ubuntu
elif [ -n "$(uname -a | grep Darwin)" ]; then
setup_macOS
if [ -n "$(uname -a | grep Ubuntu)" ] || [ -n "$(uname -a | grep WSL)" ]; then
setup_ubuntu
elif [ -n "$(uname -a | grep Darwin)" ]; then
setup_macOS
else
setup_centos
fi
setup_centos
fi

setup_zstd

Expand Down

0 comments on commit d88a71c

Please sign in to comment.