Skip to content

Commit

Permalink
Do not exclude nanoarrow and flatbuffers from installation if statica…
Browse files Browse the repository at this point in the history
…lly linked (#17322)

Had an issue crop up in spark-rapids-jni where we statically link arrow and the build started to fail due to change #17308.

Authors:
  - Mike Wilson (https://github.com/hyperbolic2346)

Approvers:
  - Gera Shegalov (https://github.com/gerashegalov)
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Bradley Dice (https://github.com/bdice)
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)

URL: #17322
hyperbolic2346 authored Nov 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 66c5a2d commit 927ae9c
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions cpp/cmake/thirdparty/get_flatbuffers.cmake
Original file line number Diff line number Diff line change
@@ -15,14 +15,19 @@
# Use CPM to find or clone flatbuffers
function(find_and_configure_flatbuffers VERSION)

if(NOT BUILD_SHARED_LIBS)
set(_exclude_from_all EXCLUDE_FROM_ALL FALSE)
else()
set(_exclude_from_all EXCLUDE_FROM_ALL TRUE)
endif()

rapids_cpm_find(
flatbuffers ${VERSION}
GLOBAL_TARGETS flatbuffers
CPM_ARGS
GIT_REPOSITORY https://github.com/google/flatbuffers.git
GIT_TAG v${VERSION}
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL TRUE
GIT_SHALLOW TRUE ${_exclude_from_all}
)

rapids_export_find_package_root(
9 changes: 7 additions & 2 deletions cpp/cmake/thirdparty/get_nanoarrow.cmake
Original file line number Diff line number Diff line change
@@ -19,14 +19,19 @@ function(find_and_configure_nanoarrow)
set(cudf_patch_dir "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/patches")
rapids_cpm_package_override("${cudf_patch_dir}/nanoarrow_override.json")

if(NOT BUILD_SHARED_LIBS)
set(_exclude_from_all EXCLUDE_FROM_ALL FALSE)
else()
set(_exclude_from_all EXCLUDE_FROM_ALL TRUE)
endif()

# Currently we need to always build nanoarrow so we don't pickup a previous installed version
set(CPM_DOWNLOAD_nanoarrow ON)
rapids_cpm_find(
nanoarrow 0.6.0.dev
GLOBAL_TARGETS nanoarrow
CPM_ARGS
OPTIONS "BUILD_SHARED_LIBS OFF" "NANOARROW_NAMESPACE cudf"
EXCLUDE_FROM_ALL TRUE
OPTIONS "BUILD_SHARED_LIBS OFF" "NANOARROW_NAMESPACE cudf" ${_exclude_from_all}
)
set_target_properties(nanoarrow PROPERTIES POSITION_INDEPENDENT_CODE ON)
rapids_export_find_package_root(BUILD nanoarrow "${nanoarrow_BINARY_DIR}" EXPORT_SET cudf-exports)

0 comments on commit 927ae9c

Please sign in to comment.