Skip to content

Use C++20 in both standalone and coupled builds - #601

Merged
sbrus89 merged 1 commit into
E3SM-Project:developfrom
andrewdnolan:omega/cxx20-for-coupled
Oct 13, 2026
Merged

sbrus89 merged 1 commit into
E3SM-Project:developfrom
andrewdnolan:omega/cxx20-for-coupled

Conversation

@andrewdnolan

@andrewdnolan andrewdnolan commented Oct 12, 2026 •

Copy link
Copy Markdown

The changes to Omega's build system to support C++20, brought in by #405, only affected standalone builds. After #566, we are using Kokkos5 and need C++20 in coupled mode (in addition to standalone). This PR moves setting the CMAKE_CXX_STANDARD and CMAKE_CXX_STANDARD_REQUIRED into the common macro, so that they apply to both couple and standalone builds.

Without the changes in this PR, any C/G cases that attempted to build off develop would produce and error along the lines of:

-- Configured git information in /lustre/orion/cli115/proj-shared/anolan/e3sm_scratch/SMS_Vmct.T62_oQU240.GOMEGA-IAF.frontier_craygnu.develop/bld/cmake-bld/externals/kokkos/generated/Kokkos_Version_Info.cpp
-- Kokkos is configured for CMake languages CXX compilation (using GNU version 14.2.0)
CMake Error at /autofs/nccs-svm1_home2/anolan/repos/Omega/develop/externals/ekat/extern/kokkos/cmake/kokkos_test_cxx_std.cmake:89 (message):
  Kokkos requires C++20 or newer but requested 17!

Checklist

  • Linting

  • Building

    • CMake build does not produce any new warnings from changes in this PR
  • Testing

    aurora, oneapi-ifx, mpich

    • CTests Pass
    • Polaris omega_pr Pass

    chrysalis, oneapi-ifx, openmpi

    • CTests Pass
    • Polaris omega_pr Pass

    frontier, craygnu, mpich

    • SMS_Vmct_Ld1.T62_oQU240.GOMEGA-IAF

    frontier, craygnu-mphipcc, mpich

    • CTests Pass
    • Polaris omega_pr Pass

    pm-cpu, intel, mpich

    • SMS_Vmct_Ld1.T62_oQU240.GOMEGA-IAF

    pm-gpu, gnugpu, mpich

    • CTests Pass
    • Polaris omega_pr Pass

@andrewdnolan andrewdnolan added bug Something isn't working CMake CMake-related issues labels Oct 12, 2026
@sbrus89
sbrus89 requested a review from mwarusz October 12, 2026 17:57
@sbrus89

sbrus89 commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

@mwarusz, would you mind taking a look? Thanks!

@andrewdnolan

andrewdnolan commented Oct 12, 2026 •

Copy link
Copy Markdown
Author

Testing: frontier, craygnu

With the changes in this PR, I can successfully build SMS_Vmct.T62_oQU240.GOMEGA-IAF on frontier with the craygnu compiler. I'm having issue running that case, because the LCRC server is down as part of the maintenance. The input data for the case is missing, which is why CIME is attempting to connect to the LCRC server.

I'm currently setting up tests on perlmutter, which should hopefully have the needed inputdata downloaded.

@andrewdnolan

Copy link
Copy Markdown
Author

Testing: pm-cpu, intel

I ran: ./create_test --queue debug --no-run --machine pm-cpu SMS_Vmct_Ld1.T62_oQU240.GOMEGA-IAF . Then edited the user_nl_omega to contain:

Omega:
  Tendencies:
    KPPNonLocalTracerFluxTendencyEnable: false
  VertMix:
    KPP:
      Enable: false

and everything passed:

PASS SMS_Vmct_Ld1.T62_oQU240.GOMEGA-IAF.pm-cpu_intel CREATE_NEWCASE
PASS SMS_Vmct_Ld1.T62_oQU240.GOMEGA-IAF.pm-cpu_intel XML
PASS SMS_Vmct_Ld1.T62_oQU240.GOMEGA-IAF.pm-cpu_intel SETUP
PASS SMS_Vmct_Ld1.T62_oQU240.GOMEGA-IAF.pm-cpu_intel SHAREDLIB_BUILD time=159
PASS SMS_Vmct_Ld1.T62_oQU240.GOMEGA-IAF.pm-cpu_intel MODEL_BUILD time=313
PASS SMS_Vmct_Ld1.T62_oQU240.GOMEGA-IAF.pm-cpu_intel SUBMIT
PASS SMS_Vmct_Ld1.T62_oQU240.GOMEGA-IAF.pm-cpu_intel RUN time=85
PASS SMS_Vmct_Ld1.T62_oQU240.GOMEGA-IAF.pm-cpu_intel MEMLEAK insufficient data for memleak test
PASS SMS_Vmct_Ld1.T62_oQU240.GOMEGA-IAF.pm-cpu_intel SHORT_TERM_ARCHIVER

With KPP on, I get a failure at the beginning of the second coupling interval. @vanroekel has a PR coming up to fix whatever is wrong with KPP.

@andrewdnolan

Copy link
Copy Markdown
Author

Testing, frontier, craygnu

Running:

./create_test --no-run --compiler craygnu SMS_Vmct.T62_oQU240.GOMEGA-IAF

with the same user_nl_omega as above, which disables KPP, enables the case to pass:

PASS SMS_Vmct.T62_oQU240.GOMEGA-IAF.frontier_craygnu CREATE_NEWCASE
PASS SMS_Vmct.T62_oQU240.GOMEGA-IAF.frontier_craygnu XML
PASS SMS_Vmct.T62_oQU240.GOMEGA-IAF.frontier_craygnu SETUP
PASS SMS_Vmct.T62_oQU240.GOMEGA-IAF.frontier_craygnu SHAREDLIB_BUILD time=85
PASS SMS_Vmct.T62_oQU240.GOMEGA-IAF.frontier_craygnu MODEL_BUILD time=241
PASS SMS_Vmct.T62_oQU240.GOMEGA-IAF.frontier_craygnu SUBMIT
PASS SMS_Vmct.T62_oQU240.GOMEGA-IAF.frontier_craygnu RUN time=48
PASS SMS_Vmct.T62_oQU240.GOMEGA-IAF.frontier_craygnu MEMLEAK
PASS SMS_Vmct.T62_oQU240.GOMEGA-IAF.frontier_craygnu SHORT_TERM_ARCHIVER

@mwarusz mwarusz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving based on visual inspection and @andrewdnolan testing.

@sbrus89
sbrus89 merged commit b90c3da into E3SM-Project:develop Oct 13, 2026
1 check passed
@andrewdnolan
andrewdnolan deleted the omega/cxx20-for-coupled branch October 14, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CMake CMake-related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants