-
Notifications
You must be signed in to change notification settings - Fork 22
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
compiler error in framework/posix.F90 #230
Comments
This probably needs something similar to the I can prepare a patch if necessary. |
This has also been reported by people on very old Linux |
@marshallward thank you, a patch would be great. |
@jedwards4b I have prepared a branch here https://github.com/marshallward/MOM6/tree/posix_jmp_fixes However, this is based on the I could produce a similar patch for If this isn't urgent, then we could update If none of those options work, then we look into some other solutions. |
I should add, this patch just disables the function for standard builds. The error does suggest a different problem with mismatched function signatures, and maybe we could fix this another way. But it would probably take longer to understand this, and we already needed to disable those functions for other reasons. |
We having a pending PR to update dev/ncar against main. |
The |
@marshallward Thank you for the patch but I don't think that it will work. I've sent a test code to the cce compiler developers to see if they understand the issue. |
The patch replaces the function with a local inert function. Do you know of any reason that this won't work for you? We have cray compilers on our systems so I will test it out. |
Because the issue isn't the function itself, it's the definition of the input variable env which the inclusion of the inert function does not change. |
True but the current version assumes consistency between the system longjmp and the locally defined wrapper. The patch is matching calls to a new function (longjmp_missing), which should guarantee a match (even if not matching the libc signature). I believe the problem is the definition of jmp_buf which this patch should avert. But if you don't want to test this then I can try it locally. |
I would be happy to test. |
@marshallward have you had a chance to work on this further? I was about to open a ticket against the cce compiler when a college pointed out this from the fortran standard: |
A procedure defined by means of Fortran shall not invoke setjmp or longjmp (ISO/IEC 9899:1999, 7.13). If a procedure defined by means other than Fortran invokes setjmp or longjmp, that procedure shall not cause any procedure defined by means of Fortran to be invoked. A procedure defined by means of Fortran shall not be invoked as a signal handler (ISO/IEC 9899:1999, 7.14.1). |
Yes, we're breaking that bit of the standard, but the patch will disable this function, and will only re-enable them if they are confirmed to be available and work correctly. On our end, this is handled by autoconf. (The interesting part is that it seems to work fine in GNU, Intel, and PGI/Nvidia, but that is probably a separate discussion). I have not tested this on our Cray compilers since I was waiting to hear how you went with the patch, but I can try to find some time and get back to you. |
I'm sorry I thought that you were reworking the patch - do you have something I should try? |
This was the branch: https://github.com/marshallward/MOM6/tree/posix_jmp_fixes I think it will work, since it disables BTW I should have probably mentioned that we do not test in Cray because there are other parts which failed to work correctly. This all predates me, so I don't know if it's still true. How urgent is this on your end? If you do not need it right away, we can push this through our usual process to the |
I can reproduce this on my system, although it is a warning on my end:
The function is only used during unit testing, so would not cause an issue in actual simulations. I am using cce/11.0.4, perhaps these were promoted to errors in cce/15 ? |
I've had a closer look, and I think this is just a bug on our end, which Cray caught:
The |
This patch is much simpler (also addresses the other warning):
If it works, we can talk about how to best put it into the source tree. |
Yes this works in cce/15.0.0 |
@gustavo-marques I can send this as a PR to dev/ncar and we can pick it up when you guys submit to |
@marshallward works for me - thank you. |
Thanks for patiently working through this. I've been expecting problems with those functions for a while now, but luckily this was not (yet) a serious one. |
Using the cray compiler cce/15.0.0 on gust I am seeing an error in file posix.F90
ftn-1279 ftn: ERROR SIGLONGJMP_POSIX, File = ../../../../../work/jedwards/sandboxes/cesm2_x_alpha/components/mom/MOM6/src/framework/posix.F90, Line = 191, Column = 31
Procedure "longjmp" is defined at line 178 (/glade/work/jedwards/sandboxes/cesm2_x_alpha/components/mom/MOM6/src/framework/posix.F90). The type of this argument does not agree with dummy argument "ENV".
The text was updated successfully, but these errors were encountered: