cuda: allow C++17 build with CUDA 11+
Currently, trying to build with geant4@11 and CUDA fails when CMAKE_CXX_STANDARD
is set to 17. (I encountered this building with spack and the cxxstd=17 flag.) This allows C++17 when using CUDA 11 or higher.
Merge request reports
Activity
Hi @seth, thanks for noticing this. This module, however, is only needed to build VecCore's own tests. You don't need to "build" VecCore for using it with VecGeom/Geant4, you can use any configuration for that. The
-DCUDA=ON
CMake option is only to enable some tests for a sanity check of CUDA in VecCore itself. I just dropped this check entirely, given that CUDA 11.7 just announced by Nvidia even has some support for C++20. By the way, the official repository for VecCore is the one on GitHub, at https://github.com/root-project/veccore.Aha, thanks for the details: currently the spack recipe sets
CUDA=ON
for+cuda
but I will just remove the variant if it's not needed. I'll also update everything to use github as the source rather than cern gitlab. Should I do the same with vecgeom, or is development for that still proceeding on gitlab?@amadio To follow up on this: if building VecGeom with CUDA enabled, it adds a required "CUDA" component to the VecCore installation, which is only set when
CUDA=ON
. So theCUDA
flag does indeed change the installation and the ability to build downstream codes, so this update is indeed necessary. Thanks for dropping the needless check.VecGeom is still developed on GitLab. The check for CUDA with the component happens in
VecCoreConfig.cmake
when you callfind_package(VecCore REQUIRED CUDA)
, so when you install VecCore itself, it doesn't need any special configuration (that is, you can drop that from the spack recipe).Edited by Guilherme Amadiomentioned in commit sft/spack@1b067ee3