ray/thirdparty/scripts/build_parquet.sh
Yuhong Guo e3badb9b09 Fix that parquet and arrow will build every time. (#2405)
* Fix the bug that parquet and arrow will build every time.

* Update build_arrow.sh

* Update build_arrow.sh
2018-07-16 22:56:14 -07:00

72 lines
1.9 KiB
Bash
Executable file

#!/bin/bash
set -x
# Cause the script to exit if a single command fails.
set -e
unamestr="$(uname)"
TP_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)/../
PARQUET_HOME=$TP_DIR/pkg/arrow/cpp/build/cpp-install
OPENSSL_DIR=/usr/local/opt/openssl
BISON_DIR=/usr/local/opt/bison/bin
TARGET_COMMIT_ID=0875e43010af485e1c0b506d77d7e0edc80c66cc
build_parquet() {
echo "Building Parquet"
if [ "$unamestr" == "Darwin" ]; then
OPENSSL_ROOT_DIR=$OPENSSL_DIR \
PATH="$BISON_DIR:$PATH" \
BOOST_ROOT=$TP_DIR/pkg/boost \
ARROW_HOME=$TP_DIR/pkg/arrow/cpp/build/cpp-install \
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PARQUET_HOME \
-DPARQUET_BUILD_BENCHMARKS=off \
-DPARQUET_BUILD_EXECUTABLES=off \
-DPARQUET_BUILD_TESTS=off \
.
OPENSSL_ROOT_DIR=$OPENSSL_DIR \
PATH="$BISON_DIR:$PATH" \
make -j4
OPENSSL_ROOT_DIR=$OPENSSL_DIR \
PATH="$BISON_DIR:$PATH" \
make install
else
BOOST_ROOT=$TP_DIR/pkg/boost \
ARROW_HOME=$TP_DIR/pkg/arrow/cpp/build/cpp-install \
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PARQUET_HOME \
-DPARQUET_BUILD_BENCHMARKS=off \
-DPARQUET_BUILD_EXECUTABLES=off \
-DPARQUET_BUILD_TESTS=off \
.
PARQUET_HOME=$TP_DIR/pkg/arrow/cpp/build/cpp-install \
BOOST_ROOT=$TP_DIR/pkg/boost \
make -j4
make install
fi
}
if [ ! -d $TP_DIR/build/parquet-cpp ]; then
git clone https://github.com/apache/parquet-cpp.git "$TP_DIR/build/parquet-cpp"
pushd $TP_DIR/build/parquet-cpp
git fetch origin master
git checkout $TARGET_COMMIT_ID
build_parquet
popd
else
pushd $TP_DIR/build/parquet-cpp
if [[ "$TARGET_COMMIT_ID" != `git rev-parse HEAD` ]]; then
# TARGET_COMMIT_ID may change to later commit.
echo "Commit ID mismatches."
git fetch origin master
git checkout $TARGET_COMMIT_ID
build_parquet
fi
popd
fi