atlas
atlas copied to clipboard
NAG fixes for fypp issue.
Resovles #192.
The problem is that when the pre-processor expands the macros the result contains lines of longer than 132 characters due to the length of the file paths. This just adds some NAG specific code to circumvent the NAG compile issues described in #192. It isn't a very good solution but I can't obviously see anything better.
I was just reading this here, which may solve this problem and be also a more desired output of handling _FILE_
anyway
https://fypp.readthedocs.io/en/stable/fypp.html#rendering-file-names-as-relative-paths
I can have a look on adding this flag --file-var-root
to fypp generation stage.
It doesn't seem to be so straightforward to apply a general approach with '--file-var-root'.
However I verified the generated file <atlas-build-dir>/src/atlas_f/field/atlas_Field_module.F90
and I don't get the line-length going over 132, and fypp has split the line in 2, e.g.:
call fckit_exception%abort( "Rank mismatch", "/Users/willem/work/atlas-bundle/source/atlas/src/atlas_f/field/atlas_Field_module.f&
# 172 "/Users/willem/work/atlas-bundle/source/atlas/src/atlas_f/field/atlas_Field_module.fypp"
&ypp", 172 )
Could you show me from the generated file as well an example of offending line?
It doesn't seem to be so straightforward to apply a general approach with '--file-var-root'. However I verified the generated file
<atlas-build-dir>/src/atlas_f/field/atlas_Field_module.F90
and I don't get the line-length going over 132, and fypp has split the line in 2, e.g.:call fckit_exception%abort( "Rank mismatch", "/Users/willem/work/atlas-bundle/source/atlas/src/atlas_f/field/atlas_Field_module.f& # 172 "/Users/willem/work/atlas-bundle/source/atlas/src/atlas_f/field/atlas_Field_module.fypp" &ypp", 172 )
Could you show me from the generated file as well an example of offending line?
This is basically what I am seeing as well. I think my description of the issue in the first comment isn't quite correct, the line is being chopped at 132 characters but the problem is the insertion of the # 172 ... line in the middle of the string line break. It looks like NAG doesn't handle this syntax (it isn't standard).
Thanks for that clarification @DJDavies2 .
Perhaps you can try to add FYPP_ARGS --line-numbering-mode=nocontlines
within this statement ?
-> https://github.com/ecmwf/atlas/blob/develop/src/atlas_f/CMakeLists.txt#L279
And verify the continuation line "line markers" are gone?
If that is the case I can add this argument within the fypp macro within fckit for NAG compiler so that it would just work in any fypp file, not just Atlas.
FYPP_ARGS --line-numbering-mode=nocontlines does seem to work for the atlas_f subdirectory. However there is also the file src/tests/runtime/fctest_trace.fypp and it isn't clear where I should make the change, can you point me to what I need to do?
Thanks for confirming it works. No need to change anything anymore. I will make the change in the fypp cmake macro exported by fckit. That should then automatically fix atlas and other packages using fypp with NAG compiler.
That commit message in https://github.com/ecmwf/fckit/commit/613d53ef5257db641ab103aefb93322f4456eb57 auto-closed this PR. Interesting.... Please verify this works for you :)
Yes, that changed worked for me, thanks.
This is now released in fckit 0.13.0