Skip to content

Commit 676cf92

Browse files
committed
refactor(build): Separate thrift and arrow install on Linux
This PR addresses two issues. 1. Address downloading reliability from archive.apache.org by switching to github. 2. Remove the bundling of thrift from arrow and make it a separate install. This follows a PR where the bundled version of arrow still bundles thrift but has changed download locations.
1 parent eab8e09 commit 676cf92

File tree

2 files changed

+41
-19
lines changed

2 files changed

+41
-19
lines changed

scripts/setup-centos9.sh

+20-9
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)/deps-download}
4343
FB_OS_VERSION="v2024.07.01.00"
4444
FMT_VERSION="10.1.1"
4545
BOOST_VERSION="boost-1.84.0"
46+
# Note: when updating arrow check if thrift needs an update as well.
47+
THRIFT_VERSION="v0.16.0"
4648
ARROW_VERSION="15.0.0"
4749
STEMMER_VERSION="2.2.0"
4850
DUCKDB_VERSION="v0.8.1"
@@ -191,8 +193,23 @@ function install_stemmer {
191193
)
192194
}
193195

196+
function install_thrift {
197+
wget_and_untar https://github.com/apache/thrift/archive/${THRIFT_VERSION}.tar.gz thrift
198+
(
199+
cd ${DEPENDENCY_DIR}/thrift
200+
./bootstrap.sh
201+
EXTRA_CXXFLAGS="-O3 -fPIC"
202+
# Clang will generate warnings and they need to be suppressed, otherwise the build will fail.
203+
if [[ ${USE_CLANG} != "false" ]]; then
204+
EXTRA_CXXFLAGS="-O3 -fPIC -Wno-inconsistent-missing-override -Wno-unused-but-set-variable"
205+
fi
206+
./configure --prefix=${INSTALL_PREFIX} --enable-tests=no --enable-tutorial=no --with-boost=${INSTALL_PREFIX} CXXFLAGS="${EXTRA_CXXFLAGS}"
207+
make "-j${NPROC}" install
208+
)
209+
}
210+
194211
function install_arrow {
195-
wget_and_untar https://archive.apache.org/dist/arrow/arrow-${ARROW_VERSION}/apache-arrow-${ARROW_VERSION}.tar.gz arrow
212+
wget_and_untar https://github.com/apache/arrow/archive/apache-arrow-${ARROW_VERSION}.tar.gz arrow
196213
cmake_install_dir arrow/cpp \
197214
-DARROW_PARQUET=OFF \
198215
-DARROW_WITH_THRIFT=ON \
@@ -208,21 +225,14 @@ function install_arrow {
208225
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
209226
-DCMAKE_BUILD_TYPE=Release \
210227
-DARROW_BUILD_STATIC=ON \
211-
-DThrift_SOURCE=BUNDLED \
212228
-DBOOST_ROOT=${INSTALL_PREFIX}
213-
214-
(
215-
# Install thrift.
216-
cd ${DEPENDENCY_DIR}/arrow/cpp/_build/thrift_ep-prefix/src/thrift_ep-build
217-
cmake --install ./ --prefix ${INSTALL_PREFIX}
218-
)
219229
}
220230

221231
function install_cuda {
222232
# See https://developer.nvidia.com/cuda-downloads
223233
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo
224234
local dashed="$(echo $1 | tr '.' '-')"
225-
dnf install -y cuda-nvcc-$dashed cuda-cudart-devel-$dashed cuda-nvrtc-devel-$dashed cuda-driver-devel-$dashed
235+
dnf install -y cuda-nvcc-$dashed cuda-cudart-devel-$dashed cuda-nvrtc-devel-$dashed cuda-driver-devel-$dashed
226236
}
227237

228238
function install_velox_deps {
@@ -242,6 +252,7 @@ function install_velox_deps {
242252
run_and_time install_fbthrift
243253
run_and_time install_duckdb
244254
run_and_time install_stemmer
255+
run_and_time install_thrift
245256
run_and_time install_arrow
246257
}
247258

scripts/setup-ubuntu.sh

+21-10
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ function install_gcc11_if_needed {
7575
FB_OS_VERSION="v2024.07.01.00"
7676
FMT_VERSION="10.1.1"
7777
BOOST_VERSION="boost-1.84.0"
78+
# Note: when updating arrow check if thrift needs an update as well.
79+
THRIFT_VERSION="v0.16.0"
7880
ARROW_VERSION="15.0.0"
7981
STEMMER_VERSION="2.2.0"
8082
DUCKDB_VERSION="v0.8.1"
@@ -95,12 +97,12 @@ function install_build_prerequisites {
9597
git \
9698
pkg-config \
9799
wget
98-
100+
99101
if [ ! -f ${PYTHON_VENV}/pyvenv.cfg ]; then
100102
echo "Creating Python Virtual Environment at ${PYTHON_VENV}"
101103
python3 -m venv ${PYTHON_VENV}
102104
fi
103-
source ${PYTHON_VENV}/bin/activate;
105+
source ${PYTHON_VENV}/bin/activate;
104106
# Install to /usr/local to make it available to all users.
105107
${SUDO} pip3 install cmake==3.28.3
106108

@@ -244,8 +246,23 @@ function install_stemmer {
244246
)
245247
}
246248

249+
function install_thrift {
250+
wget_and_untar https://github.com/apache/thrift/archive/${THRIFT_VERSION}.tar.gz thrift
251+
(
252+
cd ${DEPENDENCY_DIR}/thrift
253+
./bootstrap.sh
254+
EXTRA_CXXFLAGS="-O3 -fPIC"
255+
# Clang will generate warnings and they need to be suppressed, otherwise the build will fail.
256+
if [[ ${USE_CLANG} != "false" ]]; then
257+
EXTRA_CXXFLAGS="-O3 -fPIC -Wno-inconsistent-missing-override -Wno-unused-but-set-variable"
258+
fi
259+
./configure --prefix=${INSTALL_PREFIX} --enable-tests=no --enable-tutorial=no --with-boost=${INSTALL_PREFIX} CXXFLAGS="${EXTRA_CXXFLAGS}"
260+
make "-j${NPROC}" install
261+
)
262+
}
263+
247264
function install_arrow {
248-
wget_and_untar https://archive.apache.org/dist/arrow/arrow-${ARROW_VERSION}/apache-arrow-${ARROW_VERSION}.tar.gz arrow
265+
wget_and_untar https://github.com/apache/arrow/archive/apache-arrow-${ARROW_VERSION}.tar.gz arrow
249266
cmake_install_dir arrow/cpp \
250267
-DARROW_PARQUET=OFF \
251268
-DARROW_WITH_THRIFT=ON \
@@ -261,14 +278,7 @@ function install_arrow {
261278
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
262279
-DCMAKE_BUILD_TYPE=Release \
263280
-DARROW_BUILD_STATIC=ON \
264-
-DThrift_SOURCE=BUNDLED \
265281
-DBOOST_ROOT=${INSTALL_PREFIX}
266-
267-
(
268-
# Install thrift.
269-
cd ${DEPENDENCY_DIR}/arrow/cpp/_build/thrift_ep-prefix/src/thrift_ep-build
270-
$SUDO cmake --install ./ --prefix ${INSTALL_PREFIX}
271-
)
272282
}
273283

274284
function install_cuda {
@@ -296,6 +306,7 @@ function install_velox_deps {
296306
run_and_time install_conda
297307
run_and_time install_duckdb
298308
run_and_time install_stemmer
309+
run_and_time install_thrift
299310
run_and_time install_arrow
300311
}
301312

0 commit comments

Comments
 (0)