Skip to content

Fixes for CCE 18 and 19 compatibility#132

Merged
wdeconinck merged 3 commits intoecmwf:developfrom
reuterbal:cce-18-19-fixes
Mar 5, 2026
Merged

Fixes for CCE 18 and 19 compatibility#132
wdeconinck merged 3 commits intoecmwf:developfrom
reuterbal:cce-18-19-fixes

Conversation

@reuterbal
Copy link
Contributor

Description

Rationale is in the comments in the file. Keeping this in draft state until I have completed testing.

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Cray Fortran compiler flag configuration to better support CCE 18/19 submodule .smod naming and related lower-casing behavior, working around gaps in CMake’s handling of Cray’s submodule module-file conventions.

Changes:

  • Add conditional overrides for CMAKE_Fortran_SUBMODULE_SEP / CMAKE_Fortran_SUBMODULE_EXT for CCE ≥ 18.0.1.
  • Select -em vs -emf module options depending on CCE version range (CCE 18/19 vs others).
  • Refactor Fortran build-type flags to reuse a common _crayftn_mod_options prefix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

set( CMAKE_Fortran_SUBMODULE_EXT ".smod" )
endif()

if( CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 18.0.0 AND CMAKE_Fortran_COMPILER VERSION_LESS 20.0.0 )
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The version-range check uses CMAKE_Fortran_COMPILER VERSION_LESS 20.0.0, but CMAKE_Fortran_COMPILER is typically a path to the compiler executable, not a version string. This makes the condition unreliable (and can mis-detect CCE 18/19). Use CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 20.0.0 for the upper-bound comparison (or compare only against CMAKE_Fortran_COMPILER_VERSION on both sides).

Suggested change
if( CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 18.0.0 AND CMAKE_Fortran_COMPILER VERSION_LESS 20.0.0 )
if( CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 18.0.0 AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 20.0.0 )

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

# submodule .smod files with the above change, leading to incomplete
# lower-casing of the output file name, e.g., `parent_mod.sUB_MOD.smod`.
# This is supposedly fixed in CCE20, but we have to switch off the use of
# the `-ef` option for versions in-between.
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

Comment mentions disabling the -ef option, but the logic is actually toggling between -emf and -em (i.e., dropping the trailing f). To avoid confusion for future maintainers, update the comment to reference the actual flag being changed (e.g., -emf / the f modifier) or confirm -ef is the intended option name.

Suggested change
# the `-ef` option for versions in-between.
# the `-emf` option (i.e., drop the trailing `f` and use `-em`) for versions in-between.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@reuterbal
Copy link
Contributor Author

Unfortunately the SUBMODULE_SEP and SUBMODULE_EXT settings appear to be ineffective when applied here or in a toolchain.cmake. The CMake modules available on LUMI, however, apply a fix locally and I'll suggest a fix to CMake (unfortunately their Gitlab is currently unreachable with a Bad Gateway error). Thus this PR is reduced to not enforcing the module name lower-casing in the compiler versions affected by the bug.

@reuterbal reuterbal marked this pull request as ready for review February 26, 2026 14:42
Copy link
Member

@wdeconinck wdeconinck left a comment

Choose a reason for hiding this comment

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

That looks good. Thanks @reuterbal !

@wdeconinck wdeconinck merged commit 8a9dbba into ecmwf:develop Mar 5, 2026
14 checks passed
@reuterbal reuterbal deleted the cce-18-19-fixes branch March 11, 2026 16:27
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.

3 participants