Skip to content
Snippets Groups Projects

Fortran: Add support for submodules on Cray

All threads resolved!

Cray Fortran does not include the enclosing module name as a prefix of submodules. Define CMAKE_Fortran_SUBMODULE_SEP with an empty string to mean that there is no prefix, and set this for Cray.

Also add a default fallback to use the .mod extension when CMAKE_Fortran_SUBMODULE_EXT is not set. This is a better guess than no extension at all.

Issue: #18925
Topic-rename: fortran-submodule-cray

Edited by Brad King

Merge request reports

Pipeline #140745 passed

Pipeline passed for b0bcd4d7 on wdeconinck1:feature/fortran-submodule-fallback

Approval is optional

Merged by Kitware RobotKitware Robot 5 years ago (Jul 8, 2019 3:43pm UTC)

Merge details

  • Changes merged into master with 58d10deb.
  • Did not delete the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added comp:cray label

  • Brad King changed the description

    changed the description

    • Resolved by Brad King

      Thanks for the review @brad.king Would you suggest then that if for any Fortran compiler the CMAKE_Fortran_SUBMODULE_EXT variable is missing, we should throw an exception and state that this variable should be defined?

    • Resolved by Brad King

      When removing the code that adds the default .mod extention in this MR, it unexpectedly still works for Cray because of the lines https://gitlab.kitware.com/cmake/cmake/blob/master/Source/cmDependsFortran.cxx#L497-501 that basically re-add the ".mod" extention if no extention is present. So that even if we would print an error message, the build still passes counter-intuitively.

      Regarding the right level to check for empty CMAKE_Fortran_SUBMODULE_SEP value: You are right in that you don't want to break all Fortran projects that don't use submodules. The only place that seems to know when submodules are used is during the parsing of the Fortran files in the "rules". So essentially the above routine SModName would be a good place.

  • added 1 commit

    • dd794f5c - Add CMAKE_Fortran_SUBMODULE_{SEP,EXT} to Modules/Compiler/Cray-Fortran.cmake

    Compare with previous version

  • Brad King changed title from Fallback for Fortran submodule naming to Fortran: Add support for submodules on Cray

    changed title from Fallback for Fortran submodule naming to Fortran: Add support for submodules on Cray

  • Brad King changed the description

    changed the description

  • Brad King changed milestone to %3.16.0

    changed milestone to %3.16.0

  • assigned to @brad.king

  • Kitware Robot added 2 commits

    added 2 commits

    • 66feef60 - Fortran: Support compilers using no module prefix on submodule files
    • de996c19 - Fortran: Add support for submodules on Cray

    Compare with previous version

  • Do: stage

  • added workflow:nightly-testing label and removed workflow:wip label

  • Kitware Robot added 2 commits

    added 2 commits

    • 4f3a64de - Fortran: Support compilers using no module prefix on submodule files
    • 4f6211b5 - Fortran: Add support for submodules on Cray

    Compare with previous version

  • Do: stage

  • Kitware Robot added 2 commits

    added 2 commits

    • 33de4d27 - Fortran: Support compilers using no module prefix on submodule files
    • b0bcd4d7 - Fortran: Add support for submodules on Cray

    Compare with previous version

  • Warnings:

    • Eligible for the 3.15.x branch.

    The warnings do not need to be fixed, but it is recommended to do so.

  • Brad King changed milestone to %3.15.0

    changed milestone to %3.15.0

  • Brad King resolved all discussions

    resolved all discussions

  • Do: merge

  • Brad King mentioned in commit 58d10deb

    mentioned in commit 58d10deb

  • merged

  • Brad King mentioned in commit 1555837c

    mentioned in commit 1555837c

    • Resolved by Brad King

      Hello @brad.king this may be my ignorance in not understanding the workflow. The activity log above shows that the 'fortran-submodule-cray' branch was merged into "release-3.15" branch. But I cannot see it in the current "release" branch, and neither in the just released "3.15-rc4" tag. When and where should it appear?

  • Brad King mentioned in commit 14f69fab

    mentioned in commit 14f69fab

  • Brad King resolved all discussions

    resolved all discussions

  • mentioned in issue #20220 (closed)

  • Please register or sign in to reply
    Loading