Skip to content

Handle public CMake dependencies in more contexts#22385

Draft
vyasr wants to merge 16 commits intorapidsai:mainfrom
vyasr:feat/absorb-rmm-rapids-logger
Draft

Handle public CMake dependencies in more contexts#22385
vyasr wants to merge 16 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 11 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>
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 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 from d9cb37e to 26b171d Compare May 6, 2026 00:52
vyasr added 2 commits May 5, 2026 17:53
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.
@vyasr vyasr force-pushed the feat/absorb-rmm-rapids-logger branch 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

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).
@vyasr
Copy link
Copy Markdown
Contributor Author

vyasr commented May 6, 2026

/ok to test

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