Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow cc_toolchain injection for cuda_toolchain #272

Closed
hofbi opened this issue Sep 4, 2024 · 6 comments
Closed

Allow cc_toolchain injection for cuda_toolchain #272

hofbi opened this issue Sep 4, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@hofbi
Copy link
Contributor

hofbi commented Sep 4, 2024

Here in the cuda_toolchain rule, you specify the "_cc_toolchain": attr.label(default = "@bazel_tools//tools/cpp:current_cc_toolchain"). I would like to specify a different cc toolchain. What I am currently at is

cuda_toolchain(
    name = "nvcc-local",
    compiler_executable = "path to my nvcc compiler",
    toolchain_config = ":my-nvcc-config",
    _cc_toolchian = ":my-cc-toolchain"  # <-- this one fails
)

Any idea what's wrong with my setup?

@cloudhan
Copy link
Collaborator

cloudhan commented Sep 5, 2024

What is the error message?

@hofbi
Copy link
Contributor Author

hofbi commented Sep 5, 2024

no such attribute '_cc_toolchain' in 'cuda_toolchain' rule (did you mean '$cc_toolchain'?)

@cloudhan
Copy link
Collaborator

cloudhan commented Sep 5, 2024

@cloudhan
Copy link
Collaborator

cloudhan commented Sep 5, 2024

To allow some kind of customizaiton, we might instead of implement something like

https://github.com/bazelbuild/rules_python/blob/612baef1f14d1af89594f45559bc9c11a50d390a/python/BUILD.bazel#L340-L342

depends on something like current_cuda_cc_toolchain.

@cloudhan cloudhan added the enhancement New feature or request label Sep 5, 2024
@cloudhan
Copy link
Collaborator

cloudhan commented Sep 5, 2024

Related to #194

@hofbi
Copy link
Contributor Author

hofbi commented Sep 5, 2024

Thanks, closing this as duplicate of #194

@hofbi hofbi closed this as completed Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants