Skip to content
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

Place fortran modules in unique directory, copy dir on install into c… #320

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

dholladay00
Copy link
Collaborator

@dholladay00 dholladay00 commented Nov 6, 2023

…orrect install dir. No longer need to know module names a priori.

PR Summary

This PR makes the installation of fortran modules more robust in that module naming conventions need not be known. This is an issues on cray machines under certain conditions. This will serve as a template for how to handle this in related projects.

@rbberger @mauneyc-LANL

PR Checklist

  • Adds a test for any bugs fixed. Adds tests for new features.
  • Format your changes by using the make format command after configuring with cmake.
  • Document any new features, update documentation for changes made.
  • Make sure the copyright notice on any files you modified is up to date.
  • After creating a pull request, note it in the CHANGELOG.md file
  • If preparing for a new release, update the version in cmake.

…orrect install dir. No longer need to know module names a priori.
@mauneyc-LANL
Copy link
Collaborator

I don't have an issue with this approach, but I do want to point how I've dealt with this in the past.

$> man crayftn
## ... ##
• The -ef option is a modifier to the -em option.  If -ef is specified, the output goes to modulename.mod rather than MODULENAME.mod

so something like

if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "Cray")
  target_compile_options(singularity-eos PRIVATE "$<$<COMPILE_LANGUAGE:Fortran>:-ef>>")
endif()

(the PRIVATE only passes the option to singularity-eos so it doesn't get passed downstream)

AFAIK, crayftn is the only compiler to do this by default.

@mauneyc-LANL
Copy link
Collaborator

FWIW, this is an ongoing issue with CMake https://gitlab.kitware.com/cmake/cmake/-/issues/19608

@dholladay00 dholladay00 merged commit a92cccc into main Nov 8, 2023
4 checks passed
@dholladay00 dholladay00 deleted the dholladay00/fort_modules branch November 8, 2023 23:35
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.

4 participants