Skip to content

Commit 6d3d368

Browse files
authored
Fix incompatible macOS dependencies (#181)
* Replace clang-tidy dependency with llvm for macOS (clang-tidy is not a standalone package but is provided by llvm) * Add wget to macOS brew install * Install cmake, zstd, xgboost, lightgbm using brew on macOS
1 parent 8af5297 commit 6d3d368

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

scripts/install_dependency.sh

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ setup_macOS() {
130130
log_error "Homebrew is not installed. Please install Homebrew first."
131131
exit 1
132132
fi
133-
brew install glib google-perftools argp-standalone xxhash llvm
133+
brew install glib google-perftools argp-standalone xxhash llvm wget cmake zstd xgboost lightgbm
134134
}
135135

136136
# Install CMake
@@ -234,24 +234,27 @@ main() {
234234
setup_centos
235235
fi
236236

237-
# Install requested components
238-
if [ "$INSTALL_ALL" = true ] || [ "$INSTALL_CMAKE" = true ]; then
239-
install_cmake
240-
fi
237+
# Install requested components only on non macOS computers
238+
# Libraries already installed on macOS using brew in setup_macOS
239+
if [[ -z "$(uname -a | grep Darwin)" ]]; then
240+
if [ "$INSTALL_ALL" = true ] || [ "$INSTALL_CMAKE" = true ]; then
241+
install_cmake
242+
fi
241243

242-
if [ "$INSTALL_ALL" = true ] || [ "$INSTALL_ZSTD" = true ]; then
243-
install_zstd
244-
fi
244+
if [ "$INSTALL_ALL" = true ] || [ "$INSTALL_ZSTD" = true ]; then
245+
install_zstd
246+
fi
245247

246-
if [ "$INSTALL_ALL" = true ] || [ "$INSTALL_XGBOOST" = true ]; then
247-
if [[ ! ${GITHUB_ACTIONS:-} == "true" ]]; then
248-
install_xgboost
248+
if [ "$INSTALL_ALL" = true ] || [ "$INSTALL_XGBOOST" = true ]; then
249+
if [[ ! ${GITHUB_ACTIONS:-} == "true" ]]; then
250+
install_xgboost
251+
fi
249252
fi
250-
fi
251253

252-
if [ "$INSTALL_ALL" = true ] || [ "$INSTALL_LIGHTGBM" = true ]; then
253-
if [[ ! ${GITHUB_ACTIONS:-} == "true" ]]; then
254-
install_lightgbm
254+
if [ "$INSTALL_ALL" = true ] || [ "$INSTALL_LIGHTGBM" = true ]; then
255+
if [[ ! ${GITHUB_ACTIONS:-} == "true" ]]; then
256+
install_lightgbm
257+
fi
255258
fi
256259
fi
257260

0 commit comments

Comments
 (0)