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

Cmake: Add 3.28: #43723

Merged
merged 8 commits into from
May 23, 2024
Merged

Cmake: Add 3.28: #43723

merged 8 commits into from
May 23, 2024

Conversation

johnwparent
Copy link
Contributor

No description provided.

@johnwparent
Copy link
Contributor Author

cc @alalazo

Copy link
Contributor

@tldahlgren tldahlgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI. Confirmed the 5 new version sha256s.

@cedricchevalier19
Copy link
Contributor

@johnwparent can you describe a little bit more the conflict with Kokkos?

We have observed an issue using CMake 3.28.4 and Cuda (kokkos/kokkos#6898), but it should be solved in the last version 4.3.00 of Kokkos.

Thank you very much in advance.

This was referenced Apr 18, 2024
@johnwparent
Copy link
Contributor Author

FYI. Confirmed the 5 new version sha256s.

Thanks as always!!

@johnwparent
Copy link
Contributor Author

@johnwparent can you describe a little bit more the conflict with Kokkos?

We have observed an issue using CMake 3.28.4 and Cuda (kokkos/kokkos#6898), but it should be solved in the last version 4.3.00 of Kokkos.

Thank you very much in advance.

@cedricchevalier19

With CMake 3.28 (all patch versions so far) we're seeing a CI failure specifically with kokkos-kernels and trilinos right now, but this would be true with any package consuming the kokkos CMake config file. The error we observe is an eventual make (or CMake for 3.28.4) failure caused by this (from the kokkos config):

  CMake Warning (dev) in CMakeLists.txt:
  Policy CMP0111 is not set: An imported target missing its location property
  fails during generation.  Run "cmake --help-policy CMP0111" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  IMPORTED_LOCATION not set for imported target "CUDA::cuda_driver"
  configuration "RELEASE".
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at kokkos/lib64/cmake/Kokkos/KokkosConfig.cmake:41 (SET_TARGET_PROPERTIES):
  The link interface of target "CUDA::cudart" contains:

    CUDA::cudart_static_deps

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

  Call Stack (most recent call first):
  CMakeLists.txt:129 (FIND_PACKAGE)

when tools eventually can't resolve the path to that target.
From a grep of the kokkos code base we can see some custom logic around this and similar targets

grep -rin "cudart_static" .
./cmake/Modules/CudaToolkit.cmake:130:- ``CUDA::cudart_static``
./cmake/Modules/CudaToolkit.cmake:806:  _CUDAToolkit_find_and_add_import_lib(cudart_static)
./cmake/Modules/CudaToolkit.cmake:808:  # setup dependencies that are required for cudart_static when building
./cmake/Modules/CudaToolkit.cmake:811:  if(NOT TARGET CUDA::cudart_static_deps
./cmake/Modules/CudaToolkit.cmake:812:     AND TARGET CUDA::cudart_static)
./cmake/Modules/CudaToolkit.cmake:814:    add_library(CUDA::cudart_static_deps IMPORTED INTERFACE)
./cmake/Modules/CudaToolkit.cmake:815:    target_link_libraries(CUDA::cudart_static INTERFACE CUDA::cudart_static_deps)
./cmake/Modules/CudaToolkit.cmake:819:      target_link_libraries(CUDA::cudart_static_deps INTERFACE Threads::Threads ${CMAKE_DL_LIBS})
./cmake/Modules/CudaToolkit.cmake:827:        message(WARNING "Could not find librt library, needed by CUDA::cudart_static")
./cmake/Modules/CudaToolkit.cmake:829:        target_link_libraries(CUDA::cudart_static_deps INTERFACE ${CUDAToolkit_rt_LIBRARY})

So it seems like when we updated the CUDA detection behavior in CMake, the Kokkos logic around these targets broke and is now producing bad KokkosConfig.cmake files

@cedricchevalier19 is the Fix in Kokkos in a release that's part of Spack? If so I'll scope the conflict appropriately.

@cedricchevalier19
Copy link
Contributor

Fix is present in 4.3.00 which is available in Spack.

For other versions, conflict should be declared only when +cuda is set.

@johnwparent
Copy link
Contributor Author

johnwparent commented Apr 18, 2024

Fix is present in 4.3.00 which is available in Spack.

For other versions, conflict should be declared only when +cuda is set.

@cedricchevalier19
Thank you, I've updated the conflict to be more specific.

Copy link
Contributor

@cedricchevalier19 cedricchevalier19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is fine on the Kokkos side. I'll let @alalazo and the spack team decide if they want to separate the Kokkos conflicts modification.

@johnwparent
Copy link
Contributor Author

Note: requires #43780

PR'ing to asses status w.r.t. Kokos-kernel
If this PR fails CI, we should look into patching kokos-kermel or limiting its CMake to pre 3.28 releases.
@alalazo alalazo enabled auto-merge (squash) May 22, 2024 15:26
@alalazo alalazo merged commit 04dc16a into spack:develop May 23, 2024
14 checks passed
teaguesterling pushed a commit to teaguesterling/spack that referenced this pull request Jun 15, 2024
hariharan-devarajan pushed a commit to hariharan-devarajan/spack that referenced this pull request Jul 10, 2024
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.

4 participants