UoB-HPC / BabelStream

STREAM, for lots of devices written in many programming models
Other
313 stars 109 forks source link

CMake Error: Kokkos requires C++17 or newer but requested 14 #158

Closed biergaizi closed 11 months ago

biergaizi commented 11 months ago

Since Kokkos 4.0.0, C++17 is now mandatory. Trying to build BabelStream with Kokkos now creates the following error:

CMake Error at /home/user/kokkos/cmake/kokkos_test_cxx_std.cmake:78 (MESSAGE):
  Kokkos requires C++17 or newer but requested 14!
Call Stack (most recent call first):
  /home/user/kokkos/cmake/kokkos_tribits.cmake:202 (INCLUDE)
  /home/user/kokkos/CMakeLists.txt:226 (KOKKOS_SETUP_BUILD_ENVIRONMENT)

Patch attached:

diff --git a/src/kokkos/model.cmake b/src/kokkos/model.cmake
index 445991d..46c773d 100644
--- a/src/kokkos/model.cmake
+++ b/src/kokkos/model.cmake
@@ -17,7 +17,7 @@ set(KOKKOS_FLAGS_CPU_INTEL -qopt-streaming-stores=always)

 macro(setup)

-    set(CMAKE_CXX_STANDARD 14)
+    set(CMAKE_CXX_STANDARD 17)
     cmake_policy(SET CMP0074 NEW) #see https://github.com/kokkos/kokkos/blob/master/BUILD.md

     message(STATUS "Building using in-tree Kokkos source at `${KOKKOS_IN_TREE}`")
tom91136 commented 11 months ago

Thanks for the report! We're preparing a upcoming release (v5 milestone) and this has been resolved with https://github.com/UoB-HPC/BabelStream/commit/893af9f5d024a881ab5876bcdf567cd51a0ae478.