This is an automated email from the ASF dual-hosted git repository.
wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new afc8c63 ARROW-3440: [Gandiva] fix readme for builds
afc8c63 is described below
commit afc8c6320658f03393c4cdfd8c0b03b39fe3b581
Author: Pindikura Ravindra <[email protected]>
AuthorDate: Sat Oct 13 17:37:07 2018 -0400
ARROW-3440: [Gandiva] fix readme for builds
- also use thirdy-party protobuf install for gandiva
Author: Pindikura Ravindra <[email protected]>
Closes #2743 from pravindra/arrow-3440 and squashes the following commits:
fbdad9dbf <Pindikura Ravindra> ARROW-3440: add desc for
gandiva.cpp.build.dir
2b1091feb <Pindikura Ravindra> ARROW-3440: fix typos and address review
3d032d832 <Pindikura Ravindra> ARROW-3440: trivial change to rebuild
744677dcc <Pindikura Ravindra> ARROW-3440: fix readme for builds
---
ci/travis_script_gandiva_cpp.sh | 4 +-
cpp/README.md | 37 +++++++++++-
cpp/cmake_modules/GandivaBuildUtils.cmake | 6 +-
cpp/cmake_modules/ThirdpartyToolchain.cmake | 3 +-
cpp/src/gandiva/README.md | 88 -----------------------------
cpp/src/gandiva/jni/CMakeLists.txt | 9 +--
java/README.md | 16 +++++-
7 files changed, 61 insertions(+), 102 deletions(-)
diff --git a/ci/travis_script_gandiva_cpp.sh b/ci/travis_script_gandiva_cpp.sh
index 3dbd993..4d0a9b7 100755
--- a/ci/travis_script_gandiva_cpp.sh
+++ b/ci/travis_script_gandiva_cpp.sh
@@ -23,10 +23,10 @@ source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh
pushd $CPP_BUILD_DIR
-PATH=$ARROW_BUILD_TYPE:$PATH ctest -j2 --output-on-failure -L unittest
+PATH=$ARROW_BUILD_TYPE:$PATH ctest -j2 --output-on-failure -L gandiva,unittest
# not running in parallel, since some of them are benchmarks
-PATH=$ARROW_BUILD_TYPE:$PATH ctest -VV -L integ
+PATH=$ARROW_BUILD_TYPE:$PATH ctest -VV -L gandiva,integ
popd
diff --git a/cpp/README.md b/cpp/README.md
index 33670d2..fcf9137 100644
--- a/cpp/README.md
+++ b/cpp/README.md
@@ -225,6 +225,41 @@ The optional arrow reader for the Apache ORC format (found
in the
This is currently not supported on windows. Note that this functionality is
still in Alpha stages, and subject to API changes without deprecation warnings.
+### Building and developing Gandiva (optional)
+
+The Gandiva library supports compiling and evaluating expressions on arrow
+data. It uses LLVM for doing just-in-time compilation of the expressions.
+
+In addition to the arrow dependencies, gandiva requires :
+* On linux, gcc 4.9 or higher C++11-enabled compiler.
+* LLVM
+
+On Ubuntu/Debian you can install these requirements with:
+
+```shell
+sudo apt-add-repository -y "deb http://llvm.org/apt/trusty/
llvm-toolchain-trusty-6.0 main"
+sudo apt-get update -qq
+sudo apt-get install llvm-6.0-dev
+```
+
+On macOS, you can use [Homebrew][1]:
+
+```shell
+brew install llvm@6
+```
+
+The optional `gandiva` libraries and tests can be built by passing
+`-DARROW_GANDIVA=on`.
+
+```shell
+cmake .. -DARROW_GANDIVA=on
+make
+ctest -L gandiva
+```
+
+This library is still in Alpha stages, and subject to API changes without
+deprecation warnings.
+
### API documentation
To generate the (html) API documentation, run the following command in the
apidoc
@@ -398,4 +433,4 @@ both of these options would be used rarely. Current known
uses-cases when they a
[2]: https://github.com/apache/arrow/blob/master/cpp/apidoc/Windows.md
[3]: https://google.github.io/styleguide/cppguide.html
[4]: https://github.com/include-what-you-use/include-what-you-use
-[5]: https://github.com/apache/arrow/blob/master/cpp/thirdparty/README.md
\ No newline at end of file
+[5]: https://github.com/apache/arrow/blob/master/cpp/thirdparty/README.md
diff --git a/cpp/cmake_modules/GandivaBuildUtils.cmake
b/cpp/cmake_modules/GandivaBuildUtils.cmake
index 8ef546b..b1d3ad7 100644
--- a/cpp/cmake_modules/GandivaBuildUtils.cmake
+++ b/cpp/cmake_modules/GandivaBuildUtils.cmake
@@ -94,7 +94,7 @@ function(add_gandiva_unit_test REL_TEST_NAME)
PRIVATE arrow_shared ${GANDIVA_TEST_LINK_LIBS} Boost::boost
)
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})
- set_property(TEST ${TEST_NAME} PROPERTY LABELS unittest ${TEST_NAME})
+ set_property(TEST ${TEST_NAME} PROPERTY LABELS gandiva,unittest ${TEST_NAME})
endfunction(add_gandiva_unit_test REL_TEST_NAME)
# Add a unittest executable for a precompiled file (used to generate IR)
@@ -109,7 +109,7 @@ function(add_precompiled_unit_test REL_TEST_NAME)
target_compile_definitions(${TEST_NAME} PRIVATE GANDIVA_UNIT_TEST=1)
target_compile_definitions(${TEST_NAME} PRIVATE -DGDV_HELPERS)
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})
- set_property(TEST ${TEST_NAME} PROPERTY LABELS unittest ${TEST_NAME})
+ set_property(TEST ${TEST_NAME} PROPERTY LABELS gandiva,unittest ${TEST_NAME})
endfunction(add_precompiled_unit_test REL_TEST_NAME)
# Add an integ executable, with its dependencies.
@@ -121,7 +121,7 @@ function(add_gandiva_integ_test REL_TEST_NAME GANDIVA_LIB)
target_link_libraries(${TEST_NAME}_${GANDIVA_LIB} PRIVATE ${GANDIVA_LIB}
${GANDIVA_TEST_LINK_LIBS})
add_test(NAME ${TEST_NAME}_${GANDIVA_LIB} COMMAND
${TEST_NAME}_${GANDIVA_LIB})
- set_property(TEST ${TEST_NAME}_${GANDIVA_LIB} PROPERTY LABELS integ
${TEST_NAME}_${GANDIVA_LIB})
+ set_property(TEST ${TEST_NAME}_${GANDIVA_LIB} PROPERTY LABELS gandiva,integ
${TEST_NAME}_${GANDIVA_LIB})
endfunction(add_gandiva_integ_test REL_TEST_NAME)
function(prevent_in_source_builds)
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 1e28185..1ce1547 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -1126,12 +1126,13 @@ if (ARROW_ORC OR ARROW_FLIGHT OR ARROW_GANDIVA)
set (PROTOBUF_HOME "${PROTOBUF_PREFIX}")
set (PROTOBUF_INCLUDE_DIR "${PROTOBUF_PREFIX}/include")
set (PROTOBUF_STATIC_LIB
"${PROTOBUF_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set (PROTOBUF_EXECUTABLE "${PROTOBUF_PREFIX}/bin/protoc")
ExternalProject_Add(protobuf_ep
CONFIGURE_COMMAND "./configure" "--disable-shared"
"--prefix=${PROTOBUF_PREFIX}" "CXXFLAGS=${EP_CXX_FLAGS}"
BUILD_IN_SOURCE 1
URL ${PROTOBUF_SOURCE_URL}
- BUILD_BYPRODUCTS "${PROTOBUF_STATIC_LIB}"
+ BUILD_BYPRODUCTS "${PROTOBUF_STATIC_LIB}" "${PROTOBUF_EXECUTABLE}"
${EP_LOG_OPTIONS})
set (PROTOBUF_VENDORED 1)
diff --git a/cpp/src/gandiva/README.md b/cpp/src/gandiva/README.md
deleted file mode 100644
index 4f091dc..0000000
--- a/cpp/src/gandiva/README.md
+++ /dev/null
@@ -1,88 +0,0 @@
-<!---
- 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.
--->
-
-# Gandiva C++
-
-## System setup
-
-Gandiva uses CMake as a build configuration system. Currently, it supports
-out-of-source builds only.
-
-Build Gandiva requires:
-
-* A C++11-enabled compiler. On Linux, gcc 4.8 and higher should be sufficient.
-* CMake
-* LLVM
-* Arrow
-* Boost
-* Protobuf
-* re2
-
-On macOS, you can use [Homebrew][1]:
-
-```shell
-brew install cmake llvm boost protobuf re2
-```
-
-To install arrow, follow the steps in the [arrow Readme][2].
-## Building Gandiva
-
-Debug build :
-
-```shell
-git clone https://github.com/apache/arrow.git
-cd cpp/src/gandiva
-mkdir debug
-cd debug
-cmake ..
-make
-ctest
-```
-
-Release build :
-
-```shell
-git clone https://github.com/apache/arrow.git
-cd cpp/src/gandiva
-mkdir release
-cd release
-cmake .. -DCMAKE_BUILD_TYPE=Release
-make
-ctest
-```
-
-## Validating code style
-
-We follow the [google cpp code style][3]. To validate compliance,
-
-```shell
-cd debug
-make stylecheck
-```
-
-## Fixing code style
-
-```shell
-cd debug
-make stylefix
-```
-
-[1]: https://brew.sh/
-[2]: https://github.com/apache/arrow/tree/master/cpp
-[3]: https://google.github.io/styleguide/cppguide.html
diff --git a/cpp/src/gandiva/jni/CMakeLists.txt
b/cpp/src/gandiva/jni/CMakeLists.txt
index 1ddec11..f77caae 100644
--- a/cpp/src/gandiva/jni/CMakeLists.txt
+++ b/cpp/src/gandiva/jni/CMakeLists.txt
@@ -17,10 +17,6 @@
project(gandiva_jni)
-# Find protobuf
-set(Protobuf_USE_STATIC_LIBS "ON")
-find_package(Protobuf REQUIRED)
-
# Find JNI
find_package(JNI REQUIRED)
@@ -35,7 +31,7 @@ get_filename_component(ABS_GANDIVA_PROTO
${CMAKE_SOURCE_DIR}/src/gandiva/proto/T
add_custom_command(
OUTPUT ${PROTO_OUTPUT_FILES}
COMMAND ${PROTOBUF_EXECUTABLE} --proto_path
${CMAKE_SOURCE_DIR}/src/gandiva/proto --cpp_out ${PROTO_OUTPUT_DIR}
${CMAKE_SOURCE_DIR}/src/gandiva/proto/Types.proto
- DEPENDS ${ABS_GANDIVA_PROTO}
+ DEPENDS ${ABS_GANDIVA_PROTO} protobuf
COMMENT "Running PROTO compiler on Types.proto"
VERBATIM
)
@@ -78,7 +74,8 @@ if (NOT APPLE)
set_target_properties(gandiva_jni PROPERTIES LINK_FLAGS
"-Wl,--version-script=${CMAKE_SOURCE_DIR}/src/gandiva/jni/symbols.map")
endif()
-# PROTOBUF is a private dependency i.e users of gandiva also will not have a
dependency on protobuf.
+# PROTOBUF is a private dependency i.e users of gandiva also will not have a
+# dependency on protobuf.
target_link_libraries(gandiva_jni
PRIVATE
${PROTOBUF_STATIC_LIB}
diff --git a/java/README.md b/java/README.md
index 3de8eb1..d4efe42 100644
--- a/java/README.md
+++ b/java/README.md
@@ -25,13 +25,26 @@ install:
- java 7 or later
- maven 3.3 or later
-## Building running tests
+## Building and running tests
```
cd java
mvn install
```
+## Building and running tests for gandiva (optional)
+
+[Gandiva cpp][2] must be built before this step. The cpp build directory must
+be provided as the value for argument gandiva.cpp.build.dir. eg.
+
+```
+cd java
+mvn install -P gandiva -pl gandiva -am -Dgandiva.cpp.build.dir=../../debug
+```
+
+This library is still in Alpha stages, and subject to API changes without
+deprecation warnings.
+
## Test Logging Configuration
When running tests, Arrow Java uses the Logback logger with SLF4J. By default,
@@ -51,3 +64,4 @@ mvn -Dlogback.configurationFile=file:`pwd`/dev/logback.xml
See [Logback Configuration][1] for more details.
[1]: https://logback.qos.ch/manual/configuration.html
+[2]: https://github.com/apache/arrow/blob/master/cpp/README.md