-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Using rules_cuda with hermetic clang #324
Comments
Those |
If you can guide me with a high-level overview, I can send a PR to use |
@udaya2899 The idea then is not to detect but to configure, maybe manually. Because it seems that we don't have a way to query all configured toolchains and select the clang one as host+device compiler. The current detected clang use
You can actually configure it to use the newly added |
Yes, an optional arg, maybe passed to I can consider sending a PR for that. Will this label be explicitly only for clang? Because otherwise we have to propagate the same for nvcc which I'm not sure if we want to do. |
Or maybe just extend rules_cuda/cuda/private/repositories.bzl Line 196 in 6a6d2f1
CUDA_CLANG_LABEL or CUDA_CLANG_LABELS . With the first label for compile executable and remaining for compiler_deps.
|
Can you help me with understanding |
My apology, it is attr
And is used in rules_cuda/cuda/private/toolchain.bzl Lines 28 to 31 in 6a6d2f1
I am not quite sure if we need to add some additional clang deps here. |
This comment helped me. I added the following in my own configuration of
Although I had to re-declare the whole toolkit for this one line change, this makes the compiler to be the hermetic clang from llvm. That said, once I get my whole setup working (blocked by this error with --cuda-path), I can send a change to improve to use a label passed in as env or from the |
rules_cuda currently relies on the |
I am only compiling one file "foo.cu" which produces two '.o' files I assume. I believe this is specific to clang. |
maybe just add the curand as an mandatory deps to the generated repo, to make the problem much easier to solve. |
For version.json, we can just add it, the redistrib.json contains all the information. |
|
I'll retry on Monday with clang++-19. I had to downgrade to 18.x because the expectation was to be < 19. |
@udaya2899 , I'm also interested in helping out. Do you have a branch/commit I can start looking at? |
@lromor, I've been trying out locally. Which part of this issue are you also facing a similar problem? |
@udaya2899 , I have |
This hint helped me. I was earlier using 'clang-cpp' from llvm, but now I use 'clang++' and it doesn't complain about the multiple output files anymore. Phew! |
@lromor, that's what I'm trying to do. rules_cuda/cuda/private/toolchain.bzl Line 50 in 3ace346
used an older way of toolchain resolution which is deprecated. rules_cc mentions using a different I tried it but of not much success. For example, my toolchain is configured to use Update:
With this, I'm able to build CUDA code using my own clang++ from |
I am trying out #283 from cloudhan/hermetic-ctk-3 branch locally.
We have a hermetic clang+llvm setup following
@bazel-contrib/toolchains_llvm
:This is not detected by the
detect_clang
method as it tries to settle for/usr/bin/clang
and then fails at:How to let
detect_clang
know about this? The clang executable is specifically at:@llvm_toolchain//:bin/clang-cpp
. Maybe something likeexecpath
could help?The text was updated successfully, but these errors were encountered: