ARROW-3440: [Gandiva] fix readme for builds

- also use thirdy-party protobuf install for gandiva
This commit is contained in:
Pindikura Ravindra committed 2018-10-11 15:40:57 +05:30
1 parent 098bd463b8
commit 744677dccf
5 files changed
+49 -94

No files matched your search

+32 -1
View File
@@ -225,6 +225,37 @@ 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)
In addition to the arrow dependancies, 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-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 unitest
ctest -L integ
```
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 +429,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
[5]: https://github.com/apache/arrow/blob/master/cpp/thirdparty/README.md
+2 -1
View File
@@ -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)
-88
View File
@@ -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
+1 -3
View File
@@ -17,9 +17,7 @@
project(gandiva_jni)
# Find protobuf
set(Protobuf_USE_STATIC_LIBS "ON")
find_package(Protobuf REQUIRED)
# Find JNI
find_package(JNI REQUIRED)
@@ -35,7 +33,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
)
+14 -1
View File
@@ -25,13 +25,25 @@ 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.
```
cd java
mvn install -P gandiva -pl gandiva -am
```
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 +63,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