-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fixes for NAG compiler #43
Conversation
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.
This looks like good changes / workarounds. I'll test it a bit further.
@@ -28,7 +28,7 @@ module fckit_shared_object_module | |||
public :: fckit_c_deleter | |||
public :: fckit_c_nodeleter | |||
#if FCKIT_HAVE_ECKIT | |||
public :: fckit_owned | |||
public fckit_owned |
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.
This change is a debugging leftover ?
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.
Yes, fixed.
@@ -25,8 +25,7 @@ module fckit_shared_ptr_module | |||
#else | |||
use fckit_refcount_module, only : & | |||
& fckit_refcount, & | |||
& fckit_refcount_interface, & | |||
& fckit_external |
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 removal of fckit_external is strange. Is this required?
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.
No, I have added it back.
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.
Thanks! I just added a filter for "--coverage" flag which seems to cause problems for the CI
These fixes seem to enable fckit to build with NAG and run most of the ctests. The changes fall into 3 categories:
This affects fckit_mpi.fypp, fckit_tensor.F90 and test_tensor.F90. The issue here is that there are variables being passed to array_view1d, a function that returns a point to that same variable. However this only works if the variable is declared with the target in the calling routine. I think NAG is correct here; in Fortran pointers can only point to variables with the target attribute; without the target attribute these pointers are in an undefined state.
NAG doesn't compile these as functions and I think it is a compiler bug. However turning them into subroutines works and doesn't seem to cause any knock-on problems.
These tests require building Fortran code but compile flags are needed for this to work. These changes do that.
What do you think? I don't think this has any downstream affects. The only possibility is if something outside of fckit is calling fckit_owned or fckit_external directly; I don't know of anything but maybe there is.