@@ -6,6 +6,40 @@ set -eoux pipefail
66# It installs the required build-time dependencies for python wheels #
77# OpenBlas is built from source (instead of distro provided) with recommended flags for performance #
88# ####################################################################################################
9+ export WHEEL_DIR=${WHEEL_DIR:- " /wheelsdir" }
10+ mkdir -p ${WHEEL_DIR}
11+
12+ build_pyarrow () {
13+ CURDIR=$( pwd)
14+
15+ export PYARROW_VERSION=${1:- $(curl -s https:// api.github.com/ repos/ apache/ arrow/ releases/ latest | jq -r ' .tag_name' | grep -Eo " [0-9\.]+" )}
16+
17+ TEMP_BUILD_DIR=$( mktemp -d)
18+ cd ${TEMP_BUILD_DIR}
19+
20+ : ================== Installing Pyarrow ==================
21+ git clone --recursive https://github.com/apache/arrow.git -b apache-arrow-${PYARROW_VERSION}
22+ cd arrow/cpp
23+ mkdir build && cd build
24+ cmake -DCMAKE_BUILD_TYPE=release \
25+ -DCMAKE_INSTALL_PREFIX=/usr/local \
26+ -DARROW_PYTHON=ON \
27+ -DARROW_BUILD_TESTS=OFF \
28+ -DARROW_JEMALLOC=ON \
29+ -DARROW_BUILD_STATIC=" OFF" \
30+ -DARROW_PARQUET=ON \
31+ ..
32+ make install -j ${MAX_JOBS:- $(nproc)}
33+ cd ../../python/
34+ uv pip install -v -r requirements-wheel-build.txt
35+ PYARROW_PARALLEL=${PYARROW_PARALLEL:- $(nproc)} \
36+ python setup.py build_ext \
37+ --build-type=release --bundle-arrow-cpp \
38+ bdist_wheel --dist-dir ${WHEEL_DIR}
39+
40+ cd ${CURDIR}
41+ rm -rf ${TEMP_BUILD_DIR}
42+ }
943
1044if [[ $( uname -m) == " ppc64le" ]]; then
1145 # install development packages
@@ -36,6 +70,10 @@ if [[ $(uname -m) == "ppc64le" ]]; then
3670 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH :/opt/OpenBLAS/lib/
3771 export PKG_CONFIG_PATH=$( find / -type d -name " pkgconfig" 2> /dev/null | tr ' \n' ' :' )
3872 export CMAKE_ARGS=" -DPython3_EXECUTABLE=python"
73+
74+ PYARROW_VERSION=$( grep -A1 ' "pyarrow"' pylock.toml | grep -Eo ' \b[0-9\.]+\b' )
75+ build_pyarrow ${PYARROW_VERSION}
76+ uv pip install ${WHEEL_DIR} /* .whl
3977else
4078 # only for mounting on non-ppc64le
4179 mkdir -p /root/OpenBLAS/
0 commit comments