Skip to content

Commit

Permalink
Bump the minimum Arrow requirement to 10.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ljishen authored Nov 8, 2022
1 parent d2a7f72 commit b2f73e2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ if(NOT BITAR_BUILD_ARROW)
""
CACHE PATH "Arrow library installation prefix")
endif()
set(arrow_minimum_required_version 8.0.1)
set(arrow_minimum_required_version 10.0.0)

set(IWYU_ROOT
"${MACHINE_OPTIONAL_DIR}"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ in either DPU mode or separated host mode.
- For Linux, glibc >= 2.7 (reported by `ldd --version`)
- GCC >= 9 (C++17 compliant compiler)
- [DPDK](https://github.com/DPDK/dpdk) >= v21.11 (can be installed via vcpkg)
- [Apache Arrow](https://github.com/apache/arrow) >= 8.0.1 (build automatically
- [Apache Arrow](https://github.com/apache/arrow) >= 10.0.0 (build automatically
if not found)

## Supported Hardware
Expand Down Expand Up @@ -99,13 +99,13 @@ $ ./build-$(uname -m)/apps/demo_app --in-memory --lcores 5@(0-7),6-7 \

- `BITAR_ARROW_GIT_TAG`: use the source at the git branch, tag or commit hash
from the Arrow repository for building when needed (default
`apache-arrow-9.0.0`)
`apache-arrow-10.0.0`)

- `BITAR_INSTALL_ARROW`: install the Arrow library as part of the cmake
installation process if Arrow is built by this project (default: `OFF`)

- Any
[Arrow supported CMake options](https://github.com/apache/arrow/blob/apache-arrow-9.0.0/cpp/cmake_modules/DefineOptions.cmake),
[Arrow supported CMake options](https://github.com/apache/arrow/blob/apache-arrow-10.0.0/cpp/cmake_modules/DefineOptions.cmake),
e.g., `ARROW_WITH_LZ4`, `ARROW_WITH_ZSTD`, and `ARROW_WITH_SNAPPY`.

## Known Issues
Expand Down
6 changes: 3 additions & 3 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ find_package(Arrow "${arrow_minimum_required_version}" REQUIRED)
target_link_system_libraries(demo_app PRIVATE Arrow::arrow Arrow::parquet)
target_compile_definitions(demo_app PRIVATE ARROW_NO_DEPRECATED_API)

if(NOT Arrow_IS_BUILT)
if(NOT Arrow_IS_BUILT AND Arrow_VERSION VERSION_LESS 10.0.0)
find_package(CURL REQUIRED CONFIG)
# The Linux package of Arrow are missing dependencies (will be fixed in Arrow
# 10.0.0): https://issues.apache.org/jira/browse/ARROW-17422
# The system-installed Arrow library misses the CURL dependency. Fixed in
# https://github.com/apache/arrow/commit/7a0ba80702ef63e63e346d2a9ca3137d8baca8bb
target_link_system_libraries(Arrow::arrow INTERFACE CURL::libcurl)
endif()
34 changes: 20 additions & 14 deletions cmake_modules/FindArrow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ if(NOT BITAR_BUILD_ARROW)
# Since the Parquet library depends on the Arrow library, finding the
# Parquet library will import the Arrow library as well.
#
# For Arrow < v10.0.0, `ParquetConfig.cmake` uses `find_dependency(Arrow)`
# to load the Arrow-provided `FindArrow.cmake` file. With the existing of
# the current file that has the same name in the CMAKE_MODULE_PATH, the
# lookup of the Arrow dependency becomes an infinite recursion. Therefore,
# we need to temporarily remove the current file from the module search
# path.
# https://github.com/apache/arrow/blob/apache-arrow-9.0.0/cpp/src/parquet/ParquetConfig.cmake.in
# `ParquetConfig.cmake` uses `find_dependency(Arrow)` to load the
# Arrow-provided `FindArrow.cmake` (was removed in
# https://github.com/apache/arrow/commit/93b63e8f3b4880927ccbd5522c967df79e926cda)
# in Arrow < v10.0.0 or `ArrowConfig.cmake` in Arrow >= v10.0.0. With the
# existing of the current file in the CMAKE_MODULE_PATH, the call of
# `find_dependency(Arrow)` will go back to the current file, causing an
# infinite loop. To solve this problem, we need to temporarily remove the
# current file from the module search path.
# https://github.com/apache/arrow/blob/apache-arrow-10.0.0/cpp/src/parquet/ParquetConfig.cmake.in
list(REMOVE_ITEM CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
find_package(Parquet QUIET CONFIG)
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
Expand All @@ -75,7 +77,7 @@ if(NOT BITAR_BUILD_ARROW)
# Loading the `ArrowConfig.cmake` file will automatically set this to `ON`
# even though the system may not have the parquet library installed. To be
# consistent with our configuration, we need to keep this to be `OFF` here.
# https://github.com/apache/arrow/blob/apache-arrow-9.0.0/cpp/src/arrow/ArrowConfig.cmake.in#L43
# https://github.com/apache/arrow/blob/apache-arrow-10.0.0/cpp/src/arrow/ArrowConfig.cmake.in#L42
set(ARROW_PARQUET
OFF
CACHE INTERNAL "Build the Parquet libraries")
Expand Down Expand Up @@ -120,7 +122,7 @@ else()
"Use the Arrow library from the git repository for building when needed"
)
set(BITAR_ARROW_GIT_TAG
"98943d90dacb0311fe0d7a17a8ef10762e1c0ef2"
"8a5aa6718295eaa3f336125eace4a343a65c922f"
CACHE
STRING
"Use the source at the git branch, tag or commit hash from the Arrow repository for building when needed"
Expand Down Expand Up @@ -287,7 +289,6 @@ find_package_handle_standard_args(
required_vars
VERSION_VAR version_var)
unset(required_vars)
unset(version_var)

if(TARGET arrow_static)
set(_arrow_library arrow_static)
Expand Down Expand Up @@ -317,10 +318,13 @@ foreach(_library_name ${_libraries})
"${_${_library_name}_include_dirs}")
unset(_${_library_name}_include_dirs)
else()
if(${_library_name} STREQUAL parquet)
# The Arrow-provided `ParquetConfig.cmake` will create the
# thrift::thrift target via `FindThrift.cmake`
# https://github.com/apache/arrow/blob/apache-arrow-9.0.0/cpp/cmake_modules/FindThrift.cmake#L28
if(${_library_name} STREQUAL parquet
AND TARGET parquet_static
AND version_var VERSION_LESS 10.0.0)
# The parquet_static target created by the Arrow-provided
# `ParquetConfig.cmake` depends on the thrift::thrift target. But they
# are not properly linked in Arrow < v10.0.0.
# https://issues.apache.org/jira/browse/ARROW-17394
target_link_libraries(Arrow::${_library_name} INTERFACE thrift::thrift)
endif()
endif()
Expand All @@ -329,3 +333,5 @@ foreach(_library_name ${_libraries})
endif()
endforeach()
unset(_libraries)

unset(version_var)

0 comments on commit b2f73e2

Please sign in to comment.