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

fix: neofoam compiles with cuda support and gcc #50

Merged
merged 4 commits into from
May 5, 2024

Conversation

HenningScheufler
Copy link
Collaborator

The CPM package manger seems not to include the nvcc_wrapper of the kokkos project which is required for the compilation with gcc

This can be resolved by using fetch content instead of CPM (see changed files)

However, changing the compiler to clang by executing following command:

cmake  --preset ninja-kokkos-cuda-all -DCMAKE_C_COMPILER=clang-15 -DCMAKE_CXX_COMPILER=clang++-15

correctly configures the projects but the compilation fails with following error

/usr/bin/clang++-15 -DKOKKOS_DEPENDENCE -I/home/henning/libsAndApps/NeoFOAM/build/ReleaseCudaAll/_deps/kokkos-build/core/src -I/home/henning/libsAndApps/NeoFOAM/build/ReleaseCudaAll/_deps/kokkos-src/core/src -I/home/henning/libsAndApps/NeoFOAM/build/ReleaseCudaAll/_deps/kokkos-build -I/home/henning/libsAndApps/NeoFOAM/build/ReleaseCudaAll/_deps/kokkos-src/core/src/../../tpls/desul/include -isystem /usr/local/cuda/include -O3 -DNDEBUG -x cuda --cuda-gpu-arch=sm_89 -fopenmp=libomp -std=c++20 -MD -MT _deps/kokkos-build/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_hwloc.cpp.o -MF _deps/kokkos-build/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_hwloc.cpp.o.d -o _deps/kokkos-build/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_hwloc.cpp.o -c /home/henning/libsAndApps/NeoFOAM/build/ReleaseCudaAll/_deps/kokkos-src/core/src/impl/Kokkos_hwloc.cpp
clang: warning: CUDA version is newer than the latest supported version 11.5 [-Wunknown-cuda-version]
clang: error: unsupported CUDA gpu architecture: sm_89

@greole
Copy link
Contributor

greole commented May 2, 2024

That is weird. CPM shouldn't change the way how the dependency is handled. Do you have kokkos installed separately somehow and CPM picks it up? What happens if you set CPM_USE_LOCAL_PACKAGES OFF?

@greole
Copy link
Contributor

greole commented May 3, 2024

I think this discussion is related cpm-cmake/CPM.cmake#132

@HenningScheufler
Copy link
Collaborator Author

Can we merge this PR? Improving the build setup can be done later

cmake/Kokkos.cmake Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
cmake/CxxThirdParty.cmake Show resolved Hide resolved
@HenningScheufler HenningScheufler requested a review from greole May 5, 2024 11:17
@HenningScheufler HenningScheufler merged commit df86b9b into main May 5, 2024
7 of 8 checks passed
@HenningScheufler HenningScheufler deleted the fix/cuda-compilation branch May 5, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants