-
Notifications
You must be signed in to change notification settings - Fork 343
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
GMT fails to build with gcc 10 #2493
Comments
Thanks @opoplawski. Hi @joa-quim, perhaps you should fix this? I suggest just having
in okbfuns.h and then add
|
Not that simple. I need |
Well, then figure about a way to avoid global by passing pointers to functions. Globals are bad news. |
I've been trying to do that but old convoluted code. The problem is exactly the pointers to functions. See grdgravmag3d.c #L1201-1203. If I pass the above vars via args then the functions signature is no longer equal. |
OK, I will have a look later if I have time. Bloody busy the next week though. |
Looks like there is only one exported function in okbfuns.c called okabe that needs to take two more arguments and that is how you pass in okabe_mag_var and okabe_mag_param allocated in the main into okabe which then needs to pass those pointers into functions it calls, such as okb_mag and okb_grv. |
Yes, that would be easy but you haven't looked at my
The problem is that the functions |
Well, I think you just add those two args to all those functions and they are just not used in some of them. That way they have the same # and type of args. |
and change all the places where those functions are called ad add dumb args. Not nice either. |
Maybe @seisman knows how to have cmake pass -fcommon to the compiler for this supplement. |
Changing CMAKE_C_FLAGS should work, but don't have to make it for only one supplement. |
I worry about adding -fcommon to all, but perhaps no big deal since if I read @opoplawski correctly the default used to be -fcommon. Perhaps the solution for now is to add -fcommon to the CMAKE_C_FLAGS while we in the mean time try to eliminate the nasty duplication. |
We can certainly add -fcommon in the Fedora package as well. I just wanted to get this on your radar so that it does get fixed at some point. |
The 3 tests that are affected by this code change pass, but several other cases are not tested and may reserve (bad) surprises.
The 3 tests that are affected by this code change pass, but several other cases are not tested and may reserve (bad) surprises.
@opoplawski #2511 has landed in master. Could you please test if it builds fine now? |
It does, thanks! |
Just checking that it passes with |
It builds fine with gcc 10, so I would say yes. |
Applying patch from upstream master: GenericMappingTools/gmt#2510 Related issue discussion: GenericMappingTools/gmt#2493
Description of the problem
gcc 10 has landed in Fedora Rawhide, and it now defaults to -fno-common. As a result GMT fails to build with:
For example, okabe_mag_param is defined in src/potential/okbfuns.h:
and included in multiple sources rather than declared extern in the header and defined in a single source file.
The text was updated successfully, but these errors were encountered: