Skip to content

Commit

Permalink
Merge pull request oap-project#135 from zhouyuan/wip_arrow_build_2
Browse files Browse the repository at this point in the history
[Gluten-133] Fixes arrow building w/ build_arrow=OFF
  • Loading branch information
weiting-chen authored Apr 25, 2022
2 parents 94bd659 + 7226e34 commit e202b64
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ jobs:
sudo apt-get install google-mock
- name: Install OAP optimized Arrow (C++ libs)
run: |
bash tools/build_arrow.sh
mvn clean package -DskipTests -Dcheckstyle.skip -Dbuild_cpp=ON -Dbuild_gazelle_cpp=ON -Dbuild_arrow=OFF -Darrow_root=/tmp/arrow_install.7
bash tools/build_arrow.sh --build_arrow=ON
mvn clean package -DskipTests -Dcheckstyle.skip -Dbuild_cpp=ON -Dbuild_gazelle_cpp=ON -Darrow_root=/tmp/arrow_install.7
- name: Run unit tests
run: |
cd cpp/
Expand Down
70 changes: 66 additions & 4 deletions tools/build_arrow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,68 @@
set -eu

NPROC=$(nproc)
rm -rf arrow
rm -rf /tmp/arrow_install.7
git clone https://github.com/oap-project/arrow.git -b arrow-7.0.0-oap
cd arrow

TESTS=OFF
BUILD_ARROW=OFF
STATIC_ARROW=OFF
ARROW_ROOT=/usr/local

for arg in "$@"
do
case $arg in
-t=*|--tests=*)
TESTS=("${arg#*=}")
shift # Remove argument name from processing
;;
-a=*|--build_arrow=*)
BUILD_ARROW=("${arg#*=}")
shift # Remove argument name from processing
;;
-s=*|--static_arrow=*)
STATIC_ARROW=("${arg#*=}")
shift # Remove argument name from processing
;;
-ar=*|--arrow_root=*)
ARROW_ROOT=("${arg#*=}")
shift # Remove argument name from processing
;;
*)
OTHER_ARGUMENTS+=("$1")
shift # Remove generic argument from processing
;;
esac
done

echo "CMAKE Arguments:"
echo "TESTS=${TESTS}"
echo "BUILD_ARROW=${BUILD_ARROW}"
echo "STATIC_ARROW=${STATIC_ARROW}"
echo "ARROW_ROOT=${ARROW_ROOT}"

CURRENT_DIR=$(cd "$(dirname "$BASH_SOURCE")"; pwd)
echo $CURRENT_DIR

cd ${CURRENT_DIR}
if [ -d build ]; then
rm -r build
fi

if [ $BUILD_ARROW == "ON" ]; then
echo "Building Arrow from Source ..."
mkdir build
cd build
ARROW_PREFIX="${CURRENT_DIR}/build" # Use build directory as ARROW_PREFIX
ARROW_SOURCE_DIR="${ARROW_PREFIX}/arrow_ep"
ARROW_INSTALL_DIR="${ARROW_PREFIX}/arrow_install"

echo "ARROW_PREFIX=${ARROW_PREFIX}"
echo "ARROW_SOURCE_DIR=${ARROW_SOURCE_DIR}"
echo "ARROW_INSTALL_DIR=${ARROW_INSTALL_DIR}"
mkdir -p $ARROW_SOURCE_DIR
mkdir -p $ARROW_INSTALL_DIR
git clone https://github.com/oap-project/arrow.git -b arrow-7.0.0-oap $ARROW_SOURCE_DIR
pushd $ARROW_SOURCE_DIR

cmake -DARROW_BUILD_STATIC=OFF \
-DARROW_BUILD_SHARED=ON \
-DARROW_COMPUTE=ON \
Expand Down Expand Up @@ -46,3 +104,7 @@ make install
cd java
mvn clean install -P arrow-jni -pl dataset,gandiva -am -Darrow.cpp.build.dir=/tmp/arrow_install.7/lib -DskipTests -Dcheckstyle.skip
echo "Finish to build Arrow from Source !!!"
else
echo "Use ARROW_ROOT as Arrow Library Path"
echo "ARROW_ROOT=${ARROW_ROOT}"
fi
46 changes: 0 additions & 46 deletions tools/gitdiff_AdaptiveSparkPlanExec.patch

This file was deleted.

0 comments on commit e202b64

Please sign in to comment.