mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 09:05:47 +08:00
Fixes to build with CMake 3.2. Document what features require newer CMake in
the README. Add Docker task for CMake 3.2 from kszucs
This commit is contained in:
1 parent
2e8cfcac93
commit
9f33412c47
11 files changed
+70
-11
No files matched your search
+3
-1
@@ -16,6 +16,7 @@
|
||||
# under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
message(STATUS "Building using CMake version: ${CMAKE_VERSION}")
|
||||
|
||||
# Extract Arrow version number
|
||||
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../java/pom.xml" POM_XML)
|
||||
@@ -436,11 +437,12 @@ endif()
|
||||
############################################################
|
||||
|
||||
if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS)
|
||||
# Currently the compression tests require at least these libraries; bz2 and
|
||||
# zstd are optional. See ARROW-3984
|
||||
set(ARROW_WITH_BROTLI ON)
|
||||
set(ARROW_WITH_LZ4 ON)
|
||||
set(ARROW_WITH_SNAPPY ON)
|
||||
set(ARROW_WITH_ZLIB ON)
|
||||
set(ARROW_WITH_ZSTD ON)
|
||||
endif()
|
||||
|
||||
if(ARROW_BUILD_TESTS)
|
||||
|
||||
+3
-1
@@ -30,6 +30,7 @@ RUN apt-get update -y -q && \
|
||||
wget
|
||||
|
||||
# install conda and required packages
|
||||
ARG EXTRA_CONDA_PKGS
|
||||
ENV PATH=/opt/conda/bin:$PATH \
|
||||
CONDA_PREFIX=/opt/conda
|
||||
ADD ci/docker_install_conda.sh \
|
||||
@@ -39,7 +40,8 @@ ADD ci/docker_install_conda.sh \
|
||||
RUN arrow/ci/docker_install_conda.sh && \
|
||||
conda install -c conda-forge \
|
||||
--file arrow/ci/conda_env_cpp.yml \
|
||||
--file arrow/ci/conda_env_unix.yml && \
|
||||
--file arrow/ci/conda_env_unix.yml \
|
||||
$EXTRA_CONDA_PKGS && \
|
||||
conda clean --all
|
||||
|
||||
ENV CC=gcc \
|
||||
|
||||
+9
-1
@@ -30,7 +30,7 @@ in-source and out-of-source builds with the latter one being preferred.
|
||||
Building Arrow requires:
|
||||
|
||||
* A C++11-enabled compiler. On Linux, gcc 4.8 and higher should be sufficient.
|
||||
* CMake
|
||||
* CMake 3.2 or higher
|
||||
* Boost
|
||||
|
||||
On Ubuntu/Debian you can install the requirements with:
|
||||
@@ -459,6 +459,14 @@ both of these options would be used rarely. Current known uses-cases when they a
|
||||
|
||||
* Parameterized tests in google test.
|
||||
|
||||
## CMake version requirements
|
||||
|
||||
We support CMake 3.2 and higher. Some features require a newer version of CMake:
|
||||
|
||||
* Building the benchmarks requires 3.6 or higher
|
||||
* Building zstd from source requires 3.7 or higher
|
||||
* Building Gandiva JNI bindings requires 3.11 or higher
|
||||
|
||||
[1]: https://brew.sh/
|
||||
[2]: https://github.com/apache/arrow/blob/master/cpp/apidoc/Windows.md
|
||||
[3]: https://google.github.io/styleguide/cppguide.html
|
||||
|
||||
@@ -407,6 +407,13 @@ else()
|
||||
# disable autolinking in boost
|
||||
add_definitions(-DBOOST_ALL_NO_LIB)
|
||||
endif()
|
||||
|
||||
if (DEFINED ENV{BOOST_ROOT} OR DEFINED BOOST_ROOT)
|
||||
# In older versions of CMake (such as 3.2), the system paths for Boost will
|
||||
# be looked in first even if we set $BOOST_ROOT or pass -DBOOST_ROOT
|
||||
set(Boost_NO_SYSTEM_PATHS ON)
|
||||
endif()
|
||||
|
||||
if (ARROW_BOOST_USE_SHARED)
|
||||
# Find shared Boost libraries.
|
||||
set(Boost_USE_STATIC_LIBS OFF)
|
||||
@@ -629,8 +636,11 @@ if(ARROW_BUILD_TESTS OR ARROW_GANDIVA_BUILD_TESTS
|
||||
endif()
|
||||
|
||||
if(ARROW_BUILD_BENCHMARKS)
|
||||
|
||||
if("$ENV{GBENCHMARK_HOME}" STREQUAL "")
|
||||
if(CMAKE_VERSION VERSION_LESS 3.6)
|
||||
message(FATAL_ERROR "Building gbenchmark from source requires at least CMake 3.6")
|
||||
endif()
|
||||
|
||||
if(NOT MSVC)
|
||||
set(GBENCHMARK_CMAKE_CXX_FLAGS "-fPIC -std=c++11 ${EP_CXX_FLAGS}")
|
||||
endif()
|
||||
@@ -1095,6 +1105,11 @@ if (ARROW_WITH_ZSTD)
|
||||
"-DCMAKE_C_FLAGS=${EP_C_FLAGS}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.7)
|
||||
message(FATAL_ERROR "Building zstd using ExternalProject requires \
|
||||
at least CMake 3.7")
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(zstd_ep
|
||||
${EP_LOG_OPTIONS}
|
||||
CMAKE_ARGS ${ZSTD_CMAKE_ARGS}
|
||||
|
||||
@@ -448,17 +448,22 @@ TEST_P(CodecTest, StreamingRoundtrip) {
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(TestGZip, CodecTest, ::testing::Values(Compression::GZIP));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(TestZSTD, CodecTest, ::testing::Values(Compression::ZSTD));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(TestSnappy, CodecTest, ::testing::Values(Compression::SNAPPY));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(TestLZ4, CodecTest, ::testing::Values(Compression::LZ4));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(TestBrotli, CodecTest, ::testing::Values(Compression::BROTLI));
|
||||
|
||||
// bz2 requires a binary installation, there is no ExternalProject
|
||||
#if ARROW_WITH_BZ2
|
||||
INSTANTIATE_TEST_CASE_P(TestBZ2, CodecTest, ::testing::Values(Compression::BZ2));
|
||||
#endif
|
||||
|
||||
// The ExternalProject for zstd does not build on CMake < 3.7, so we do not
|
||||
// require it here
|
||||
#ifdef ARROW_WITH_ZSTD
|
||||
INSTANTIATE_TEST_CASE_P(TestZSTD, CodecTest, ::testing::Values(Compression::ZSTD));
|
||||
#endif
|
||||
|
||||
} // namespace util
|
||||
} // namespace arrow
|
||||
@@ -17,6 +17,10 @@
|
||||
|
||||
project(gandiva_jni)
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.11)
|
||||
message(FATAL_ERROR "Building the Gandiva JNI bindings requires CMake version >= 3.11")
|
||||
endif()
|
||||
|
||||
# Find JNI
|
||||
find_package(JNI REQUIRED)
|
||||
|
||||
|
||||
@@ -20,16 +20,12 @@ add_custom_target(plasma)
|
||||
# For the moment, Plasma is versioned like Arrow
|
||||
project(plasma VERSION "${ARROW_BASE_VERSION}")
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../python/cmake_modules")
|
||||
|
||||
find_package(PythonLibsNew REQUIRED)
|
||||
find_package(Threads)
|
||||
|
||||
# The SO version is also the ABI version
|
||||
set(PLASMA_SO_VERSION "${ARROW_SO_VERSION}")
|
||||
set(PLASMA_FULL_SO_VERSION "${ARROW_FULL_SO_VERSION}")
|
||||
|
||||
include_directories(SYSTEM ${PYTHON_INCLUDE_DIRS})
|
||||
include_directories("${FLATBUFFERS_INCLUDE_DIR}" "${CMAKE_CURRENT_LIST_DIR}/" "${CMAKE_CURRENT_LIST_DIR}/thirdparty/" "${CMAKE_CURRENT_LIST_DIR}/../")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200809L")
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ download_dependency() {
|
||||
|
||||
# --show-progress will not output to stdout, it is safe to pipe the result of
|
||||
# the script into eval.
|
||||
wget --quiet --show-progress --continue --output-document="${out}" "${url}"
|
||||
wget --quiet --continue --output-document="${out}" "${url}"
|
||||
}
|
||||
|
||||
main() {
|
||||
|
||||
Vendored
+1
@@ -61,6 +61,7 @@ DEPENDENCIES=(
|
||||
"ARROW_ORC_URL orc-${ORC_VERSION}.tar.gz https://github.com/apache/orc/archive/rel/release-${ORC_VERSION}.tar.gz"
|
||||
"ARROW_PROTOBUF_URL protobuf-${PROTOBUF_VERSION}.tar.gz https://github.com/google/protobuf/releases/download/${PROTOBUF_VERSION}/protobuf-all-${PROTOBUF_VERSION:1}.tar.gz"
|
||||
"ARROW_RAPIDJSON_URL rapidjson-${RAPIDJSON_VERSION}.tar.gz https://github.com/miloyip/rapidjson/archive/${RAPIDJSON_VERSION}.tar.gz"
|
||||
"ARROW_RE2_URL re2-${RE2_VERSION}.tar.gz https://github.com/google/re2/archive/${RE2_VERSION}.tar.gz"
|
||||
"ARROW_SNAPPY_URL snappy-${SNAPPY_VERSION}.tar.gz https://github.com/google/snappy/releases/download/${SNAPPY_VERSION}/snappy-${SNAPPY_VERSION}.tar.gz"
|
||||
"ARROW_THRIFT_URL thrift-${THRIFT_VERSION}.tar.gz http://archive.apache.org/dist/thrift/${THRIFT_VERSION}/thrift-${THRIFT_VERSION}.tar.gz"
|
||||
"ARROW_ZLIB_URL zlib-${ZLIB_VERSION}.tar.gz http://zlib.net/fossils/zlib-${ZLIB_VERSION}.tar.gz"
|
||||
|
||||
@@ -22,6 +22,7 @@ groups:
|
||||
- docker-rust
|
||||
- docker-cpp
|
||||
- docker-cpp-alpine
|
||||
- docker-cpp-cmake32
|
||||
- docker-c_glib
|
||||
- docker-go
|
||||
- docker-python-2.7
|
||||
@@ -45,6 +46,7 @@ groups:
|
||||
cpp-python:
|
||||
- docker-cpp
|
||||
- docker-cpp-alpine
|
||||
- docker-cpp-cmake32
|
||||
- docker-python-2.7
|
||||
- docker-python-2.7-alpine
|
||||
- docker-python-3.6
|
||||
@@ -87,6 +89,14 @@ tasks:
|
||||
- docker-compose build cpp-alpine
|
||||
- docker-compose run cpp-alpine
|
||||
|
||||
docker-cpp-cmake32:
|
||||
platform: linux
|
||||
template: docker-tests/travis.linux.yml
|
||||
params:
|
||||
commands:
|
||||
- docker-compose build cpp-cmake32
|
||||
- docker-compose run cpp-cmake32
|
||||
|
||||
docker-c_glib:
|
||||
platform: linux
|
||||
template: docker-tests/travis.linux.yml
|
||||
|
||||
@@ -57,6 +57,22 @@ services:
|
||||
PARQUET_TEST_DATA: /arrow/cpp/submodules/parquet-testing/data
|
||||
volumes: *ubuntu-volumes
|
||||
|
||||
cpp-cmake32:
|
||||
# Usage:
|
||||
# docker-compose build cpp-cmake32
|
||||
# docker-compose run cpp-cmake32
|
||||
image: arrow:cpp-cmake32
|
||||
shm_size: 2G
|
||||
build:
|
||||
context: .
|
||||
dockerfile: cpp/Dockerfile
|
||||
args:
|
||||
EXTRA_CONDA_PKGS: cmake=3.2
|
||||
environment:
|
||||
ARROW_ORC: "OFF"
|
||||
PARQUET_TEST_DATA: /arrow/cpp/submodules/parquet-testing/data
|
||||
volumes: *ubuntu-volumes
|
||||
|
||||
cpp-alpine:
|
||||
# Usage:
|
||||
# docker-compose build cpp-alpine
|
||||
|
||||
Reference in new issue
Block a user