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

Option KokkosTools_REUSE_KOKKOS_COMPILER does not work #274

Open
maartenarnst opened this issue Sep 30, 2024 · 0 comments
Open

Option KokkosTools_REUSE_KOKKOS_COMPILER does not work #274

maartenarnst opened this issue Sep 30, 2024 · 0 comments

Comments

@maartenarnst
Copy link
Contributor

Because the call to project can be expected to already set CMAKE_CXX_COMPILER

the option KokkosTools_REUSE_KOKKOS_COMPILER can no longer change CMAKE_CXX_COMPILER

  • if(KokkosTools_REUSE_KOKKOS_COMPILER)
    set(CMAKE_CXX_COMPILER "${Kokkos_CXX_COMPILER}" CACHE STRING "C++ Compiler")
    set(CMAKE_CXX_STANDARD "${CMAKE_CXX_STANDARD_DEFAULT}" CACHE STRING "C++ Standard: 98, 11, 14, 17, 20 or 23")
    endif()

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 the set 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:

Joint work with @romintomasetti.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant