kokkos-tools
kokkos-tools copied to clipboard
Option `KokkosTools_REUSE_KOKKOS_COMPILER` does not work
Because the call to project
can be expected to already set CMAKE_CXX_COMPILER
- https://github.com/kokkos/kokkos-tools/blob/a9453b21e09c7555096f3a96bb3fa8b34afe19f8/CMakeLists.txt#L3
the option KokkosTools_REUSE_KOKKOS_COMPILER
can no longer change CMAKE_CXX_COMPILER
- https://github.com/kokkos/kokkos-tools/blob/a9453b21e09c7555096f3a96bb3fa8b34afe19f8/CMakeLists.txt#L65-L68
so the option KokkosTools_REUSE_KOKKOS_COMPILER
can be expected not to work.
Ways forward could be
- remove the option
KokkosTools_REUSE_KOKKOS_COMPILER
- use
FORCE
in theset
command
Using FORCE
would indeed "reuse" the compiler, but it may not be a good solution because some flags may have been set already in the toolchain for the compiler that is now being overridden with force.
Note that the CMake
documentation says that CMAKE_CXX_COMPILER
may be set only once:
- https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER.html
Joint work with @romintomasetti.