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

feature: Support building CUDA backend kernels with clang++ #251

Open
raffenet opened this issue Apr 3, 2024 · 2 comments
Open

feature: Support building CUDA backend kernels with clang++ #251

raffenet opened this issue Apr 3, 2024 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@raffenet
Copy link
Contributor

raffenet commented Apr 3, 2024

A user reported being unable to build MPICH using clang++ as the CUDA compiler used to build Yaksa pmodels/mpich#6954. Noting down the issues encountered trying to build like this:

  1. NVCC_FLAGS is ignored when supplying an alternative NVCC in the configuration environment. Addressed in backend/cuda: Use NVCC_FLAGS with user-provided NVCC #250.
  2. CUDA_SM code generation flags from configure are not compatible with clang++. Need to use the right flags based on the compiler used.
  3. Building .cu files with clang/clang++ puts the compiler in C++ mode. CUDA kernels with the C _Bool type cannot be compiled since that type is not in C++. C++ has a bool type, but it is not guaranteed to be compatible, so we need some special handling to do the right thing.
  4. clang++ warns that the -Xcompiler option used by cudalt.sh is unrecognized. We should omit it when using clang++.
@raffenet raffenet added enhancement New feature or request help wanted Extra attention is needed labels Apr 3, 2024
@hzhou
Copy link
Contributor

hzhou commented Apr 3, 2024

Does clang work or does it have to be clang++?

We should standardize it between MPL and yaksa, maybe as a Autoconf macro in a .m4 file. We can manually copy to yaksa for now.

@raffenet
Copy link
Contributor Author

raffenet commented Apr 3, 2024

Does clang work or does it have to be clang++?

We should standardize it between MPL and yaksa, maybe as a Autoconf macro in a .m4 file. We can manually copy to yaksa for now.

I tried NVCC=clang and it produced the same error about _Bool not defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants