-
Notifications
You must be signed in to change notification settings - Fork 37
Fixes for CCE 18 and 19 compatibility #132
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,8 +8,29 @@ | |||||
|
|
||||||
| # -emf activates .mods and uses lower case | ||||||
| # -rmoid produces a listing file | ||||||
| set( CMAKE_Fortran_FLAGS_RELEASE "-emf -rmoid -N 1023 -O3 -hfp3 -hscalar3 -hvector3 -DNDEBUG" CACHE STRING "Release Fortran flags" FORCE ) | ||||||
| set( CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-emf -rmoid -N 1023 -O2 -hfp1 -g -DNDEBUG" CACHE STRING "Release-with-debug-info Fortran flags" FORCE ) | ||||||
| set( CMAKE_Fortran_FLAGS_PRODUCTION "-emf -rmoid -N 1023 -O2 -hfp1 -g" CACHE STRING "Production Fortran flags" FORCE ) | ||||||
| set( CMAKE_Fortran_FLAGS_BIT "-emf -rmoid -N 1023 -O2 -hfp1 -g -hflex_mp=conservative -hadd_paren -DNDEBUG" CACHE STRING "Bit-reproducible Fortran flags" FORCE ) | ||||||
| set( CMAKE_Fortran_FLAGS_DEBUG "-emf -rmoid -N 1023 -O0 -g" CACHE STRING "Debug Fortran flags" FORCE ) | ||||||
|
|
||||||
| if( CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 18.0.1 ) | ||||||
| # From CCE 18.0.1 onwards, HPE/Cray renamed mod files for Fortran submodules | ||||||
| # from <submodule_name>.mod to <parent_module_name>.<submodule_name>.smod | ||||||
| # CMake does not yet (as of v4.2.3) handle this correctly, thus we have to | ||||||
| # manually inject the correct behaviour here by | ||||||
| set( CMAKE_Fortran_SUBMODULE_SEP "." ) | ||||||
| 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 ) | ||||||
| # Unfortunately, CCE 18 and 19 incurred a bug in the lower-casing of | ||||||
| # 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. | ||||||
|
||||||
| # the `-ef` option for versions in-between. | |
| # the `-emf` option (i.e., drop the trailing `f` and use `-em`) for versions in-between. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
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, butCMAKE_Fortran_COMPILERis typically a path to the compiler executable, not a version string. This makes the condition unreliable (and can mis-detect CCE 18/19). UseCMAKE_Fortran_COMPILER_VERSION VERSION_LESS 20.0.0for the upper-bound comparison (or compare only againstCMAKE_Fortran_COMPILER_VERSIONon both sides).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.