@@ -6,6 +6,40 @@ set -eoux pipefail
6
6
# It installs the required build-time dependencies for python wheels #
7
7
# OpenBlas is built from source (instead of distro provided) with recommended flags for performance #
8
8
# ####################################################################################################
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
+ }
9
43
10
44
if [[ $( uname -m) == " ppc64le" ]]; then
11
45
# install development packages
@@ -36,6 +70,10 @@ if [[ $(uname -m) == "ppc64le" ]]; then
36
70
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH :/opt/OpenBLAS/lib/
37
71
export PKG_CONFIG_PATH=$( find / -type d -name " pkgconfig" 2> /dev/null | tr ' \n' ' :' )
38
72
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
39
77
else
40
78
# only for mounting on non-ppc64le
41
79
mkdir -p /root/OpenBLAS/
0 commit comments