From 9a262b2781e0e9da162990bf3601329bfdd34781 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Thu, 16 Jul 2026 11:09:15 -0500 Subject: [PATCH 01/14] Upgrade to nvcomp 5.3.0.16 --- conda/environments/all_cuda-129_arch-aarch64.yaml | 2 +- conda/environments/all_cuda-129_arch-x86_64.yaml | 2 +- conda/environments/all_cuda-133_arch-aarch64.yaml | 2 +- conda/environments/all_cuda-133_arch-x86_64.yaml | 2 +- conda/recipes/libcudf/conda_build_config.yaml | 2 +- cpp/cmake/thirdparty/get_nvcomp.cmake | 4 ++-- dependencies.yaml | 8 ++++---- python/libcudf/pyproject.toml | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/conda/environments/all_cuda-129_arch-aarch64.yaml b/conda/environments/all_cuda-129_arch-aarch64.yaml index 79a81086c3b0..3ee3fa121e3f 100644 --- a/conda/environments/all_cuda-129_arch-aarch64.yaml +++ b/conda/environments/all_cuda-129_arch-aarch64.yaml @@ -44,7 +44,7 @@ dependencies: - libcufile-dev - libcurand-dev - libkvikio==26.8.*,>=0.0.0a0 -- libnvcomp-dev==5.2.0.10 +- libnvcomp-dev==5.3.0.16 - libnvjitlink-dev - librapidsmpf==26.8.*,>=0.0.0a0 - librdkafka<2.15.0a0 diff --git a/conda/environments/all_cuda-129_arch-x86_64.yaml b/conda/environments/all_cuda-129_arch-x86_64.yaml index a4a887efbbb4..70010802ed69 100644 --- a/conda/environments/all_cuda-129_arch-x86_64.yaml +++ b/conda/environments/all_cuda-129_arch-x86_64.yaml @@ -44,7 +44,7 @@ dependencies: - libcufile-dev - libcurand-dev - libkvikio==26.8.*,>=0.0.0a0 -- libnvcomp-dev==5.2.0.10 +- libnvcomp-dev==5.3.0.16 - libnvjitlink-dev - librapidsmpf==26.8.*,>=0.0.0a0 - librdkafka<2.15.0a0 diff --git a/conda/environments/all_cuda-133_arch-aarch64.yaml b/conda/environments/all_cuda-133_arch-aarch64.yaml index 4aa4ae68a4dc..d038d3c17587 100644 --- a/conda/environments/all_cuda-133_arch-aarch64.yaml +++ b/conda/environments/all_cuda-133_arch-aarch64.yaml @@ -44,7 +44,7 @@ dependencies: - libcufile-dev - libcurand-dev - libkvikio==26.8.*,>=0.0.0a0 -- libnvcomp-dev==5.2.0.10 +- libnvcomp-dev==5.3.0.16 - libnvjitlink-dev - librapidsmpf==26.8.*,>=0.0.0a0 - librdkafka<2.15.0a0 diff --git a/conda/environments/all_cuda-133_arch-x86_64.yaml b/conda/environments/all_cuda-133_arch-x86_64.yaml index 5648f35aa5ff..8a1a2c5f1707 100644 --- a/conda/environments/all_cuda-133_arch-x86_64.yaml +++ b/conda/environments/all_cuda-133_arch-x86_64.yaml @@ -44,7 +44,7 @@ dependencies: - libcufile-dev - libcurand-dev - libkvikio==26.8.*,>=0.0.0a0 -- libnvcomp-dev==5.2.0.10 +- libnvcomp-dev==5.3.0.16 - libnvjitlink-dev - librapidsmpf==26.8.*,>=0.0.0a0 - librdkafka<2.15.0a0 diff --git a/conda/recipes/libcudf/conda_build_config.yaml b/conda/recipes/libcudf/conda_build_config.yaml index 390f22cc2de0..4f758589e239 100644 --- a/conda/recipes/libcudf/conda_build_config.yaml +++ b/conda/recipes/libcudf/conda_build_config.yaml @@ -26,7 +26,7 @@ flatbuffers_version: - "=24.3.25" nvcomp_version: - - "=5.2.0.10" + - "=5.3.0.16" zlib_version: - ">=1.2.13" diff --git a/cpp/cmake/thirdparty/get_nvcomp.cmake b/cpp/cmake/thirdparty/get_nvcomp.cmake index 248595ca17cc..522a2050256e 100644 --- a/cpp/cmake/thirdparty/get_nvcomp.cmake +++ b/cpp/cmake/thirdparty/get_nvcomp.cmake @@ -1,6 +1,6 @@ # ============================================================================= # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on # ============================================================================= @@ -127,7 +127,7 @@ function(find_and_configure_nvcomp) endif() endfunction() -set(_nvcomp_args VERSION 5.2.0.10) +set(_nvcomp_args VERSION 5.3.0.16) if(CUDF_BUILD_STATIC_DEPS STREQUAL "FORCE") list(APPEND _nvcomp_args DOWNLOAD_ONLY) endif() diff --git a/dependencies.yaml b/dependencies.yaml index 6c6c9ac67996..874f67634bb1 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -661,7 +661,7 @@ dependencies: - output_types: conda packages: # Align nvcomp version with rapids-cmake - - libnvcomp-dev==5.2.0.10 + - libnvcomp-dev==5.3.0.16 specific: - output_types: [requirements, pyproject] matrices: @@ -671,14 +671,14 @@ dependencies: - matrix: cuda: "12.*" packages: - - nvidia-libnvcomp-cu12==5.2.0.13 + - nvidia-libnvcomp-cu12==5.3.0.16 - matrix: cuda: "13.*" packages: - - nvidia-libnvcomp-cu13==5.2.0.13 + - nvidia-libnvcomp-cu13==5.3.0.16 - matrix: packages: - - nvidia-libnvcomp==5.2.0.13 + - nvidia-libnvcomp==5.3.0.16 rapids_build_skbuild: common: - output_types: [conda, requirements, pyproject] diff --git a/python/libcudf/pyproject.toml b/python/libcudf/pyproject.toml index 9f8d8ee6f629..3fee368d4d62 100644 --- a/python/libcudf/pyproject.toml +++ b/python/libcudf/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ dependencies = [ "libkvikio==26.8.*,>=0.0.0a0", "librmm==26.8.*,>=0.0.0a0", - "nvidia-libnvcomp==5.2.0.13", + "nvidia-libnvcomp==5.3.0.16", "nvidia-nvjitlink>=13.3,<14", "rapids-logger==0.2.*,>=0.0.0a0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. @@ -73,7 +73,7 @@ requires = [ "libkvikio==26.8.*,>=0.0.0a0", "librmm==26.8.*,>=0.0.0a0", "ninja", - "nvidia-libnvcomp==5.2.0.13", + "nvidia-libnvcomp==5.3.0.16", "nvidia-nvjitlink>=13.3,<14", "rapids-logger==0.2.*,>=0.0.0a0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. From f6c32a232da38960059061bb137c96b5cd342eb0 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 23 Jul 2026 17:23:27 -0400 Subject: [PATCH 02/14] librmm and rapidslogger WHOLE_ARCHIVES are before nvcomp_static.a --- cpp/CMakeLists.txt | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 8cb8ade06821..dd8f73d63497 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -1244,21 +1244,6 @@ target_compile_definitions(cudf PRIVATE $<$:CUDF_ # https://github.com/NVIDIA/cccl/pull/2844 target_compile_definitions(cudf PRIVATE THRUST_FORCE_32_BIT_OFFSET_TYPE=1 CCCL_AVOID_SORT_UNROLL=1) -# Specify the target module library dependencies -target_link_libraries( - cudf - PUBLIC CCCL::CCCL $ - PRIVATE $ - $ - ZLIB::ZLIB - ${CUDF_nvcomp_TARGET} - kvikio::kvikio - ${CUDF_nanoarrow_TARGET} - zstd - $ - rtcx::rtcx -) - # When rmm is a static library being absorbed via whole-archive, strip nvtx3 from its public # interface. We bundle nvtx3 headers directly into cudf's install tree, so consumers get them from # cudf's include path without needing the nvtx3 target or find_dependency(nvtx3). @@ -1280,7 +1265,7 @@ endif() # dependencies and export set metadata into cudf's interface. set(_absorbed_deps rmm rapids_logger) foreach(_dep IN LISTS _absorbed_deps) - set(_dep_link "${_dep}::${_dep}") + get_target_property(_dep_link "${_dep}::${_dep}" NAME) get_target_property(_target_type ${_dep_link} TYPE) if(NOT BUILD_SHARED_LIBS OR NOT _target_type STREQUAL "STATIC_LIBRARY") # If not building a shared library, or the dependency is not a static library, link normally. @@ -1313,6 +1298,13 @@ foreach(_dep IN LISTS _absorbed_deps) cudf PRIVATE "$>" ) + # nvcomp_static has done a WHOLE_ARCHIVE on rmm and rapids_logger itself. + # Therefore it needs to come after our WHOLE_ARCHIVE otherwise we will + # get duplicate symbols for rmm and/or rapids_logger + if(TARGET nvcomp::nvcomp_static) + target_link_libraries(${_dep_link} INTERFACE nvcomp::nvcomp_static) + endif() + # Merge the absorbed library's export set metadata into cudf-exports so the installed config has # find_dependency() calls for all transitive deps (e.g. nvtx3, CUDAToolkit from rmm). foreach(_mode build install) @@ -1341,6 +1333,27 @@ foreach(_dep IN LISTS _absorbed_deps) endforeach() endforeach() +# Specify the target module library dependencies +# We do this after all the WHOLE_ARCHIVES to protect against +# any of these libraries ever adding a rapids_logger / rmm hidden +# dependency +target_link_libraries( + cudf + PUBLIC CCCL::CCCL $ + PRIVATE $ + $ + ZLIB::ZLIB + kvikio::kvikio + ${CUDF_nanoarrow_TARGET} + zstd + $ + rtcx::rtcx +) + +if(CUDF_DEPS_BUILD_SHARED OR NOT TARGET nvcomp::nvcomp_static) + target_link_libraries(cudf PRIVATE nvcomp::nvcomp) +endif() + # Add Conda library, and include paths if specified if(TARGET conda_env) target_link_libraries(cudf PRIVATE conda_env) From 05a6322e3f7a24241db0319a6ebc4e6d317c07e0 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Thu, 23 Jul 2026 16:40:14 -0500 Subject: [PATCH 03/14] Apply cmake-format --- cpp/CMakeLists.txt | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index dd8f73d63497..6284ba03e799 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -1298,9 +1298,9 @@ foreach(_dep IN LISTS _absorbed_deps) cudf PRIVATE "$>" ) - # nvcomp_static has done a WHOLE_ARCHIVE on rmm and rapids_logger itself. - # Therefore it needs to come after our WHOLE_ARCHIVE otherwise we will - # get duplicate symbols for rmm and/or rapids_logger + # nvcomp_static has done a WHOLE_ARCHIVE on rmm and rapids_logger itself. Therefore it needs to + # come after our WHOLE_ARCHIVE otherwise we will get duplicate symbols for rmm and/or + # rapids_logger if(TARGET nvcomp::nvcomp_static) target_link_libraries(${_dep_link} INTERFACE nvcomp::nvcomp_static) endif() @@ -1333,21 +1333,13 @@ foreach(_dep IN LISTS _absorbed_deps) endforeach() endforeach() -# Specify the target module library dependencies -# We do this after all the WHOLE_ARCHIVES to protect against -# any of these libraries ever adding a rapids_logger / rmm hidden -# dependency +# Specify the target module library dependencies We do this after all the WHOLE_ARCHIVES to protect +# against any of these libraries ever adding a rapids_logger / rmm hidden dependency target_link_libraries( cudf PUBLIC CCCL::CCCL $ - PRIVATE $ - $ - ZLIB::ZLIB - kvikio::kvikio - ${CUDF_nanoarrow_TARGET} - zstd - $ - rtcx::rtcx + PRIVATE $ $ ZLIB::ZLIB + kvikio::kvikio ${CUDF_nanoarrow_TARGET} zstd $ rtcx::rtcx ) if(CUDF_DEPS_BUILD_SHARED OR NOT TARGET nvcomp::nvcomp_static) From 044b20842c2072e7595d1553347268b7a4302045 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 24 Jul 2026 11:22:52 -0400 Subject: [PATCH 04/14] spdlog WHOLE_ARCHIVES are before nvcomp_static.a --- cpp/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 6284ba03e799..76a1ba548e6d 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -1263,13 +1263,13 @@ endif() # their symbols are available to downstream users linking to libcudf.so without needing to link # against them directly. Public absorbed dependencies still promote their public transitive # dependencies and export set metadata into cudf's interface. -set(_absorbed_deps rmm rapids_logger) +set(_absorbed_deps rmm rapids_logger spdlog) foreach(_dep IN LISTS _absorbed_deps) get_target_property(_dep_link "${_dep}::${_dep}" NAME) get_target_property(_target_type ${_dep_link} TYPE) if(NOT BUILD_SHARED_LIBS OR NOT _target_type STREQUAL "STATIC_LIBRARY") # If not building a shared library, or the dependency is not a static library, link normally. - target_link_libraries(cudf PUBLIC ${_dep_link}) + target_link_libraries(cudf PUBLIC $) continue() endif() From 8fead2a4d4f43c9e959b5c5c7bdd3056a9f61cfb Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 24 Jul 2026 11:40:36 -0400 Subject: [PATCH 05/14] Make sure all targets exist before we query them --- cpp/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 76a1ba548e6d..6110be48d6ea 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -1265,11 +1265,14 @@ endif() # dependencies and export set metadata into cudf's interface. set(_absorbed_deps rmm rapids_logger spdlog) foreach(_dep IN LISTS _absorbed_deps) + if(NOT TARGET "${_dep}::${_dep}") + continue() + endif() get_target_property(_dep_link "${_dep}::${_dep}" NAME) get_target_property(_target_type ${_dep_link} TYPE) if(NOT BUILD_SHARED_LIBS OR NOT _target_type STREQUAL "STATIC_LIBRARY") # If not building a shared library, or the dependency is not a static library, link normally. - target_link_libraries(cudf PUBLIC $) + target_link_libraries(cudf PUBLIC ${_dep_link}) continue() endif() From f81c89bc5aa54a2fcc99b17bd626f7a0bb35ba66 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Fri, 24 Jul 2026 16:12:09 -0500 Subject: [PATCH 06/14] Fix private spdlog export with nvcomp --- cpp/CMakeLists.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 6110be48d6ea..65d1d4523942 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -1263,7 +1263,7 @@ endif() # their symbols are available to downstream users linking to libcudf.so without needing to link # against them directly. Public absorbed dependencies still promote their public transitive # dependencies and export set metadata into cudf's interface. -set(_absorbed_deps rmm rapids_logger spdlog) +set(_absorbed_deps rmm rapids_logger) foreach(_dep IN LISTS _absorbed_deps) if(NOT TARGET "${_dep}::${_dep}") continue() @@ -1336,6 +1336,18 @@ foreach(_dep IN LISTS _absorbed_deps) endforeach() endforeach() +if(TARGET spdlog::spdlog) + get_target_property(_spdlog_link spdlog::spdlog NAME) + get_target_property(_spdlog_type ${_spdlog_link} TYPE) + if(BUILD_SHARED_LIBS AND _spdlog_type STREQUAL "STATIC_LIBRARY") + target_link_libraries( + cudf PRIVATE "$>" + ) + else() + target_link_libraries(cudf PRIVATE ${_spdlog_link}) + endif() +endif() + # Specify the target module library dependencies We do this after all the WHOLE_ARCHIVES to protect # against any of these libraries ever adding a rapids_logger / rmm hidden dependency target_link_libraries( From 5a866790f1449b0b03d8f1c4d86fe237f16e8fa0 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 28 Jul 2026 09:05:39 -0400 Subject: [PATCH 07/14] CompileOnly link to nvcomp to get compile include directories --- cpp/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 65d1d4523942..c4f4e5b4fda4 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -1359,6 +1359,8 @@ target_link_libraries( if(CUDF_DEPS_BUILD_SHARED OR NOT TARGET nvcomp::nvcomp_static) target_link_libraries(cudf PRIVATE nvcomp::nvcomp) +else() + target_link_libraries(cudf PRIVATE $) endif() # Add Conda library, and include paths if specified From 4db6afe2c61331a4e6abc8b77ae276b19e883a0b Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 28 Jul 2026 10:16:37 -0400 Subject: [PATCH 08/14] Update java bindings to know we always build with static nvcomp for them --- java/src/main/native/CMakeLists.txt | 30 +++++------------------------ 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/java/src/main/native/CMakeLists.txt b/java/src/main/native/CMakeLists.txt index c0234bf6d620..a91d76fd9808 100644 --- a/java/src/main/native/CMakeLists.txt +++ b/java/src/main/native/CMakeLists.txt @@ -109,12 +109,11 @@ endif() find_package(nvtx3 REQUIRED) if(NOT TARGET nvcomp - AND NOT TARGET nvcomp::nvcomp + AND NOT TARGET nvcomp::nvcomp_static AND NOT DEFINED ENV{CUDF_INSTALL_DIR} ) include(${CUDF_SOURCE_DIR}/cmake/thirdparty/get_nvcomp.cmake) endif() -find_package(nvcomp REQUIRED) # ################################################################################################## # * find JNI -------------------------------------------------------------------------------------- @@ -268,35 +267,16 @@ endif() # ################################################################################################## # * link libraries -------------------------------------------------------------------------------- - -set(CUDF_LINK PUBLIC cudf::cudf) if(CUDF_JNI_LIBCUDF_STATIC) - # Whole-link libcudf.a into the shared library but not its dependencies - set(CUDF_LINK PRIVATE -Wl,--whole-archive cudf::cudf -Wl,--no-whole-archive) + target_link_libraries(cudfjni PRIVATE $) +else() + target_link_libraries(cudfjni PUBLIC cudf::cudf) endif() -# When nvcomp is installed we need to use nvcomp::nvcomp but from the cudf build directory it will -# just be nvcomp. -target_link_libraries( - cudfjni ${CUDF_LINK} PRIVATE nvtx3::nvtx3-cpp $ - $ -) +target_link_libraries(cudfjni PRIVATE nvtx3::nvtx3-cpp $) # ################################################################################################## # * cudart options -------------------------------------------------------------------------------- # cudart can be statically linked or dynamically linked. The python ecosystem wants dynamic # linking - set_target_properties(cudfjni PROPERTIES CUDA_RUNTIME_LIBRARY Static) - -# ################################################################################################## -# * install shared libraries ---------------------------------------------------------------------- -if(TARGET nvcomp::nvcomp) - add_custom_command( - TARGET cudfjni - PRE_LINK - COMMAND ${CMAKE_COMMAND} -E copy $ - "${PROJECT_BINARY_DIR}/libnvcomp.so" - COMMENT "Copying nvcomp libraries to ${PROJECT_BINARY_DIR}" - ) -endif() From 55ac6078c6937c17606452b4bd4d62265c962cf7 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 28 Jul 2026 10:25:14 -0400 Subject: [PATCH 09/14] Mark our shared library dependency on nvcomp as public when installing the library --- cpp/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index c4f4e5b4fda4..1588aeb25a1a 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -1357,8 +1357,14 @@ target_link_libraries( kvikio::kvikio ${CUDF_nanoarrow_TARGET} zstd $ rtcx::rtcx ) -if(CUDF_DEPS_BUILD_SHARED OR NOT TARGET nvcomp::nvcomp_static) - target_link_libraries(cudf PRIVATE nvcomp::nvcomp) +if(CUDF_DEPS_BUILD_SHARED) + # When building with shared dependencies we need to have the usage requirement match if we want to + # install the headers/libraries + if(CUDF_INSTALL_LIBRARY_DEPS) + target_link_libraries(cudf PUBLIC nvcomp::nvcomp) + else() + target_link_libraries(cudf PRIVATE nvcomp::nvcomp) + endif() else() target_link_libraries(cudf PRIVATE $) endif() From 3e5bf1f2da47f1c2bc1e7cc4a985b8906e246d60 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 28 Jul 2026 14:05:31 -0400 Subject: [PATCH 10/14] Simplify our nvcomp logic and restore it to be a private dependency when using shared deps --- cpp/CMakeLists.txt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 1588aeb25a1a..8f949b99ef2b 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -1264,6 +1264,7 @@ endif() # against them directly. Public absorbed dependencies still promote their public transitive # dependencies and export set metadata into cudf's interface. set(_absorbed_deps rmm rapids_logger) +set(_absorbed_nvcomp FALSE) foreach(_dep IN LISTS _absorbed_deps) if(NOT TARGET "${_dep}::${_dep}") continue() @@ -1306,6 +1307,7 @@ foreach(_dep IN LISTS _absorbed_deps) # rapids_logger if(TARGET nvcomp::nvcomp_static) target_link_libraries(${_dep_link} INTERFACE nvcomp::nvcomp_static) + set(_absorbed_nvcomp TRUE) endif() # Merge the absorbed library's export set metadata into cudf-exports so the installed config has @@ -1357,16 +1359,8 @@ target_link_libraries( kvikio::kvikio ${CUDF_nanoarrow_TARGET} zstd $ rtcx::rtcx ) -if(CUDF_DEPS_BUILD_SHARED) - # When building with shared dependencies we need to have the usage requirement match if we want to - # install the headers/libraries - if(CUDF_INSTALL_LIBRARY_DEPS) - target_link_libraries(cudf PUBLIC nvcomp::nvcomp) - else() - target_link_libraries(cudf PRIVATE nvcomp::nvcomp) - endif() -else() - target_link_libraries(cudf PRIVATE $) +if(NOT _absorbed_nvcomp) + target_link_libraries(cudf PRIVATE ${CUDF_nvcomp_TARGET}) endif() # Add Conda library, and include paths if specified From c2dced47dfc7d757dac1195e03f9301f851e6637 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 28 Jul 2026 15:57:43 -0400 Subject: [PATCH 11/14] Update the java logic to handle building with non static linked nvcomp --- cpp/CMakeLists.txt | 32 ++++++++++++++++++++++------- java/src/main/native/CMakeLists.txt | 9 +++++++- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 8f949b99ef2b..9b219737fe7f 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -1165,12 +1165,13 @@ set_target_properties( # and use them. set_target_properties( cudf - PROPERTIES EXPORT_PROPERTIES - "CUDF_CXX_FLAGS;CUDF_CUDA_FLAGS;CUDF_CXX_DEFINITIONS;CUDF_CUDA_DEFINITIONS" - CUDF_CXX_FLAGS "${CUDF_CXX_FLAGS}" - CUDF_CUDA_FLAGS "${CUDF_CUDA_FLAGS}" - CUDF_CXX_DEFINITIONS "${CUDF_CXX_DEFINITIONS}" - CUDF_CUDA_DEFINITIONS "${CUDF_CUDA_DEFINITIONS}" + PROPERTIES + EXPORT_PROPERTIES + "CUDF_CXX_FLAGS;CUDF_CUDA_FLAGS;CUDF_CXX_DEFINITIONS;CUDF_CUDA_DEFINITIONS;CUDF_STATIC_LINKED_PROJECTS" + CUDF_CXX_FLAGS "${CUDF_CXX_FLAGS}" + CUDF_CUDA_FLAGS "${CUDF_CUDA_FLAGS}" + CUDF_CXX_DEFINITIONS "${CUDF_CXX_DEFINITIONS}" + CUDF_CUDA_DEFINITIONS "${CUDF_CUDA_DEFINITIONS}" ) # Note: This must come before the target_compile_options below so that the function can modify the @@ -1301,12 +1302,17 @@ foreach(_dep IN LISTS _absorbed_deps) target_link_libraries( cudf PRIVATE "$>" ) + set_property( + TARGET cudf + APPEND + PROPERTY CUDF_STATIC_LINKED_PROJECTS "${_dep_link}" + ) # nvcomp_static has done a WHOLE_ARCHIVE on rmm and rapids_logger itself. Therefore it needs to # come after our WHOLE_ARCHIVE otherwise we will get duplicate symbols for rmm and/or # rapids_logger if(TARGET nvcomp::nvcomp_static) - target_link_libraries(${_dep_link} INTERFACE nvcomp::nvcomp_static) + target_link_libraries(${_dep_link} INTERFACE $) set(_absorbed_nvcomp TRUE) endif() @@ -1345,6 +1351,11 @@ if(TARGET spdlog::spdlog) target_link_libraries( cudf PRIVATE "$>" ) + set_property( + TARGET cudf + APPEND + PROPERTY CUDF_STATIC_LINKED_PROJECTS "${_spdlog_link}" + ) else() target_link_libraries(cudf PRIVATE ${_spdlog_link}) endif() @@ -1361,6 +1372,13 @@ target_link_libraries( if(NOT _absorbed_nvcomp) target_link_libraries(cudf PRIVATE ${CUDF_nvcomp_TARGET}) + if(${CUDF_nvcomp_TARGET} STREQUAL "nvcomp::nvcomp_static") + set_property( + TARGET cudf + APPEND + PROPERTY CUDF_STATIC_LINKED_PROJECTS "nvcomp" + ) + endif() endif() # Add Conda library, and include paths if specified diff --git a/java/src/main/native/CMakeLists.txt b/java/src/main/native/CMakeLists.txt index a91d76fd9808..8f995e5ef460 100644 --- a/java/src/main/native/CMakeLists.txt +++ b/java/src/main/native/CMakeLists.txt @@ -273,7 +273,14 @@ else() target_link_libraries(cudfjni PUBLIC cudf::cudf) endif() -target_link_libraries(cudfjni PRIVATE nvtx3::nvtx3-cpp $) +get_target_property(cudf_static_linked_projects cudf::cudf STATIC_LINKED_PROJECTS) +if(nvcomp IN_LIST cudf_static_linked_projects) + target_link_libraries(cudfjni PRIVATE $) +else() + target_link_libraries(cudfjni PRIVATE nvcomp::nvcomp) +endif() + +target_link_libraries(cudfjni PRIVATE nvtx3::nvtx3-cpp) # ################################################################################################## # * cudart options -------------------------------------------------------------------------------- From d44b18a328f6b7534b266fada6abf2260c7ddfd4 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 29 Jul 2026 10:20:25 -0400 Subject: [PATCH 12/14] Correct CUDF_STATIC_LINKED_PROJECTS target query --- java/src/main/native/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/main/native/CMakeLists.txt b/java/src/main/native/CMakeLists.txt index 8f995e5ef460..f75ae86c587e 100644 --- a/java/src/main/native/CMakeLists.txt +++ b/java/src/main/native/CMakeLists.txt @@ -273,7 +273,7 @@ else() target_link_libraries(cudfjni PUBLIC cudf::cudf) endif() -get_target_property(cudf_static_linked_projects cudf::cudf STATIC_LINKED_PROJECTS) +get_target_property(cudf_static_linked_projects cudf::cudf CUDF_STATIC_LINKED_PROJECTS) if(nvcomp IN_LIST cudf_static_linked_projects) target_link_libraries(cudfjni PRIVATE $) else() From eff71c4493b5018b69344b65ca5540d9ad7b2cbe Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 29 Jul 2026 10:22:42 -0400 Subject: [PATCH 13/14] Restore installing libnvcomp.so when needed by tests --- java/src/main/native/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/java/src/main/native/CMakeLists.txt b/java/src/main/native/CMakeLists.txt index f75ae86c587e..ed4b17835346 100644 --- a/java/src/main/native/CMakeLists.txt +++ b/java/src/main/native/CMakeLists.txt @@ -278,6 +278,15 @@ if(nvcomp IN_LIST cudf_static_linked_projects) target_link_libraries(cudfjni PRIVATE $) else() target_link_libraries(cudfjni PRIVATE nvcomp::nvcomp) + + # * install nvcomp for tests + add_custom_command( + TARGET cudfjni + PRE_LINK + COMMAND ${CMAKE_COMMAND} -E copy $ + "${PROJECT_BINARY_DIR}/libnvcomp.so" + COMMENT "Copying nvcomp libraries to ${PROJECT_BINARY_DIR}" + ) endif() target_link_libraries(cudfjni PRIVATE nvtx3::nvtx3-cpp) From 0e1d174aa3802bb84e1e92aa5068bbecc28dcb09 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 29 Jul 2026 11:30:12 -0400 Subject: [PATCH 14/14] Code cleanup based on review --- cpp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 9b219737fe7f..daaf66ffac99 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -1372,7 +1372,7 @@ target_link_libraries( if(NOT _absorbed_nvcomp) target_link_libraries(cudf PRIVATE ${CUDF_nvcomp_TARGET}) - if(${CUDF_nvcomp_TARGET} STREQUAL "nvcomp::nvcomp_static") + if(CUDF_nvcomp_TARGET STREQUAL "nvcomp::nvcomp_static") set_property( TARGET cudf APPEND