Skip to content

Commit

Permalink
Correct static builds + static arrow (#15715)
Browse files Browse the repository at this point in the history
Correct the CMake logic in arrow so that we can properly build cudf + arrow statically

Fixes #15714

Authors:
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)
  - Jake Awe (https://github.com/AyodeAwe)

URL: #15715
  • Loading branch information
robertmaynard authored May 13, 2024
1 parent c42c418 commit 915c6be
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ci/configure_cpp_static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ rapids-dependency-file-generator \
python -m pip install -r "${REQUIREMENTS_FILE}"
pyenv rehash

cmake -S cpp -B build_static -GNinja -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF
cmake -S cpp -B build_static -GNinja -DBUILD_SHARED_LIBS=OFF -DCUDF_USE_ARROW_STATIC=ON -DBUILD_TESTS=OFF
15 changes: 14 additions & 1 deletion cpp/cmake/thirdparty/get_arrow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,20 @@ function(find_and_configure_arrow VERSION BUILD_STATIC ENABLE_S3 ENABLE_ORC ENAB
"
)
endif()

rapids_cmake_install_lib_dir(lib_dir)
if(TARGET arrow_static)
get_target_property(interface_libs arrow_static INTERFACE_LINK_LIBRARIES)
# The `arrow_static` library is leaking a dependency on the object libraries it was built with
# we need to remove this from the interface, since keeping them around would cause duplicate
# symbols and CMake export errors
if(interface_libs MATCHES "arrow_array" AND interface_libs MATCHES "arrow_compute")
string(REPLACE "BUILD_INTERFACE:" "BUILD_LOCAL_INTERFACE:" interface_libs
"${interface_libs}"
)
set_target_properties(arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES "${interface_libs}")
get_target_property(interface_libs arrow_static INTERFACE_LINK_LIBRARIES)
endif()
endif()
rapids_export(
BUILD Arrow
VERSION ${VERSION}
Expand Down

0 comments on commit 915c6be

Please sign in to comment.