Skip to content

Commit 2e46c05

Browse files
authored
GH-47945: [C++] Add support for Boost 1.89.0 and require Boost 1.69 or later (#47947)
### Rationale for this change Boost 1.89.0 removed backward compatibility CMake package for Boost.System. Boost.System is header-only since Boost 1.69. So CMake package for Boost.System isn't needed but it's provided for backward compatibility. CentOS 7 uses Boost 1.69. So we can drop support for Boost 1.68 or older. ### What changes are included in this PR? * Require Boost 1.69 or later. * Remove `system` from `COMPONENTS` because Boost.System is header-only. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * GitHub Issue: #47945 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Raúl Cumplido <[email protected]>
1 parent 430ad81 commit 2e46c05

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

ci/conda_env_cpp.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ azure-storage-blobs-cpp>=12.10.0
2222
azure-storage-common-cpp>=12.5.0
2323
azure-storage-files-datalake-cpp>=12.9.0
2424
benchmark>=1.6.0,!=1.8.4
25-
boost-cpp>=1.68.0
2625
brotli
2726
bzip2
2827
c-ares
@@ -32,6 +31,7 @@ glog
3231
gmock>=1.10.0
3332
google-cloud-cpp>=1.34.0
3433
gtest>=1.10.0
34+
libboost-devel
3535
libgrpc
3636
libprotobuf
3737
libutf8proc

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,18 +1191,24 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION
11911191
# GH-34094 Older versions of Boost use the deprecated std::unary_function in
11921192
# boost/container_hash/hash.hpp and support for that was removed in clang 16
11931193
set(ARROW_BOOST_REQUIRED_VERSION "1.81")
1194-
elseif(ARROW_BUILD_TESTS)
1195-
set(ARROW_BOOST_REQUIRED_VERSION "1.64")
11961194
else()
1197-
set(ARROW_BOOST_REQUIRED_VERSION "1.58")
1195+
# CentOS 7 uses Boost 1.69.
1196+
set(ARROW_BOOST_REQUIRED_VERSION "1.69")
11981197
endif()
11991198

12001199
set(Boost_USE_MULTITHREADED ON)
12011200
if(MSVC AND ARROW_USE_STATIC_CRT)
12021201
set(Boost_USE_STATIC_RUNTIME ON)
12031202
endif()
12041203
# CMake 3.25.0 has 1.80 and older versions.
1204+
#
1205+
# We can remove this once we require CMake 3.30.0 or later because we
1206+
# enable CMP0167 "The FindBoost module is removed."
1207+
# https://cmake.org/cmake/help/latest/policy/CMP0167.html with CMake
1208+
# 3.30.0 or later.
12051209
set(Boost_ADDITIONAL_VERSIONS
1210+
"1.89.0"
1211+
"1.89"
12061212
"1.88.0"
12071213
"1.88"
12081214
"1.87.0"
@@ -1273,7 +1279,7 @@ if(ARROW_USE_BOOST)
12731279
set(Boost_USE_STATIC_LIBS ON)
12741280
endif()
12751281
if(ARROW_BOOST_REQUIRE_LIBRARY)
1276-
set(ARROW_BOOST_COMPONENTS filesystem system)
1282+
set(ARROW_BOOST_COMPONENTS filesystem)
12771283
if(ARROW_FLIGHT_SQL_ODBC)
12781284
list(APPEND ARROW_BOOST_COMPONENTS locale)
12791285
endif()
@@ -1327,9 +1333,6 @@ if(ARROW_USE_BOOST)
13271333
if(TARGET Boost::filesystem)
13281334
target_link_libraries(arrow::Boost::process INTERFACE Boost::filesystem)
13291335
endif()
1330-
if(TARGET Boost::system)
1331-
target_link_libraries(arrow::Boost::process INTERFACE Boost::system)
1332-
endif()
13331336
if(TARGET Boost::headers)
13341337
target_link_libraries(arrow::Boost::process INTERFACE Boost::headers)
13351338
endif()

cpp/src/arrow/filesystem/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,11 @@ if(ARROW_S3)
132132
DEFINITIONS
133133
ARROW_S3_LIBPATH="$<TARGET_FILE:arrow_s3fs>"
134134
EXTRA_LINK_LIBS
135-
Boost::filesystem
136-
Boost::system)
135+
Boost::filesystem)
137136
target_compile_definitions(arrow-filesystem-test
138137
PUBLIC ARROW_S3_LIBPATH="$<TARGET_FILE:arrow_s3fs>")
139138
target_sources(arrow-filesystem-test PUBLIC s3fs_module_test.cc s3_test_util.cc)
140-
target_link_libraries(arrow-filesystem-test PUBLIC Boost::filesystem Boost::system)
139+
target_link_libraries(arrow-filesystem-test PUBLIC Boost::filesystem)
141140
endif()
142141
endif()
143142

0 commit comments

Comments
 (0)