Fixes for NAG. - #198
Merged
Merged
Conversation
Collaborator
|
The changes look good to me. Do you have a link to a successful compilation with the mo-bundle? |
Collaborator
Author
|
http://fcm1/cylc-review/taskjobs/frwd?&suite=opsinputs-197 The failures are unrelated to this change. |
Yaswant Pradhan (yaswant)
approved these changes
Mar 5, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a mixture of changes, I couldn't easily separate them. Addresses #197. The changes are:
Detect shumlib at the top of the tree. It is needed in different subdirectories. The problem is that compilers behave differently with modules that are used transitively, i.e. procedure X uses module A which uses module B. Without this change src/opsinputs/opsinputs_cxwriter_mod.F90 fails to compile because it cannot find a shumlib module. This file doesn't reference shumlib but it does use modules that use shumlib.
There are various sections of the cmake files that set specific options for different compilers. I have added sections for NAG.
There are places CMAKE_Fortran_FLAGS is appended in ways that result in options appearing multiple times on the same command line. Some compilers tolerate this but nagfor does not.
Linking with nagfor results in problems due to the addition of linker flags that aren't compatible with nagfor's syntax. Linking with C++ is simpler. I have only done this for nagfor.
This include directories for the OPS directories were not actually being added, I have done that here (also for shumlib). The reason this doesn't matter for the other compilers is that they implicitly search the directory that the source file is contained it. nagfor doesn't however so the directories need to be added explicitly.