Skip to content

Conversation

@tcclevenger
Copy link
Contributor

Update EKAT to require C++20

Motivation

Needed to update to Kokkos 5.0.

Testing

CI already uses C++20.

@bartgol
Copy link
Contributor

bartgol commented Dec 1, 2025

Asking the obv question: are we sure that E3SM will build everywhere with C++20 required? If not, this my hold back any ekat update in e3sm.

@rljacob
Copy link
Member

rljacob commented Dec 1, 2025

It will not build with all of our current default compilers. In particular, the "intel" compiler on Chrysalis. Possibly others.

bartgol
bartgol previously approved these changes Dec 1, 2025
Copy link
Contributor

@bartgol bartgol left a comment

Choose a reason for hiding this comment

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

Looks good. Only possible concern is whether e3sm is ready for c++20 across all machines.

@tcclevenger
Copy link
Contributor Author

@bartgol @rljacob Good to know. I created this PR while I'm testing E3SM on the target machines, but since we already know there will be some that are not compatible, we will need to find a different way to handle this.

Kokkos 5 is going to require C++20, what would the process be to eventually update compilers on Chrysalis (and maybe others) so that we can upgrade? Or is this going to be a bigger roadblock? I guess the first step is for me to test exactly which compilers do not work.

@bartgol
Copy link
Contributor

bartgol commented Dec 1, 2025

One solution would be to mis with a cmake2.0 way of specifying the std, via something like

if (NOT CMAKE_CXX_STANDARD)
  target_compile_features(ekat_core PUBLIC cxx_std_20)
endif()

Then, in the mach files for old compilers we keep lines like

set (CMAKE_CXX_STANDARD 17)

which will force ekat to honor the required standard. Of course, for machines where we do set 17 in the mach files, we won't be able to build anything that needs kokkos 5.0 (e.g. any F case, since EAM still use kokkos for the SL transport). This means that we cannot switch to kokkos 5 until we can abandon compilers that only support c++17.

@tcclevenger
Copy link
Contributor Author

On Chrysalis:

  • gnu: default compiler is compatible
  • oneapi-ifx: version is technically compatible, but we get a build error about not being able to find "concepts" file. Output indicates oneAPI is not correctly configured.
  • intel: Kokkos no longer supports INTEL's classic compilers (as of Kokkos 4.6, we currently use Kokkos 4.5). Maybe they are C++20 compliant, but we will need to change anyways to update Kokkos.

@bartgol
Copy link
Contributor

bartgol commented Dec 11, 2025

  • oneapi-ifx: version is technically compatible, but we get a build error about not being able to find "concepts" file. Output indicates oneAPI is not correctly configured.

Ugh, that's underwhelming. I wonder if this is on the chrys IT folks' radar...

@tcclevenger
Copy link
Contributor Author

Ugh, that's underwhelming. I wonder if this is on the chrys IT folks' radar...

Yeah, I want to try and make a small reproducer outside of E3SM. Make sure it's not something we are doing.

@tcclevenger tcclevenger force-pushed the tcclevenger/update_to_cpp20 branch from 9b9729c to 8244207 Compare January 12, 2026 15:20
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

Successfully merging this pull request may close these issues.

4 participants