@@ -121,11 +121,21 @@ install_zstd() {
121121# Install XGBoost from source
122122install_xgboost () {
123123 log_info " Installing XGBoost from source..."
124+ # Pinned, not tracking master: XGBoost removed the deprecated XGBoosterPredict
125+ # after v3.3.0, and libCacheSim's GLCache/inference.c still calls it, so a clone
126+ # of master fails to compile with "implicit declaration of function". v3.3.0 is
127+ # also what Homebrew installs, so the Linux and macOS wheels build against the
128+ # same API. The directory carries the version so a checkout left in /tmp by an
129+ # older run of this script is not silently reused.
130+ local xgboost_version=" v3.3.0"
131+ local xgboost_dir=" xgboost-${xgboost_version} "
132+
124133 pushd /tmp/ > /dev/null
125- if [[ ! -d " xgboost" ]]; then
126- git clone --recursive https://github.com/dmlc/xgboost
134+ if [[ ! -d " ${xgboost_dir} " ]]; then
135+ git clone --recursive --depth 1 --branch " ${xgboost_version} " \
136+ https://github.com/dmlc/xgboost " ${xgboost_dir} "
127137 fi
128- pushd xgboost > /dev/null
138+ pushd " ${xgboost_dir} " > /dev/null
129139 mkdir -p build
130140 pushd build > /dev/null
131141 cmake -G Ninja ..
@@ -139,11 +149,18 @@ install_xgboost() {
139149# Install LightGBM from source
140150install_lightgbm () {
141151 log_info " Installing LightGBM from source..."
152+ # Pinned for the same reason as XGBoost above -- an unpinned clone means the
153+ # build depends on whatever master happens to be that day. v4.7.0 matches the
154+ # version Homebrew installs for the macOS wheels.
155+ local lightgbm_version=" v4.7.0"
156+ local lightgbm_dir=" LightGBM-${lightgbm_version} "
157+
142158 pushd /tmp/ > /dev/null
143- if [[ ! -d " LightGBM" ]]; then
144- git clone --recursive https://github.com/microsoft/LightGBM
159+ if [[ ! -d " ${lightgbm_dir} " ]]; then
160+ git clone --recursive --depth 1 --branch " ${lightgbm_version} " \
161+ https://github.com/microsoft/LightGBM " ${lightgbm_dir} "
145162 fi
146- pushd LightGBM > /dev/null
163+ pushd " ${lightgbm_dir} " > /dev/null
147164 mkdir -p build
148165 pushd build > /dev/null
149166 cmake -G Ninja ..
0 commit comments