Skip to content

Handle public CMake dependencies in more contexts#22385

Closed
vyasr wants to merge 23 commits intorapidsai:mainfrom
vyasr:feat/absorb-rmm-rapids-logger
Closed

Handle public CMake dependencies in more contexts#22385
vyasr wants to merge 23 commits intorapidsai:mainfrom
vyasr:feat/absorb-rmm-rapids-logger

Conversation

@vyasr
Copy link
Copy Markdown
Contributor

@vyasr vyasr commented May 5, 2026

Description

Depends on #22341

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

vyasr and others added 9 commits May 5, 2026 10:36
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@vyasr vyasr self-assigned this May 5, 2026
@vyasr vyasr added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels May 5, 2026
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 5, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@vyasr
Copy link
Copy Markdown
Contributor Author

vyasr commented May 5, 2026

/ok to test

@github-actions github-actions Bot added libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue Java Affects Java cuDF API. labels May 5, 2026
@vyasr
Copy link
Copy Markdown
Contributor Author

vyasr commented May 5, 2026

/ok to test

1 similar comment
@vyasr
Copy link
Copy Markdown
Contributor Author

vyasr commented May 5, 2026

/ok to test

@vyasr vyasr force-pushed the feat/absorb-rmm-rapids-logger branch 2 times, most recently from 26b171d to 0331ad0 Compare May 6, 2026 00:54
@vyasr
Copy link
Copy Markdown
Contributor Author

vyasr commented May 6, 2026

/ok to test

3 similar comments
@vyasr
Copy link
Copy Markdown
Contributor Author

vyasr commented May 6, 2026

/ok to test

@vyasr
Copy link
Copy Markdown
Contributor Author

vyasr commented May 6, 2026

/ok to test

@vyasr
Copy link
Copy Markdown
Contributor Author

vyasr commented May 6, 2026

/ok to test

@vyasr vyasr force-pushed the feat/absorb-rmm-rapids-logger branch from 7d8a6b0 to ecca40d Compare May 6, 2026 18:16
vyasr added 3 commits May 6, 2026 15:29
When building shared libcudf with static dependencies, rmm and
rapids_logger are absorbed into the shared library using
--whole-archive to ensure all symbols are exported. This commit adds:

- Conditional WHOLE_ARCHIVE linkage for rmm/rapids_logger
- BUILD_INTERFACE wrapping to hide absorbed static deps from install
- Transitive dependency promotion for absorbed libraries
- Export set merging (rmm-exports/rapids_logger-exports into cudf-exports)
- Conda/pre-installed shared library detection (TYPE introspection)
- DSO header installation for standalone mode
- get_rmm.cmake: full EXCLUDE_FROM_ALL support + conda fix
- get_nvtx.cmake: remove export sets (rmm handles nvtx publicly)
- rapids_logger: conditional static build + export package for conda
WHOLE_ARCHIVE is only meaningful when absorbing a static library into
a shared library. Applying it to a shared library target triggers CMake
warnings. Gate both WHOLE_ARCHIVE and BUILD_INTERFACE behind the
TYPE==STATIC_LIBRARY check so the genex is never generated for
pre-installed shared deps (e.g. conda rmm/rapids_logger).
vyasr added 10 commits May 6, 2026 15:29
Two issues caused CI failure:

1. foreach(_mode BUILD INSTALL) used uppercase, but rapids-cmake export
   targets use lowercase names (rapids_export_build_*, rapids_export_install_*).
   The if(NOT TARGET) check silently skipped the entire merge block.

2. get_nvtx.cmake was missing BUILD_EXPORT_SET/INSTALL_EXPORT_SET args.
   When rmm is absorbed into libcudf, its public dep nvtx3-cpp must be in
   an export set for CMake's install(EXPORT) validation to pass.
When static deps (rmm, rapids_logger) are absorbed into libcudf.so via
whole-archive, they are not installed separately. The export-set merging
loop was copying rmm-exports' install packages (including rapids_logger)
into cudf-exports, producing a find_dependency(rapids_logger) that would
fail for consumers of an installed standalone build.

Skip packages matching _absorbed_deps names when merging install-side
export set metadata.
When promoting an absorbed library's transitive deps into cudf's public
interface, filter out deps that are themselves absorbed (already linked
via whole-archive) and LINK_ONLY entries (private link deps already
statically linked into the absorbed library).
nvtx3 is header-only. By installing its headers directly into cudf's
install tree, consumers find them via cudf's include path without needing
find_dependency(nvtx3) or any separate nvtx3 package.

Changes:
- get_nvtx.cmake: remove INSTALL_EXPORT_SET; propagate nvtx3_SOURCE_DIR
  to parent scope for header installation
- get_rmm.cmake: strip nvtx3::nvtx3-cpp from rmm's INTERFACE_LINK_LIBRARIES
  after fetch, preventing the absorption loop from promoting it into
  cudf's installed public interface
- CMakeLists.txt: filter nvtx3 from install-side export set merging;
  install nvtx3 headers from nvtx3_SOURCE_DIR in the DSO headers section
@vyasr vyasr force-pushed the feat/absorb-rmm-rapids-logger branch from 39335b5 to a0ff4c2 Compare May 6, 2026 22:30
@vyasr
Copy link
Copy Markdown
Contributor Author

vyasr commented May 7, 2026

/ok to test

@vyasr
Copy link
Copy Markdown
Contributor Author

vyasr commented May 7, 2026

Combined into #22341

@vyasr vyasr closed this May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake CMake build issue improvement Improvement / enhancement to an existing function Java Affects Java cuDF API. libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant