Skip to content

Add selectable CUDA library modes - #27

Open
cjm-dd wants to merge 1 commit into
hermeticbuild:mainfrom
cjm-dd:cjm/codex/proxy-library-mode
Open

cjm-dd wants to merge 1 commit into
hermeticbuild:mainfrom
cjm-dd:cjm/codex/proxy-library-mode

Conversation

@cjm-dd

@cjm-dd cjm-dd commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a repository-wide @cuda//:library_mode build setting so consumers can switch CUDA linkage without changing dependency labels. The flag accepts shared, static, or system and defaults to the existing shared behavior.

For each complete foo / foo_static / foo_system family, the generated proxy now keeps the explicit suffixed targets stable and makes the unsuffixed foo target select the requested variant. Targets that do not expose a complete family are unchanged. cuDART also gains the semantic cudart_static alias needed to participate consistently.

The proxy already selects concrete repositories by CUDA version. The generator now composes that dimension with linkage mode through private per-mode version aliases, then exposes a single public mode-selecting alias. This preserves existing labels and defaults while avoiding nested configurable attributes.

Validation

  • bazel --nohome_rc build //...
  • Analysis-only e2e builds of the unsuffixed cuBLAS consumer for shared, static, and system across CUDA 12.8.1, 12.9.1, 13.0.2, 13.1.1, 13.2.1, and 13.3.1
  • Real downstream Bzlmod link builds against unsuffixed cuBLAS and cuDART targets in all three modes using a local path override

Generated with Codex.

Co-authored-by: Codex <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant