Repository navigation
Update to c++20 for EAMxx and Homme - #8559
Conversation
There was a problem hiding this comment.
Pull request overview
Update the build configuration across E3SM components to use C++20 (instead of C++17), aligning with the updated EKAT requirement and ensuring Homme/EAMxx default to the newer standard.
Changes:
- Set the global components build to C++20.
- Default EAMxx standalone builds to C++20.
- Default Homme standalone builds to C++20.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| components/CMakeLists.txt | Switch global components build to C++20. |
| components/eamxx/CMakeLists.txt | Update EAMxx default C++ standard from 17 to 20. |
| components/homme/CMakeLists.txt | Set Homme standalone default C++ standard to 20. |
304f23c to
817deee
Compare
817deee to
184fb10
Compare
37d08d2 to
2f55695
Compare
| set(CMAKE_CXX_STANDARD 17) | ||
|
|
||
| # Require C++20. | ||
| set(CMAKE_CXX_STANDARD 20) |
There was a problem hiding this comment.
Do we need to set these? If a library uses c++20, they can use target_compile_features, no?
There was a problem hiding this comment.
Ah, but we create targets in build_model.cmake, in a very code-agnostic way. So I guess for that reason we must set this here, in case some lib does use c++20?
There was a problem hiding this comment.
I think this line should actually not be touch. I misunderstood it to mean we were setting everything to C++17, but actually EAMxx is free to take C++20 from EKAT, correct?
64ac70c to
c905b19
Compare
|
I reverted back the changes in EAMxx will use C++20 due to it's dependence on EKAT. As it stands, hommexx will not use C++20, but, if this PR is an effort to prepare us for updating to Kokkos 5, I'm now thinking again that we maybe should use C++20 here in hommexx instead of waiting till Kokkos 5 update. @bartgol thoughts? |
c905b19 to
12e6372
Compare
On one hand, I would say "no need to do it", but otoh C++20 adds new reserved keywords, so if linking against kk 5 will implicitly force to use c++20, we may as well test it now. |
12e6372 to
3a616dc
Compare
a1c5746 to
2bb7528
Compare
0b3a6a9 to
8dbd570
Compare
EAMxx will get CXX standard from it's dependance on EKAT core
This is unrelated to C++20, but exposed by updating to C++20 (perhaps different linking behavior?)
fb6f47d to
705c5b7
Compare
Update EAMxx and Homme to C++20. Changes: ~Update EKAT (now requires C++20)~ (Updated as a part of Initial port to vista machine at TACC #8604) Remove setting CXX_STANDARD in EAMxx Remove setting CXX_STANDARD in machine/cime build files Update homme standalone testing to use C++20 [non-BFB] Potentially for EAMxx/homme standalone cases
Update EAMxx and Homme to C++20. Changes:
Update EKAT (now requires C++20)(Updated as a part of Initial port to vista machine at TACC #8604)[non-BFB] Potentially for EAMxx/homme standalone cases