Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ci/scripts/cpp_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,19 @@ if [ "${ARROW_USE_MESON:-OFF}" = "OFF" ] && \
cmake \
-S "${source_dir}/examples/minimal_build" \
-B "${build_dir}/examples/minimal_build" \
-DARROW_EXAMPLE_S3_STATIC_CHECK=ON \
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}"
cmake --build "${build_dir}/examples/minimal_build"
pushd "${source_dir}/examples/minimal_build"
# PATH= is for Windows.
PATH="${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}}/bin:${PATH}" \
"${build_dir}/examples/minimal_build/arrow-example"
# Test static linking with S3
s3_example="${build_dir}/examples/minimal_build/arrow-example-s3-static"
if [ -x "${s3_example}" ]; then
PATH="${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}}/bin:${PATH}" \
"${s3_example}"
fi
popd
fi

Expand Down
40 changes: 40 additions & 0 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,27 @@ macro(find_curl ARROW_CURL_PACKAGE_PREFIX)
endif()
endmacro()

# ----------------------------------------------------------------------
# pkg-config

# SDK libraries (on macOS) may be available without .pc files
macro(arrow_append_pc_system_library PC_PACKAGE PC_PREFIX FALLBACK)
find_package(PkgConfig QUIET)
if(PkgConfig_FOUND)
pkg_check_modules(${PC_PREFIX}
${PC_PACKAGE}
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
QUIET)
endif()
if(PkgConfig_FOUND AND ${PC_PREFIX}_FOUND)
string(APPEND ARROW_PC_REQUIRES_PRIVATE " ${PC_PACKAGE}")
else()
message(STATUS "No .pc for ${PC_PACKAGE}. Using ${FALLBACK} in arrow.pc")
string(APPEND ARROW_PC_LIBS_PRIVATE " ${FALLBACK}")
endif()
endmacro()

# ----------------------------------------------------------------------
# Snappy

Expand Down Expand Up @@ -4346,6 +4367,25 @@ if(ARROW_WITH_AZURE_SDK)
resolve_dependency(Azure REQUIRED_VERSION 1.10.2)
set(AZURE_SDK_LINK_LIBRARIES Azure::azure-storage-files-datalake
Azure::azure-storage-blobs Azure::azure-identity)
if(AZURE_SDK_VENDORED AND NOT WIN32)
find_curl(ARROW)
find_package(LibXml2 REQUIRED)
list(APPEND ARROW_SYSTEM_DEPENDENCIES LibXml2)
endif()
endif()

if(ARROW_BUILD_STATIC)
if((ARROW_GCS AND google_cloud_cpp_storage_SOURCE STREQUAL "BUNDLED")
OR (ARROW_AZURE
AND AZURE_SDK_VENDORED
AND NOT WIN32))
arrow_append_pc_system_library("libcurl" ARROW_CURL_PC "-lcurl")
endif()
if(ARROW_AZURE
AND AZURE_SDK_VENDORED
AND NOT WIN32)
arrow_append_pc_system_library("libxml-2.0" ARROW_LIBXML2_PC "-lxml2")
endif()
endif()

# ----------------------------------------------------------------------
Expand Down
18 changes: 18 additions & 0 deletions cpp/examples/minimal_build/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,21 @@ if(ARROW_LINK_SHARED)
else()
target_link_libraries(arrow-example PRIVATE Arrow::arrow_static)
endif()

option(ARROW_EXAMPLE_S3_STATIC_CHECK "Verify S3 and static linking" OFF)
# Check only when Arrow got built with S3 by ArrowOptions.cmake via find_package
if(ARROW_EXAMPLE_S3_STATIC_CHECK
AND ARROW_S3
AND TARGET Arrow::arrow_static)
find_package(ArrowS3 REQUIRED)
if(NOT TARGET ArrowS3::arrow_s3_static)
message(FATAL_ERROR "ArrowS3::arrow_s3_static not found")
endif()
add_executable(arrow-example-s3-static example.cc)
target_compile_definitions(arrow-example-s3-static
PRIVATE ARROW_EXAMPLE_S3_STATIC_CHECK)
target_link_libraries(arrow-example-s3-static PRIVATE ArrowS3::arrow_s3_static)
elseif(ARROW_EXAMPLE_S3_STATIC_CHECK)
message(STATUS "Skipping arrow-example-s3-static: "
"requires ARROW_S3 and Arrow::arrow_static")
endif()
9 changes: 9 additions & 0 deletions cpp/examples/minimal_build/example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
// under the License.

#include <arrow/csv/api.h>
#ifdef ARROW_EXAMPLE_S3_STATIC_CHECK
# include <arrow/filesystem/s3fs.h>
#endif
#include <arrow/io/api.h>
#include <arrow/ipc/api.h>
#include <arrow/pretty_print.h>
Expand Down Expand Up @@ -54,6 +57,12 @@ Status RunMain(int argc, char** argv) {
ARROW_RETURN_NOT_OK(batch_writer->WriteTable(*table));
ARROW_RETURN_NOT_OK(batch_writer->Close());

#ifdef ARROW_EXAMPLE_S3_STATIC_CHECK
std::cerr << "* Verify S3 initializes and finalizes" << std::endl;
ARROW_RETURN_NOT_OK(arrow::fs::EnsureS3Initialized());
ARROW_RETURN_NOT_OK(arrow::fs::EnsureS3Finalized());
#endif

return Status::OK();
}

Expand Down
12 changes: 12 additions & 0 deletions cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ set(ARROW_STATIC_INSTALL_INTERFACE_LIBS)
if(ARROW_GCS)
if(google_cloud_cpp_storage_SOURCE STREQUAL "SYSTEM")
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS google-cloud-cpp::storage)
elseif(google_cloud_cpp_storage_SOURCE STREQUAL "BUNDLED")
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl)
endif()
endif()

if(ARROW_AZURE)
if(Azure_SOURCE STREQUAL "SYSTEM")
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${AZURE_SDK_LINK_LIBRARIES})
elseif(Azure_SOURCE STREQUAL "BUNDLED")
if(NOT WIN32)
list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl LibXml2::LibXml2)
endif()
endif()
endif()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ RUN \
libssl-dev \
libthrift-dev \
libutf8proc-dev \
libxml2-dev \
libxxhash-dev \
libzstd-dev \
llvm-dev \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ RUN \
libssl-dev \
libthrift-dev \
libutf8proc-dev \
libxml2-dev \
libxxhash-dev \
libzstd-dev \
llvm-dev \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ RUN \
libssl-dev \
libthrift-dev \
libutf8proc-dev \
libxml2-dev \
libxxhash-dev \
libzstd-dev \
llvm-dev \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ RUN \
libssl-dev \
libthrift-dev \
libutf8proc-dev \
libxml2-dev \
libxxhash-dev \
libzstd-dev \
llvm-dev \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ RUN \
libssl-dev \
libthrift-dev \
libutf8proc-dev \
libxml2-dev \
libxxhash-dev \
libzstd-dev \
llvm-dev \
Expand Down
2 changes: 2 additions & 0 deletions dev/tasks/linux-packages/apache-arrow/debian/control.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Build-Depends:
libssl-dev,
libthrift-dev,
libutf8proc-dev,
libxml2-dev,
Comment thread
tadeja marked this conversation as resolved.
libxxhash-dev,
libzstd-dev,
meson,
Expand Down Expand Up @@ -185,6 +186,7 @@ Depends:
libsnappy-dev,
libssl-dev,
libutf8proc-dev,
libxml2-dev,
libxxhash-dev,
libzstd-dev,
nlohmann-json-dev | nlohmann-json3-dev,
Expand Down
1 change: 1 addition & 0 deletions dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ Requires: curl-devel
%if %{use_gcs} && !%{use_bundled_nlohmann_json}
Requires: json-devel
%endif
Requires: libxml2-devel
Comment thread
tadeja marked this conversation as resolved.
Requires: libzstd-devel
Requires: lz4-devel %{lz4_requirement}
Requires: openssl-devel
Expand Down
Loading