Skip to content

Commit

Permalink
added dependency to cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
shrshi committed Feb 27, 2025
1 parent 79d0b75 commit 0840baf
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ include(cmake/thirdparty/get_kvikio.cmake)
include(cmake/thirdparty/get_nanoarrow.cmake)
# find thread_pool
include(cmake/thirdparty/get_thread_pool.cmake)
# find zstd
include(cmake/thirdparty/get_zstd.cmake)

# Workaround until https://github.com/rapidsai/rapids-cmake/issues/176 is resolved
if(NOT BUILD_SHARED_LIBS)
Expand Down Expand Up @@ -933,7 +935,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
kvikio::kvikio nanoarrow zstd::zstd
)

# Add Conda library, and include paths if specified
Expand Down
37 changes: 37 additions & 0 deletions cpp/cmake/thirdparty/get_zstd.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# =============================================================================
# Copyright (c) 2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================

# 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()

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

rapids_export_find_package_root(BUILD zstd "${zstd_BINARY_DIR}" EXPORT_SET cudf-exports)

endfunction()

find_and_configure_zstd(1.5.7)

0 comments on commit 0840baf

Please sign in to comment.