[arrow] Update to 10.0.0 (#27687)

* [arrow] Update Apache Arrow to 10.0.0

* Update versions

* Simplify and make more robust

* Use vcpkg_check_features()

* Use lower case for CMake package name

* Update version
This commit is contained in:
Sutou Kouhei 2022-11-12 07:36:32 +09:00 committed by GitHub
parent 299b1e17df
commit 59b58fc56d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 168 additions and 378 deletions

28
ports/arrow/brotli.patch Normal file
View File

@ -0,0 +1,28 @@
diff --git a/cpp/cmake_modules/FindBrotli.cmake b/cpp/cmake_modules/FindBrotli.cmake
index 4053b79ca7..bdca85fab4 100644
--- a/cpp/cmake_modules/FindBrotli.cmake
+++ b/cpp/cmake_modules/FindBrotli.cmake
@@ -21,6 +21,23 @@ if(Brotli_FOUND)
return()
endif()
+if(ARROW_PACAKGE_KIND STREQUAL "vcpkg")
+ set(find_package_args "")
+ if(Brotli_FIND_VERSION)
+ list(APPEND find_package_args ${Brotli_FIND_VERSION})
+ endif()
+ if(Brotli_FIND_QUIETLY)
+ list(APPEND find_package_args QUIET)
+ endif()
+ find_package(Brotli NAMES unofficial-brotli ${find_package_args})
+ if(Brotli_FOUND)
+ add_library(Brotli::brotlicommon ALIAS unofficial::brotli::brotlicommon)
+ add_library(Brotli::brotlienc ALIAS unofficial::brotli::brotlienc)
+ add_library(Brotli::brotlidec ALIAS unofficial::brotli::brotlidec)
+ return()
+ endif()
+endif()
+
if(ARROW_BROTLI_USE_SHARED)
set(BROTLI_COMMON_LIB_NAMES
brotlicommon

View File

@ -1,61 +0,0 @@
diff --git a/cpp/src/arrow/gpu/cuda_context.h b/cpp/src/arrow/gpu/cuda_context.h
index 00bcf94c8..0115ed19a 100644
--- a/cpp/src/arrow/gpu/cuda_context.h
+++ b/cpp/src/arrow/gpu/cuda_context.h
@@ -76,7 +76,7 @@ class ARROW_EXPORT CudaDeviceManager {
static std::unique_ptr<CudaDeviceManager> instance_;
class Impl;
- std::unique_ptr<Impl> impl_;
+ std::shared_ptr<Impl> impl_;
friend class CudaContext;
friend class CudaDevice;
@@ -146,7 +146,7 @@ class ARROW_EXPORT CudaDevice : public Device {
/// \endcond
explicit CudaDevice(Impl);
- std::unique_ptr<Impl> impl_;
+ std::shared_ptr<Impl> impl_;
};
/// \brief Return whether a device instance is a CudaDevice
@@ -297,7 +297,7 @@ class ARROW_EXPORT CudaContext : public std::enable_shared_from_this<CudaContext
uintptr_t dst, uintptr_t src, int64_t nbytes);
class Impl;
- std::unique_ptr<Impl> impl_;
+ std::shared_ptr<Impl> impl_;
friend class CudaBuffer;
friend class CudaBufferReader;
diff --git a/cpp/src/arrow/gpu/cuda_internal.h b/cpp/src/arrow/gpu/cuda_internal.h
index 25eb6e06c..d70873634 100644
--- a/cpp/src/arrow/gpu/cuda_internal.h
+++ b/cpp/src/arrow/gpu/cuda_internal.h
@@ -33,6 +33,7 @@ namespace internal {
std::string CudaErrorDescription(CUresult err);
+ARROW_EXPORT
Status StatusFromCuda(CUresult res, const char* function_name = nullptr);
#define CU_RETURN_NOT_OK(FUNC_NAME, STMT) \
diff --git a/cpp/src/arrow/gpu/cuda_memory.h b/cpp/src/arrow/gpu/cuda_memory.h
index 4efd38894..18c23a507 100644
--- a/cpp/src/arrow/gpu/cuda_memory.h
+++ b/cpp/src/arrow/gpu/cuda_memory.h
@@ -250,10 +250,12 @@ Result<std::shared_ptr<CudaHostBuffer>> AllocateCudaHostBuffer(int device_number
const int64_t size);
/// Low-level: get a device address through which the CPU data be accessed.
+ARROW_EXPORT
Result<uintptr_t> GetDeviceAddress(const uint8_t* cpu_data,
const std::shared_ptr<CudaContext>& ctx);
/// Low-level: get a CPU address through which the device data be accessed.
+ARROW_EXPORT
Result<uint8_t*> GetHostAddress(uintptr_t device_ptr);
} // namespace cuda

View File

@ -1,121 +0,0 @@
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index bca86d4c1..52f87aa97 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -737,7 +737,7 @@ endif()
if(ARROW_WITH_BROTLI)
# Order is important for static linking
- set(ARROW_BROTLI_LIBS Brotli::brotlienc Brotli::brotlidec Brotli::brotlicommon)
+ set(ARROW_BROTLI_LIBS unofficial::brotli::brotlienc unofficial::brotli::brotlidec unofficial::brotli::brotlicommon)
list(APPEND ARROW_LINK_LIBS ${ARROW_BROTLI_LIBS})
list(APPEND ARROW_STATIC_LINK_LIBS ${ARROW_BROTLI_LIBS})
if(Brotli_SOURCE STREQUAL "SYSTEM")
@@ -825,10 +825,10 @@ if(ARROW_WITH_OPENTELEMETRY)
endif()
if(ARROW_WITH_UTF8PROC)
- list(APPEND ARROW_LINK_LIBS utf8proc::utf8proc)
- list(APPEND ARROW_STATIC_LINK_LIBS utf8proc::utf8proc)
+ list(APPEND ARROW_LINK_LIBS utf8proc)
+ list(APPEND ARROW_STATIC_LINK_LIBS utf8proc)
if(utf8proc_SOURCE STREQUAL "SYSTEM")
- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS utf8proc::utf8proc)
+ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS utf8proc)
endif()
endif()
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 5d1da18b7..9c5adf47d 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -53,7 +53,7 @@ set(ARROW_THIRDPARTY_DEPENDENCIES
AWSSDK
benchmark
Boost
- Brotli
+ unofficial-brotli
BZip2
c-ares
gflags
@@ -74,7 +74,7 @@ set(ARROW_THIRDPARTY_DEPENDENCIES
Substrait
Thrift
ucx
- utf8proc
+ unofficial-utf8proc
xsimd
ZLIB
zstd)
@@ -152,6 +152,7 @@ foreach(DEPENDENCY ${ARROW_THIRDPARTY_DEPENDENCIES})
endforeach()
macro(build_dependency DEPENDENCY_NAME)
+ message(FATAL_ERROR "dependencies should never be built in vcpkg")
if("${DEPENDENCY_NAME}" STREQUAL "AWSSDK")
build_awssdk()
elseif("${DEPENDENCY_NAME}" STREQUAL "benchmark")
@@ -239,7 +240,7 @@ macro(resolve_dependency DEPENDENCY_NAME)
endif()
if(ARG_HAVE_ALT)
- set(PACKAGE_NAME "${DEPENDENCY_NAME}Alt")
+ set(PACKAGE_NAME "${DEPENDENCY_NAME}")
else()
set(PACKAGE_NAME ${DEPENDENCY_NAME})
endif()
@@ -1138,8 +1139,23 @@ if(ARROW_WITH_SNAPPY)
TRUE
PC_PACKAGE_NAMES
snappy)
+ set(Snappy_TARGET "Snappy::snappy")
if(${Snappy_SOURCE} STREQUAL "SYSTEM" AND NOT snappy_PC_FOUND)
+ get_target_property(SNAPPY_IMPLIB_DEBUG Snappy::snappy IMPORTED_IMPLIB_DEBUG)
+ get_target_property(SNAPPY_LIB_DEBUG Snappy::snappy IMPORTED_LOCATION_DEBUG)
+ get_target_property(SNAPPY_IMPLIB_RELEASE Snappy::snappy IMPORTED_IMPLIB_RELEASE)
+ get_target_property(SNAPPY_LIB_RELEASE Snappy::snappy IMPORTED_LOCATION_RELEASE)
+ if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" AND SNAPPY_IMPLIB_DEBUG)
+ set(SNAPPY_LIB "${SNAPPY_IMPLIB_DEBUG}")
+ elseif(CMAKE_BUILD_TYPE STREQUAL "DEBUG" AND SNAPPY_LIB_DEBUG)
+ set(SNAPPY_LIB "${SNAPPY_LIB_DEBUG}")
+ elseif(CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND SNAPPY_IMPLIB_RELEASE)
+ set(SNAPPY_LIB "${SNAPPY_IMPLIB_RELEASE}")
+ elseif(CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND SNAPPY_LIB_RELEASE)
+ set(SNAPPY_LIB "${SNAPPY_LIB_RELEASE}")
+ else()
get_target_property(SNAPPY_TYPE ${Snappy_TARGET} TYPE)
+ endif()
if(NOT SNAPPY_TYPE STREQUAL "INTERFACE_LIBRARY")
get_target_property(SNAPPY_LIB ${Snappy_TARGET}
IMPORTED_LOCATION_${UPPERCASE_BUILD_TYPE})
@@ -1214,7 +1230,8 @@ macro(build_brotli)
endmacro()
if(ARROW_WITH_BROTLI)
- resolve_dependency(Brotli PC_PACKAGE_NAMES libbrotlidec libbrotlienc)
+ set(Brotli_SOURCE SYSTEM)
+ resolve_dependency(unofficial-brotli USE_CONFIG TRUE PC_PACKAGE_NAMES libbrotlidec libbrotlienc)
endif()
if(PARQUET_REQUIRE_ENCRYPTION AND NOT ARROW_PARQUET)
@@ -1646,7 +1663,8 @@ if(ARROW_WITH_PROTOBUF)
${ARROW_PROTOBUF_REQUIRED_VERSION}
PC_PACKAGE_NAMES
protobuf)
-
+ get_target_property(PROTOBUF_INCLUDE_DIR protobuf::libprotobuf
+ INTERFACE_INCLUDE_DIRECTORIES)
if(NOT Protobuf_USE_STATIC_LIBS AND MSVC_TOOLCHAIN)
add_definitions(-DPROTOBUF_USE_DLLS)
endif()
@@ -2599,9 +2617,7 @@ macro(build_utf8proc)
endmacro()
if(ARROW_WITH_UTF8PROC)
- resolve_dependency(utf8proc
- REQUIRED_VERSION
- "2.2.0"
+ resolve_dependency(unofficial-utf8proc
PC_PACKAGE_NAMES
libutf8proc)
add_definitions(-DARROW_WITH_UTF8PROC)

View File

@ -1,89 +1,63 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO apache/arrow
REF apache-arrow-9.0.0
SHA512 1191793dd56471fb2b402afbe9b31cde4c5126785243e538e42ba95ccd31d523121f07b144461c99a4b7449e611aa5998bd0de95e8e4b0e3c80397499fe746f0
HEAD_REF master
PATCHES
cuda-ptr.patch
msvc-static-name.patch
fix-ThirdPartyToolchain.patch
static-link-libs.patch # https://github.com/apache/arrow/pull/13707 & pull/13863
vcpkg_download_distfile(
ARCHIVE_PATH
URLS "https://www.apache.org/dyn/closer.lua?action=download&filename=arrow/arrow-${VERSION}/apache-arrow-${VERSION}.tar.gz"
FILENAME apache-arrow-${VERSION}.tar.gz
SHA512 0856cfda98af8ae75d7011b4b2cb7305592dc16edeb27be8a845ee762cd1c4484997634e9bfe3fdc2a359fcfe0cbe036e0747ee0ea49677979920b95d1b4ced3
)
file(REMOVE "${SOURCE_PATH}/cpp/cmake_modules/Findzstd.cmake"
"${SOURCE_PATH}/cpp/cmake_modules/FindBrotli.cmake"
"${SOURCE_PATH}/cpp/cmake_modules/Find-c-aresAlt.cmake"
"${SOURCE_PATH}/cpp/cmake_modules/FindLz4.cmake"
"${SOURCE_PATH}/cpp/cmake_modules/FindSnappy.cmake"
"${SOURCE_PATH}/cpp/cmake_modules/FindThrift.cmake"
"${SOURCE_PATH}/cpp/cmake_modules/FindGLOG.cmake"
"${SOURCE_PATH}/cpp/cmake_modules/Findutf8proc.cmake"
"${SOURCE_PATH}/cpp/cmake_modules/FindRapidJSONAlt.cmake"
"${SOURCE_PATH}/cpp/cmake_modules/FindgRPCAlt.cmake"
"${SOURCE_PATH}/cpp/cmake_modules/FindgflagsAlt.cmake"
vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE ${ARCHIVE_PATH}
PATCHES
brotli.patch
msvc-static-name.patch
processor-type.patch
thrift.patch
utf8proc.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
csv ARROW_CSV
cuda ARROW_CUDA
dataset ARROW_DATASET
filesystem ARROW_FILESYSTEM
flight ARROW_FLIGHT
jemalloc ARROW_JEMALLOC
json ARROW_JSON
mimalloc ARROW_MIMALLOC
orc ARROW_ORC
parquet ARROW_PARQUET
parquet PARQUET_REQUIRE_ENCRYPTION
plasma ARROW_PLASMA
s3 ARROW_S3
cuda ARROW_CUDA
)
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
list(APPEND FEATURE_OPTIONS "-DARROW_USE_NATIVE_INT128=OFF")
endif()
if("jemalloc" IN_LIST FEATURES)
set(MALLOC_OPTIONS -DARROW_JEMALLOC=ON)
else()
set(MALLOC_OPTIONS -DARROW_JEMALLOC=OFF)
endif()
if("mimalloc" IN_LIST FEATURES)
set(MALLOC_OPTIONS ${MALLOC_OPTIONS} -DARROW_MIMALLOC=ON)
else()
set(MALLOC_OPTIONS ${MALLOC_OPTIONS} -DARROW_MIMALLOC=OFF)
endif()
string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "dynamic" ARROW_BUILD_SHARED)
string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "static" ARROW_BUILD_STATIC)
string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "dynamic" ARROW_DEPENDENCY_USE_SHARED)
if(VCPKG_TARGET_IS_WINDOWS)
set(THRIFT_USE_SHARED OFF)
else()
set(THRIFT_USE_SHARED ${ARROW_DEPENDENCY_USE_SHARED})
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/cpp"
OPTIONS
${FEATURE_OPTIONS}
${MALLOC_OPTIONS}
${S3_OPTIONS}
-DCMAKE_SYSTEM_PROCESSOR=${VCPKG_TARGET_ARCHITECTURE}
-DARROW_BUILD_SHARED=${ARROW_BUILD_SHARED}
-DARROW_BUILD_STATIC=${ARROW_BUILD_STATIC}
-DARROW_BUILD_TESTS=OFF
-DARROW_DEPENDENCY_SOURCE=SYSTEM
-DARROW_DEPENDENCY_USE_SHARED=${ARROW_DEPENDENCY_USE_SHARED}
-DARROW_THRIFT_USE_SHARED=${THRIFT_USE_SHARED}
-DBUILD_WARNING_LEVEL=PRODUCTION
-DARROW_PACKAGE_KIND=vcpkg
-DARROW_WITH_BROTLI=ON
-DARROW_WITH_BZ2=ON
-DARROW_WITH_LZ4=ON
-DARROW_WITH_SNAPPY=ON
-DARROW_WITH_ZLIB=ON
-DARROW_WITH_ZSTD=ON
-DBUILD_WARNING_LEVEL=PRODUCTION
-DCMAKE_SYSTEM_PROCESSOR=${VCPKG_TARGET_ARCHITECTURE}
-DZSTD_MSVC_LIB_PREFIX=
MAYBE_UNUSED_VARIABLES
ZSTD_MSVC_LIB_PREFIX
@ -98,31 +72,31 @@ if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/arrow_static.lib")
message(FATAL_ERROR "Installed lib file should be named 'arrow.lib' via patching the upstream build.")
endif()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/arrow)
if("parquet" IN_LIST FEATURES)
vcpkg_cmake_config_fixup(
PACKAGE_NAME parquet
CONFIG_PATH lib/cmake/Parquet
DO_NOT_DELETE_PARENT_CONFIG_PATH
)
endif()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Arrow)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
if("parquet" IN_LIST FEATURES)
file(GLOB PARQUET_FILES "${CURRENT_PACKAGES_DIR}/share/${PORT}/Parquet*")
file(COPY ${PARQUET_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/share/parquet")
file(REMOVE_RECURSE ${PARQUET_FILES})
file(RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/FindParquet.cmake" "${CURRENT_PACKAGES_DIR}/share/parquet/FindParquet.cmake")
file(READ "${CMAKE_CURRENT_LIST_DIR}/usage-parquet" usage-parquet)
file(APPEND "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "${usage-parquet}")
else()
file(REMOVE "${CURRENT_PACKAGES_DIR}/share/${PORT}/FindParquet.cmake")
endif()
if("example" IN_LIST FEATURES)
file(INSTALL "${SOURCE_PATH}/cpp/examples/minimal_build/" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/example")
endif()
if ("plasma" IN_LIST FEATURES)
if("plasma" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES plasma-store-server AUTO_CLEAN)
endif ()
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}" @ONLY)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt" "${SOURCE_PATH}/NOTICE.txt")

View File

@ -0,0 +1,13 @@
diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake
index cef4eb0b16..51ef979a02 100644
--- a/cpp/cmake_modules/SetupCxxFlags.cmake
+++ b/cpp/cmake_modules/SetupCxxFlags.cmake
@@ -24,7 +24,7 @@ include(CheckCXXSourceCompiles)
message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}")
if(NOT DEFINED ARROW_CPU_FLAG)
- if(CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64|X86|x86|i[3456]86")
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64|X86|x86|i[3456]86|x64")
set(ARROW_CPU_FLAG "x86")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64")
set(ARROW_CPU_FLAG "armv8")

View File

@ -1,127 +0,0 @@
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 93dd1297b..6b04f7d46 100644
--- a/cpp/src/arrow/CMakeLists.txt
+++ b/cpp/src/arrow/CMakeLists.txt
@@ -581,6 +581,7 @@ add_arrow_lib(arrow
${ARROW_SHARED_PRIVATE_LINK_LIBS}
STATIC_LINK_LIBS
${ARROW_STATIC_LINK_LIBS}
+ STATIC_INSTALL_INTERFACE_LIBS
${ARROW_STATIC_INSTALL_INTERFACE_LIBS}
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS})
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 9e732db80afb..f0c3f30ef3d8 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -822,6 +822,17 @@ if(ARROW_WITH_OPENTELEMETRY)
opentelemetry-cpp::trace
opentelemetry-cpp::ostream_span_exporter
opentelemetry-cpp::otlp_http_exporter)
+ if(opentelemetry_SOURCE STREQUAL "SYSTEM")
+ list(APPEND
+ ARROW_STATIC_INSTALL_INTERFACE_LIBS
+ opentelemetry-cpp::trace
+ opentelemetry-cpp::ostream_span_exporter
+ opentelemetry-cpp::otlp_http_exporter)
+ endif()
+ if(Protobuf_SOURCE STREQUAL "SYSTEM")
+ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS ${ARROW_PROTOBUF_LIBPROTOBUF})
+ endif()
+ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl)
endif()
if(ARROW_WITH_UTF8PROC)
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index ad8351f9cc6e..5c1dd9d34d12 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -1083,6 +1083,7 @@ endif()
macro(find_curl)
if(NOT TARGET CURL::libcurl)
find_package(CURL REQUIRED)
+ list(APPEND ARROW_SYSTEM_DEPENDENCIES CURL)
if(NOT TARGET CURL::libcurl)
# For CMake 3.11 or older
add_library(CURL::libcurl UNKNOWN IMPORTED)
@@ -4540,11 +4541,11 @@ macro(build_opentelemetry)
foreach(_OPENTELEMETRY_LIB ${_OPENTELEMETRY_LIBS})
add_dependencies(opentelemetry-cpp::${_OPENTELEMETRY_LIB} opentelemetry_ep)
+ list(APPEND ARROW_BUNDLED_STATIC_LIBS opentelemetry-cpp::${_OPENTELEMETRY_LIB})
endforeach()
# Work around https://gitlab.kitware.com/cmake/cmake/issues/15052
file(MAKE_DIRECTORY ${OPENTELEMETRY_INCLUDE_DIR})
-
endmacro()
if(ARROW_WITH_OPENTELEMETRY)
diff --git a/cpp/examples/parquet/parquet_arrow/CMakeLists.txt b/cpp/examples/parquet/parquet_arrow/CMakeLists.txt
index 32f980060c95..c89751731575 100644
--- a/cpp/examples/parquet/parquet_arrow/CMakeLists.txt
+++ b/cpp/examples/parquet/parquet_arrow/CMakeLists.txt
@@ -24,7 +24,7 @@ include(ExternalProject)
include(FindPkgConfig)
include(GNUInstallDirs)
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules")
+option(PARQUET_LINK_SHARED "Link to the Parquet shared library" ON)
# This ensures that things like gnu++11 get passed correctly
if(NOT DEFINED CMAKE_CXX_STANDARD)
@@ -39,4 +39,8 @@ find_package(Arrow REQUIRED)
find_package(Parquet REQUIRED)
add_executable(parquet-arrow-example reader_writer.cc)
-target_link_libraries(parquet-arrow-example parquet_shared arrow_shared)
+if(PARQUET_LINK_SHARED)
+ target_link_libraries(parquet-arrow-example parquet_shared)
+else()
+ target_link_libraries(parquet-arrow-example parquet_static)
+endif()
diff --git a/cpp/src/parquet/CMakeLists.txt b/cpp/src/parquet/CMakeLists.txt
index 542fa5bc083b..caed26173428 100644
--- a/cpp/src/parquet/CMakeLists.txt
+++ b/cpp/src/parquet/CMakeLists.txt
@@ -106,9 +106,11 @@ endfunction()
if(ARROW_BUILD_STATIC)
set(PARQUET_STATIC_LINK_LIBS arrow_static ${ARROW_STATIC_LINK_LIBS})
+ set(PARQUET_STATIC_INTERFACE_INSTALL_LIBS arrow_static)
set(ARROW_LIBRARIES_FOR_STATIC_TESTS arrow_testing_static arrow_static
${ARROW_STATIC_LINK_LIBS})
else()
+ set(PARQUET_STATIC_INTERFACE_INSTALL_LIBS)
set(ARROW_LIBRARIES_FOR_STATIC_TESTS arrow_testing_shared arrow_shared)
endif()
@@ -218,8 +220,9 @@ if(NOT PARQUET_MINIMAL_DEPENDENCY)
# Link publicly with parquet_static (because internal users need to
# transitively link all dependencies)
- set(PARQUET_STATIC_LINK_LIBS ${PARQUET_STATIC_LINK_LIBS} thrift::thrift)
-endif(NOT PARQUET_MINIMAL_DEPENDENCY)
+ list(APPEND PARQUET_STATIC_LINK_LIBS thrift::thrift)
+ list(APPEND PARQUET_STATIC_INTERFACE_INSTALL_LIBS thrift::thrift)
+endif()
if(CXX_LINKER_SUPPORTS_VERSION_SCRIPT)
set(PARQUET_SHARED_LINK_FLAGS
@@ -243,8 +246,12 @@ add_arrow_lib(parquet
${PARQUET_SHARED_LINK_LIBS}
SHARED_PRIVATE_LINK_LIBS
${PARQUET_SHARED_PRIVATE_LINK_LIBS}
+ SHARED_INSTALL_INTERFACE_LIBS
+ arrow_shared
STATIC_LINK_LIBS
- ${PARQUET_STATIC_LINK_LIBS})
+ ${PARQUET_STATIC_LINK_LIBS}
+ STATIC_INSTALL_INTERFACE_LIBS
+ ${PARQUET_STATIC_INTERFACE_INSTALL_LIBS})
if(WIN32 AND NOT (ARROW_TEST_LINKAGE STREQUAL "static"))
add_library(parquet_test_support STATIC

62
ports/arrow/thrift.patch Normal file
View File

@ -0,0 +1,62 @@
diff --git a/cpp/cmake_modules/FindThrift.cmake b/cpp/cmake_modules/FindThriftAlt.cmake
similarity index 91%
rename from cpp/cmake_modules/FindThrift.cmake
rename to cpp/cmake_modules/FindThriftAlt.cmake
index 2f20a5cb59..e317e2c7c4 100644
--- a/cpp/cmake_modules/FindThrift.cmake
+++ b/cpp/cmake_modules/FindThriftAlt.cmake
@@ -28,7 +28,23 @@
# thrift::thrift, a library target to use Thrift
# thrift::compiler, a executable target to use Thrift compiler
+if(ThriftAlt_FOUND)
+ return()
+endif()
+
+set(find_package_args "")
+if(ThriftAlt_FIND_VERSION)
+ list(APPEND find_package_args ${ThriftAlt_FIND_VERSION})
+endif()
+if(ThriftAlt_FIND_QUIETLY)
+ list(APPEND find_package_args QUIET)
+endif()
+find_package(Thrift ${find_package_args})
if(Thrift_FOUND)
+ set(ThriftAlt_FOUND TRUE)
+ add_executable(thrift::compiler IMPORTED)
+ set_target_properties(thrift::compiler PROPERTIES IMPORTED_LOCATION
+ "${THRIFT_COMPILER}")
return()
endif()
@@ -133,12 +149,12 @@ else()
endif()
find_package_handle_standard_args(
- Thrift
+ ThriftAlt
REQUIRED_VARS THRIFT_LIB THRIFT_INCLUDE_DIR
VERSION_VAR Thrift_VERSION
HANDLE_COMPONENTS)
-if(Thrift_FOUND)
+if(ThriftAlt_FOUND)
if(ARROW_THRIFT_USE_SHARED)
add_library(thrift::thrift SHARED IMPORTED)
else()
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index b7cd31f3d7..72b8cfe286 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -1510,8 +1510,10 @@ macro(build_thrift)
endmacro()
if(ARROW_WITH_THRIFT)
- # Thrift c++ code generated by 0.13 requires 0.11 or greater
+ # Thrift C++ code generated by 0.13 requires 0.11 or greater
resolve_dependency(Thrift
+ HAVE_ALT
+ TRUE
REQUIRED_VERSION
0.11.0
PC_PACKAGE_NAMES

View File

@ -1,4 +1,4 @@
The package arrow provides CMake targets:
find_package(Arrow CONFIG REQUIRED)
target_link_libraries(main PRIVATE ${ARROW_LIBRARIES})
target_link_libraries(main PRIVATE "$<IF:$<BOOL:${ARROW_BUILD_STATIC}>,Arrow::arrow_static,Arrow::arrow_shared>")

View File

@ -1,3 +1,3 @@
find_package(Parquet CONFIG REQUIRED)
target_link_libraries(main PRIVATE ${PARQUET_LIBRARIES})
target_link_libraries(main PRIVATE "$<IF:$<BOOL:${ARROW_BUILD_STATIC}>,Parquet::parquet_static,Parquet::parquet_shared>")

View File

@ -0,0 +1,26 @@
diff --git a/cpp/cmake_modules/Findutf8proc.cmake b/cpp/cmake_modules/Findutf8proc.cmake
index 2f0f59a02c..f5382a8f21 100644
--- a/cpp/cmake_modules/Findutf8proc.cmake
+++ b/cpp/cmake_modules/Findutf8proc.cmake
@@ -19,6 +19,21 @@ if(utf8proc_FOUND)
return()
endif()
+if(ARROW_PACAKGE_KIND STREQUAL "vcpkg")
+ set(find_package_args "")
+ if(utf8proc_FIND_VERSION)
+ list(APPEND find_package_args ${utf8proc_FIND_VERSION})
+ endif()
+ if(utf8proc_FIND_QUIETLY)
+ list(APPEND find_package_args QUIET)
+ endif()
+ find_package(utf8proc NAMES unofficial-utf8proc ${find_package_args})
+ if(utf8proc_FOUND)
+ add_library(utf8proc::utf8proc ALIAS utf8proc)
+ return()
+ endif()
+endif()
+
function(extract_utf8proc_version)
if(utf8proc_INCLUDE_DIR)
file(READ "${utf8proc_INCLUDE_DIR}/utf8proc.h" UTF8PROC_H_CONTENT)

View File

@ -1,9 +0,0 @@
_find_package(${ARGS})
if(TARGET arrow_static)
list(APPEND ARROW_LIBRARIES arrow_static)
list(APPEND PARQUET_LIBRARIES parquet_static)
elseif (TARGET arrow_shared)
list(APPEND ARROW_LIBRARIES arrow_shared)
list(APPEND PARQUET_LIBRARIES parquet_shared)
endif()

View File

@ -1,6 +1,6 @@
{
"name": "arrow",
"version": "9.0.0",
"version": "10.0.0",
"description": "Cross-language development platform for in-memory analytics",
"homepage": "https://arrow.apache.org",
"license": "Apache-2.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ab325846893f2dc3382b7b403bf195645ab93a39",
"version": "10.0.0",
"port-version": 0
},
{
"git-tree": "757fb3dc2404c152b9628f324087a761070406c4",
"version": "9.0.0",

View File

@ -189,7 +189,7 @@
"port-version": 2
},
"arrow": {
"baseline": "9.0.0",
"baseline": "10.0.0",
"port-version": 0
},
"ashes": {