alpaka-group / alpaka

Abstraction Library for Parallel Kernel Acceleration :llama:
https://alpaka.readthedocs.io
Mozilla Public License 2.0
353 stars 72 forks source link

fix compiler detection for clang 17 and 18 as CUDA compiler with libstdc++ (gcc) #2256

Closed SimeonEhrig closed 5 months ago

SimeonEhrig commented 5 months ago

The CMake compiler detection for Clang 17 and 18 as CUDA compiler failed, because CMake tries to compile an empty CUDA source code file with the default c++ standard of the compiler, which is gnu++17. Because CUDA does not support float 128 (gnu extension) the compilation and the compiler detection fails.

This patch temporary set the default c++ standard to c++17. For more details, see here: https://gitlab.kitware.com/cmake/cmake/-/issues/25861

Our CI cannot test the fix because the Debian developers patches the libstdc++ to handle the 128 bit problem.

I tested it locally on the workstation with Clang 16, 17 and 18. The libstdc++ is installed via spack. Therefore the Debian patch is missing.

In Clang 19, the bug is fixed: https://github.com/llvm/llvm-project/issues/88695

fixed: #2254