Skip to content

Apache DataFusion SQL Query Engine

ARROW-9412: [C++] Add non-bundled dependencies to INTERFACE_LINK_LIBRARIES of static libarrow

Tobias Mayerb84bfcfabaf8
diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml
index 716824ec94..07cd4a9191 100644
--- a/.github/workflows/cpp.yml
+++ b/.github/workflows/cpp.yml
@@ -174,15 +174,10 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- - name: Build Docker image
+ - name: Run
run: |
cd cpp/examples/minimal_build
- docker build -t arrow_cpp_minimal .
- - name: Compile and run example
- run: |
- ARROW_ROOT=$PWD
- cd cpp/examples/minimal_build
- docker run -v $PWD:/io -v $ARROW_ROOT:/arrow arrow_cpp_minimal /io/run.sh
+ docker-compose run --rm minimal
macos:
name: AMD64 MacOS 10.15 C++
diff --git a/ci/docker/ubuntu-14.04-cpp.dockerfile b/ci/docker/ubuntu-14.04-cpp.dockerfile
index 116973e6c8..6335dcc46e 100644
--- a/ci/docker/ubuntu-14.04-cpp.dockerfile
+++ b/ci/docker/ubuntu-14.04-cpp.dockerfile
@@ -91,4 +91,4 @@ ENV ARROW_BUILD_TESTS=ON \
RE2_SOURCE=BUNDLED \
Thrift_SOURCE=BUNDLED \
utf8proc_SOURCE=BUNDLED \
- ZSTD_SOURCE=BUNDLED
+ zstd_SOURCE=BUNDLED
diff --git a/ci/scripts/PKGBUILD b/ci/scripts/PKGBUILD
index a813b2357f..df5f586044 100644
--- a/ci/scripts/PKGBUILD
+++ b/ci/scripts/PKGBUILD
@@ -90,15 +90,18 @@ build() {
-DARROW_HDFS=OFF \
-DARROW_JEMALLOC=OFF \
-DARROW_JSON=ON \
+ -DARROW_LZ4_USE_SHARED=OFF \
-DARROW_MIMALLOC=ON \
-DARROW_PACKAGE_PREFIX="${MINGW_PREFIX}" \
-DARROW_PARQUET=ON \
+ -DARROW_SNAPPY_USE_SHARED=OFF \
-DARROW_USE_GLOG=OFF \
-DARROW_WITH_LZ4=ON \
-DARROW_WITH_SNAPPY=ON \
-DARROW_WITH_UTF8PROC=OFF \
-DARROW_WITH_ZLIB=ON \
-DARROW_WITH_ZSTD=ON \
+ -DARROW_ZSTD_USE_SHARED=OFF \
-DARROW_CXXFLAGS="${CPPFLAGS}" \
-DCMAKE_BUILD_TYPE="release" \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
diff --git a/ci/scripts/cpp_build.sh b/ci/scripts/cpp_build.sh
index 2de6254aac..aebc02ed2c 100755
--- a/ci/scripts/cpp_build.sh
+++ b/ci/scripts/cpp_build.sh
@@ -125,7 +125,7 @@ cmake -G "${CMAKE_GENERATOR:-Ninja}" \
-DSnappy_SOURCE=${Snappy_SOURCE:-} \
-DThrift_SOURCE=${Thrift_SOURCE:-} \
-Dutf8proc_SOURCE=${utf8proc_SOURCE:-} \
- -DZSTD_SOURCE=${ZSTD_SOURCE:-} \
+ -Dzstd_SOURCE=${zstd_SOURCE:-} \
${CMAKE_ARGS} \
${source_dir}
diff --git a/dev/tasks/cpp-examples/github.linux.yml b/dev/tasks/cpp-examples/github.linux.yml
new file mode 100644
index 0000000000..717d3c4430
--- /dev/null
+++ b/dev/tasks/cpp-examples/github.linux.yml
@@ -0,0 +1,46 @@
+# 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.
+
+# NOTE: must set "Crossbow" as name to have the badge links working in the
+# github comment reports!
+name: Crossbow
+
+on:
+ push:
+ branches:
+ - "*-github-*"
+
+jobs:
+ test:
+ name: C++ Example
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Arrow
+ shell: bash
+ run: |
+ git clone --no-checkout {{ arrow.remote }} arrow
+ git -C arrow fetch -t {{ arrow.remote }} {{ arrow.branch }}
+ git -C arrow checkout FETCH_HEAD
+ git -C arrow submodule update --init --recursive
+ - name: Free Up Disk Space
+ shell: bash
+ run: arrow/ci/scripts/util_cleanup.sh
+ - name: Run
+ shell: bash
+ run: |
+ cd arrow/cpp/examples/{{ type }}
+ docker-compose run --rm {{ run }}
diff --git a/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/libarrow-dev.install b/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/libarrow-dev.install
index 443e70cf0c..549cecef38 100644
--- a/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/libarrow-dev.install
+++ b/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/libarrow-dev.install
@@ -3,6 +3,11 @@ usr/lib/*/cmake/arrow/ArrowConfig*.cmake
usr/lib/*/cmake/arrow/ArrowOptions.cmake
usr/lib/*/cmake/arrow/ArrowTargets*.cmake
usr/lib/*/cmake/arrow/FindArrow.cmake
+usr/lib/*/cmake/arrow/FindBrotli.cmake
+usr/lib/*/cmake/arrow/FindLz4.cmake
+usr/lib/*/cmake/arrow/FindSnappy.cmake
+usr/lib/*/cmake/arrow/Findutf8proc.cmake
+usr/lib/*/cmake/arrow/Findzstd.cmake
usr/lib/*/cmake/arrow/arrow-config.cmake
usr/lib/*/libarrow.a
usr/lib/*/libarrow.so
diff --git a/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/libgandiva-dev.install b/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/libgandiva-dev.install
index 26e7e76fb3..7dabb79d0d 100644
--- a/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/libgandiva-dev.install
+++ b/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/libgandiva-dev.install
@@ -2,6 +2,7 @@ usr/include/gandiva/
usr/lib/*/cmake/arrow/GandivaConfig*.cmake
usr/lib/*/cmake/arrow/GandivaTargets*.cmake
usr/lib/*/cmake/arrow/FindGandiva.cmake
+usr/lib/*/cmake/arrow/FindRE2.cmake
usr/lib/*/libgandiva.a
usr/lib/*/libgandiva.so
usr/lib/*/pkgconfig/gandiva.pc
diff --git a/dev/tasks/linux-packages/apache-arrow/debian/libarrow-dev.install b/dev/tasks/linux-packages/apache-arrow/debian/libarrow-dev.install
index 443e70cf0c..549cecef38 100644
--- a/dev/tasks/linux-packages/apache-arrow/debian/libarrow-dev.install
+++ b/dev/tasks/linux-packages/apache-arrow/debian/libarrow-dev.install
@@ -3,6 +3,11 @@ usr/lib/*/cmake/arrow/ArrowConfig*.cmake
usr/lib/*/cmake/arrow/ArrowOptions.cmake
usr/lib/*/cmake/arrow/ArrowTargets*.cmake
usr/lib/*/cmake/arrow/FindArrow.cmake
+usr/lib/*/cmake/arrow/FindBrotli.cmake
+usr/lib/*/cmake/arrow/FindLz4.cmake
+usr/lib/*/cmake/arrow/FindSnappy.cmake
+usr/lib/*/cmake/arrow/Findutf8proc.cmake
+usr/lib/*/cmake/arrow/Findzstd.cmake
usr/lib/*/cmake/arrow/arrow-config.cmake
usr/lib/*/libarrow.a
usr/lib/*/libarrow.so
diff --git a/dev/tasks/linux-packages/apache-arrow/debian/libgandiva-dev.install b/dev/tasks/linux-packages/apache-arrow/debian/libgandiva-dev.install
index 26e7e76fb3..7dabb79d0d 100644
--- a/dev/tasks/linux-packages/apache-arrow/debian/libgandiva-dev.install
+++ b/dev/tasks/linux-packages/apache-arrow/debian/libgandiva-dev.install
@@ -2,6 +2,7 @@ usr/include/gandiva/
usr/lib/*/cmake/arrow/GandivaConfig*.cmake
usr/lib/*/cmake/arrow/GandivaTargets*.cmake
usr/lib/*/cmake/arrow/FindGandiva.cmake
+usr/lib/*/cmake/arrow/FindRE2.cmake
usr/lib/*/libgandiva.a
usr/lib/*/libgandiva.so
usr/lib/*/pkgconfig/gandiva.pc
diff --git a/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in b/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
index 74248b3a33..6af80dab06 100644
--- a/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
+++ b/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
@@ -44,7 +44,9 @@
%define use_glib (%{_centos_ver} >= 7)
%define use_meson (%{_centos_ver} >= 8)
+%define have_brotli (%{_centos_ver} >= 7)
%define have_rapidjson (%{_centos_ver} == 7)
+%define have_re2 (%{_centos_ver} >= 8)
%define have_utf8proc (%{_centos_ver} == 7)
Name: @PACKAGE@
@@ -59,6 +61,8 @@ Source0: https://dist.apache.org/repos/dist/release/@PACKAGE@/@PACKAGE@-%{versio
BuildRequires: bison
%if %{_centos_ver} >= 7
BuildRequires: boost%{boost_version}-devel
+%endif
+%if %{have_brotli}
BuildRequires: brotli-devel
%endif
BuildRequires: bzip2-devel
@@ -79,7 +83,7 @@ BuildRequires: python%{python_version}-numpy
%if %{have_rapidjson}
BuildRequires: rapidjson-devel
%endif
-%if %{_centos_ver} >= 8
+%if %{have_re2}
BuildRequires: re2-devel
%endif
BuildRequires: snappy-devel
@@ -218,6 +222,8 @@ License: Apache-2.0
Requires: boost%{boost_version}-system
Requires: boost%{boost_version}-filesystem
Requires: boost%{boost_version}-regex
+%endif
+%if %{have_brotli}
Requires: brotli
%endif
%if %{_centos_ver} >= 7
@@ -226,7 +232,7 @@ Requires: glog
%endif
Requires: libzstd
Requires: lz4
-%if %{_centos_ver} >= 8
+%if %{have_re2}
Requires: re2
%endif
Requires: snappy
@@ -265,6 +271,15 @@ Libraries and header files for Apache Arrow C++.
%{_libdir}/cmake/arrow/ArrowOptions.cmake
%{_libdir}/cmake/arrow/ArrowTargets*.cmake
%{_libdir}/cmake/arrow/FindArrow.cmake
+%if %{have_brotli}
+%{_libdir}/cmake/arrow/FindBrotli.cmake
+%endif
+%{_libdir}/cmake/arrow/FindLz4.cmake
+%{_libdir}/cmake/arrow/FindSnappy.cmake
+%if %{have_utf8proc}
+%{_libdir}/cmake/arrow/Findutf8proc.cmake
+%endif
+%{_libdir}/cmake/arrow/Findzstd.cmake
%{_libdir}/cmake/arrow/arrow-config.cmake
%{_libdir}/libarrow.a
%{_libdir}/libarrow.so
@@ -374,6 +389,9 @@ Libraries and header files for Gandiva.
%{_libdir}/cmake/arrow/GandivaConfig*.cmake
%{_libdir}/cmake/arrow/GandivaTargets*.cmake
%{_libdir}/cmake/arrow/FindGandiva.cmake
+%if %{have_re2}
+%{_libdir}/cmake/arrow/FindRE2.cmake
+%endif
%{_libdir}/libgandiva.a
%{_libdir}/libgandiva.so
%{_libdir}/pkgconfig/gandiva.pc
diff --git a/dev/tasks/python-wheels/win-build.bat b/dev/tasks/python-wheels/win-build.bat
index 957d68d3d5..449834a836 100644
--- a/dev/tasks/python-wheels/win-build.bat
+++ b/dev/tasks/python-wheels/win-build.bat
@@ -65,12 +65,14 @@ cmake -G "%GENERATOR%" ^
-DARROW_DATASET=ON ^
-DARROW_FLIGHT=ON ^
-DARROW_GANDIVA=OFF ^
+ -DARROW_LZ4_USE_SHARED=OFF ^
-DARROW_MIMALLOC=ON ^
-DARROW_PARQUET=ON ^
-DARROW_PYTHON=ON ^
+ -DARROW_SNAPPY_USE_SHARED=OFF ^
-DARROW_VERBOSE_THIRDPARTY_BUILD=ON ^
-DBrotli_SOURCE=BUNDLED ^
- -DZSTD_SOURCE=BUNDLED ^
+ -Dzstd_SOURCE=BUNDLED ^
-Dutf8proc_SOURCE=BUNDLED ^
.. || exit /B
cmake --build . --target install --config Release || exit /B
diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml
index 3fc9ab17f3..a064a420a4 100644
--- a/dev/tasks/tasks.yml
+++ b/dev/tasks/tasks.yml
@@ -78,6 +78,12 @@ groups:
- test-*spark*
- test-*turbodbc*
+ example:
+ - example-*
+
+ example-cpp:
+ - example-*cpp*
+
verify-rc:
- verify-rc-*
@@ -109,6 +115,7 @@ groups:
- homebrew-r-autobrew
- nuget
- test-*
+ - example-*
- wheel-*
tasks:
@@ -1844,3 +1851,17 @@ tasks:
template: docker-tests/github.linux.yml
params:
run: conda-cpp-hiveserver2
+
+ example-cpp-minimal-build-static:
+ ci: github
+ template: cpp-examples/github.linux.yml
+ params:
+ type: minimal_build
+ run: static
+
+ example-cpp-minimal-build-static-system-dependency:
+ ci: github
+ template: cpp-examples/github.linux.yml
+ params:
+ type: minimal_build
+ run: static-system-dependency