From bd87bab7136f36c351875f1d0b64cbe895ba4240 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 15 Oct 2025 14:29:49 +0800 Subject: [PATCH] cmake/BuildArrow: Use system xsimd when available MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Arrow requires xsimd >= 9.0.1 according to arrow/cpp/thirdparty/versions.txt. Previously, we unconditionally used the bundled xsimd version. This change attempts to find a system xsimd package and only falls back to the bundled version if the system package is not found or has an insufficient version. This allows systems with libxsimd-dev >= 9.0.1 installed to use the system package, reducing build time and dependencies. Distribution availability: - Ubuntu Noble (24.04): 12.1.1 (✓ sufficient) - Ubuntu Jammy (22.04): 7.6.0 (✗ insufficient, will use bundled) - Debian Trixie (13): 13.2.0 (✓ sufficient) Signed-off-by: Kefu Chai --- cmake/modules/BuildArrow.cmake | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cmake/modules/BuildArrow.cmake b/cmake/modules/BuildArrow.cmake index 0ee1d85b49f..29553b4c6c6 100644 --- a/cmake/modules/BuildArrow.cmake +++ b/cmake/modules/BuildArrow.cmake @@ -69,9 +69,16 @@ function(build_arrow) list(APPEND arrow_DEPENDS Boost) endif() - # since Arrow 15.0.0 needs xsimd>=8.1.0 and since Ubuntu Jammy - # Jellyfish only provides 7.6.0, we'll have arrow build it as source - list(APPEND arrow_CMAKE_ARGS -Dxsimd_SOURCE=BUNDLED) + # Arrow requires xsimd >= 9.0.1 (see arrow/cpp/thirdparty/versions.txt) + # Try to find system xsimd and only use bundled version if not found or insufficient + find_package(xsimd 9.0.1 QUIET) + if(NOT xsimd_FOUND) + message(STATUS "System xsimd >= 9.0.1 not found, using bundled version for Arrow") + list(APPEND arrow_CMAKE_ARGS -Dxsimd_SOURCE=BUNDLED) + else() + message(STATUS "Using system xsimd ${xsimd_VERSION} for Arrow") + list(APPEND arrow_CMAKE_ARGS -Dxsimd_SOURCE=SYSTEM) + endif() # cmake doesn't properly handle arguments containing ";", such as # CMAKE_PREFIX_PATH, for which reason we'll have to use some other separator. -- 2.39.5