Commit d689097
Fix clang CI build: use clang as nvcc host compiler (#6004)
## Summary
Fix CI `clang-build-23` job failure where nvcc used gcc as host compiler
but received clang-specific flags (`-fclang-abi-compat=17`) from
PyTorch's CMake config.
Two issues were fixed:
- **`setup-env.sh`**: Switch from `CC="ccache clang"` to `CC=clang` +
`CMAKE_*_COMPILER_LAUNCHER=ccache`. The old pattern caused CMake to
resolve the CUDA host compiler (`-ccbin`) to `ccache` instead of clang.
Set `CUDAHOSTCXX` to tell CMake to use clang++ as nvcc's host compiler.
- **`CMakeLists.txt`**: Read `CUDAHOSTCXX` into
`CMAKE_CUDA_HOST_COMPILER` before `enable_language(CUDA)` to ensure it
takes effect before PyTorch's TorchConfig.cmake can override it.
## Test plan
- [x] CI `clang-build-23` job passes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 20be631 commit d689097
2 files changed
+22
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
7 | 15 | | |
8 | 16 | | |
9 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
35 | 43 | | |
0 commit comments