Skip to content

Apache DataFusion SQL Query Engine

ARROW-4959:[C++][Gandiva][Crossbow] Gandiva crossbow packaging changes.

Praveen127c920afd69
diff --git a/dev/tasks/gandiva-jars/README.md b/dev/tasks/gandiva-jars/README.md
new file mode 100644
index 0000000000..2f4c694d79
--- /dev/null
+++ b/dev/tasks/gandiva-jars/README.md
@@ -0,0 +1,29 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Updating manylinux for Gandiva Jar Build.
+
+Do the following to update arrow manylinux docker image for building Gandiva Jars
+
+- Install java in the manylinux image.
+- To do above, update Dockerfile-x86_64_base under python/manylinux1 to install java.
+- Please note only upto java7 is available in CentOS5, so install java7 in the base.
+- Export JAVA_HOME environment variable.
+- Then update build_boost.sh under python/manylinux1/scripts to build boost statically.
+
+Please look at https://github.com/praveenbingo/arrow/tree/buildGandivaDocker that already has these changes.
\ No newline at end of file
diff --git a/dev/tasks/gandiva-jars/build-cpp-linux.sh b/dev/tasks/gandiva-jars/build-cpp-linux.sh
new file mode 100755
index 0000000000..e1df5fc790
--- /dev/null
+++ b/dev/tasks/gandiva-jars/build-cpp-linux.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+source /multibuild/manylinux_utils.sh
+
+# Quit on failure
+set -e
+
+# Print commands for debugging
+set -x
+
+ARROW_BUILD_DIR=/tmp/arrow-build
+mkdir -p "${ARROW_BUILD_DIR}"
+pushd "${ARROW_BUILD_DIR}"
+
+cmake -DCMAKE_BUILD_TYPE=Release \
+ -DARROW_DEPENDENCY_SOURCE="SYSTEM" \
+ -DZLIB_ROOT=/usr/local \
+ -DCMAKE_INSTALL_PREFIX=/arrow-dist \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DARROW_BUILD_TESTS=ON \
+ -DARROW_BUILD_SHARED=ON \
+ -DARROW_BOOST_USE_SHARED=OFF \
+ -DARROW_GANDIVA_PC_CXX_FLAGS="-isystem;/opt/rh/devtoolset-2/root/usr/include/c++/4.8.2;-isystem;/opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/x86_64-CentOS-linux/" \
+ -DARROW_JEMALLOC=ON \
+ -DARROW_RPATH_ORIGIN=ON \
+ -DARROW_PYTHON=OFF \
+ -DARROW_PARQUET=OFF \
+ -DARROW_GANDIVA=ON \
+ -DARROW_GANDIVA_JAVA=ON \
+ -DARROW_GANDIVA_JAVA7=ON \
+ -DBoost_NAMESPACE=arrow_boost \
+ -Ddouble-conversion_SOURCE=BUNDLED \
+ -Dgflags_SOURCE=BUNDLED \
+ -DRapidJSON_SOURCE=BUNDLED \
+ -DRE2_SOURCE=BUNDLED \
+ -DARROW_BUILD_UTILITIES=OFF \
+ -DBoost_NAMESPACE=arrow_boost \
+ -DBOOST_ROOT=/arrow_boost_dist \
+ -GNinja /arrow/cpp
+ninja install
+ninja test
+popd
+
+
+# copy the library to distribution
+cp -L /arrow-dist/lib/libgandiva_jni.so /io/dist
+
diff --git a/dev/tasks/gandiva-jars/build-cpp.sh b/dev/tasks/gandiva-jars/build-cpp-osx.sh
similarity index 94%
rename from dev/tasks/gandiva-jars/build-cpp.sh
rename to dev/tasks/gandiva-jars/build-cpp-osx.sh
index b585b9d7ac..827294363e 100755
--- a/dev/tasks/gandiva-jars/build-cpp.sh
+++ b/dev/tasks/gandiva-jars/build-cpp-osx.sh
@@ -19,10 +19,10 @@
set -e
-source arrow/ci/travis_env_common.sh
+set -x
# Builds arrow + gandiva and tests the same.
-pushd arrow/cpp
+pushd cpp
mkdir build
pushd build
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release \
@@ -40,5 +40,7 @@ pushd arrow/cpp
cmake $CMAKE_FLAGS ..
make -j4
ctest
+
+ cp -L release/libgandiva_jni.dylib $TRAVIS_BUILD_DIR/dist
popd
popd
diff --git a/dev/tasks/gandiva-jars/build-java.sh b/dev/tasks/gandiva-jars/build-java.sh
index d099035a3e..bbbf74addd 100755
--- a/dev/tasks/gandiva-jars/build-java.sh
+++ b/dev/tasks/gandiva-jars/build-java.sh
@@ -19,11 +19,9 @@
set -e
-source arrow/ci/travis_env_common.sh
+CPP_BUILD_DIR=$TRAVIS_BUILD_DIR/dist/
-CPP_BUILD_DIR=$TRAVIS_BUILD_DIR/cpp/build/release
-
-pushd arrow/java
+pushd java
if [ $TRAVIS_OS_NAME == "linux" ]; then
ldd $CPP_BUILD_DIR/libgandiva_jni.so
fi
@@ -33,5 +31,5 @@ pushd arrow/java
# test only gandiva
mvn test -P gandiva -pl gandiva -Dgandiva.cpp.build.dir=$CPP_BUILD_DIR
# copy the jars to distribution folder
- find gandiva/target/ -name "*.jar" -not -name "*tests*" -exec cp {} ../../dist/ \;
+ find gandiva/target/ -name "*.jar" -not -name "*tests*" -exec cp {} $CPP_BUILD_DIR \;
popd
diff --git a/dev/tasks/gandiva-jars/travis.linux.yml b/dev/tasks/gandiva-jars/travis.linux.yml
index 7c5eb337b1..1e87e3efad 100644
--- a/dev/tasks/gandiva-jars/travis.linux.yml
+++ b/dev/tasks/gandiva-jars/travis.linux.yml
@@ -44,14 +44,14 @@ before_script:
- git clone -b {{ arrow.branch }} {{ arrow.remote }} arrow
- git -C arrow checkout {{ arrow.head }}
- export TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR/arrow
- - arrow/ci/travis_install_linux.sh
- - arrow/ci/travis_install_clang_tools.sh
- - arrow/ci/travis_install_toolchain.sh
+ -
script:
+ - cd $TRAVIS_BUILD_DIR
- mkdir -p dist
- - arrow/dev/tasks/gandiva-jars/build-cpp.sh || travis_terminate 1
- - arrow/dev/tasks/gandiva-jars/build-java.sh || travis_terminate 1
+ # please refer to README for steps to update this image
+ - docker run -v $PWD:/io -v $PWD:/arrow quay.io/praveenbingo/arrow:buildGandivaDocker /io/dev/tasks/gandiva-jars/build-cpp-linux.sh || travis_terminate 1
+ - dev/tasks/gandiva-jars/build-java.sh || travis_terminate 1
deploy:
provider: releases
diff --git a/dev/tasks/gandiva-jars/travis.osx.yml b/dev/tasks/gandiva-jars/travis.osx.yml
index b801725065..b3139f22da 100644
--- a/dev/tasks/gandiva-jars/travis.osx.yml
+++ b/dev/tasks/gandiva-jars/travis.osx.yml
@@ -36,12 +36,15 @@ before_script:
- git clone -b {{ arrow.branch }} {{ arrow.remote }} arrow
- git -C arrow checkout {{ arrow.head }}
- export TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR/arrow
- - arrow/ci/travis_install_toolchain.sh
+ - brew update
+ - brew upgrade cmake
+ - brew install bison flex llvm@7
script:
+ - cd arrow
- mkdir -p dist
- - arrow/dev/tasks/gandiva-jars/build-cpp.sh || travis_terminate 1
- - arrow/dev/tasks/gandiva-jars/build-java.sh || travis_terminate 1
+ - dev/tasks/gandiva-jars/build-cpp-osx.sh || travis_terminate 1
+ - dev/tasks/gandiva-jars/build-java.sh || travis_terminate 1
deploy:
provider: releases