Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shrshi committed Feb 28, 2025
1 parent 0840baf commit ff7dda3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
5 changes: 3 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ include(cmake/thirdparty/get_zstd.cmake)
if(NOT BUILD_SHARED_LIBS)
include("${rapids-cmake-dir}/export/find_package_file.cmake")
list(APPEND METADATA_KINDS BUILD INSTALL)
list(APPEND dependencies KvikIO ZLIB nvcomp nanoarrow)
list(APPEND dependencies KvikIO ZLIB nvcomp nanoarrow libzstd_shared)

foreach(METADATA_KIND IN LISTS METADATA_KINDS)
foreach(dep IN LISTS dependencies)
Expand Down Expand Up @@ -876,6 +876,7 @@ target_include_directories(
PRIVATE "$<BUILD_INTERFACE:${CUDF_SOURCE_DIR}/src>"
"$<BUILD_INTERFACE:${nanoarrow_SOURCE_DIR}/src>"
"$<BUILD_INTERFACE:${FlatBuffers_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${ZSTD_INCLUDE_DIR}"
INTERFACE "$<INSTALL_INTERFACE:include>"
)

Expand Down Expand Up @@ -935,7 +936,7 @@ target_link_libraries(
cudf
PUBLIC CCCL::CCCL rapids_logger::rapids_logger rmm::rmm $<BUILD_LOCAL_INTERFACE:BS::thread_pool>
PRIVATE $<BUILD_LOCAL_INTERFACE:nvtx3::nvtx3-cpp> cuco::cuco ZLIB::ZLIB nvcomp::nvcomp
kvikio::kvikio nanoarrow zstd::zstd
kvikio::kvikio nanoarrow libzstd_shared
)

# Add Conda library, and include paths if specified
Expand Down
28 changes: 15 additions & 13 deletions cpp/cmake/thirdparty/get_zstd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,27 @@
# =============================================================================

# Use CPM to find or clone libzstd
function(find_and_configure_zstd VERSION)

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

rapids_cpm_find(
zstd ${VERSION}
GLOBAL_TARGETS zstd
zstd 1.5.7
GLOBAL_TARGETS libzstd_static
CPM_ARGS
GIT_REPOSITORY https://github.com/facebook/zstd.git
GIT_TAG v${VERSION}
GIT_SHALLOW TRUE ${_exclude_from_all}
GIT_TAG v1.5.7
GIT_SHALLOW FALSE SOURCE_SUBDIR build/cmake
OPTIONS "ZSTD_BUILD_STATIC OFF" "ZSTD_BUILD_SHARED ON" "ZSTD_BUILD_TESTS OFF"
"ZSTD_BUILD_PROGRAMS OFF"
)

rapids_export_find_package_root(BUILD zstd "${zstd_BINARY_DIR}" EXPORT_SET cudf-exports)
if(DEFINED zstd_SOURCE_DIR)
# otherwise find_package(zstd) will set this variable
set(ZSTD_INCLUDE_DIR
"${zstd_SOURCE_DIR}/lib"
PARENT_SCOPE
)
endif()

endfunction()

find_and_configure_zstd(1.5.7)
find_and_configure_zstd()

0 comments on commit ff7dda3

Please sign in to comment.