-
Notifications
You must be signed in to change notification settings - Fork 281
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
mpl: failed to declare aligned_alloc on PPC64 #5101
Conversation
I had a build on a PPC64 RH7.5 system that failed saying aligned_alloc() needed declared. What happened is _GNU_SOURCE was used during configure (comes from mpl/include/config.h.in) so when automake queries if aligned_alloc() is declared it detects that it is. But the include order used in various .c/.h doesn't guarantee that mpl.h is included before stdlib.h and the declaration only appears if _GNU_SOURCE comes before stdlib.h Signed-off-by: Mark Allen <markalle@us.ibm.com>
I am hesitating with this fix, it is adding a permanent function call overhead. Meanwhile, I suspect there is a root-issue that we can address. Let me investigate it a little. |
I am not able to reproduce the issue. Currently in romio configure.ac it also has Anyway, if the issue is inclusion order, then the fix should be to fix the inclusion order. |
How about just removing FWIW, I do run into a case where an |
I believe the issue is in our configure process, in particular, the use of |
Fair enough. Let me see if I can reproduce it in the next day or two and report back. |
I just saw that warning of |
This one is easily fixed by pushing mpl.h to the top of the include order in |
Submitted #5150 for review. I dug up 4fcffbe from long ago that addressed a similar situation. |
Closing this PR. |
I commented over in #5150 just now. #5150 does solve the specific problem I hit, but I think it's imposing a significant include order burden. You can't just worry about when mpl.h is included, but also anything that includes it indirectly, so the requirement sprawls out recurisvely. And I think ultimately it implies that all non-system includes have to come before all system includes or else you're potentially including the system's declaration of aligned_alloc() before mpl.h has set _GNU_SOURCE. As examples I'm still suspicious of ad_lustre.h for example, because it includes unistd.h in before adio.h, and so does ad_xfs.h. I don't think I can be sure those are the only cases |
The config header to be included first is fundamental to how GNU Autotools are designed. Without that guarantee, many configure mechanisms will break. You are essentially shifting the burden to configure scripts, that it can't use any system extension declarations. But I think your assessment of burden is overstated. Every package has just one config header, for mpich, it is |
I guess as long as all config files, include the same settings like _GNU_SOURCE then the burden doesn't sprawl as greatly as I worried. Eg when one package includes another like romio using MPL we have
So I think I'm okay with what you're describing as long as romioconf.h has the _GNU_SOURCE setting. Then it just comes down to individual direct violations of the rule (not complex recursive violations) and that's not nearly as concerning. At a glance I still see a few violations: |
I see. That is a bit messy. It should be solved systematically. For example, in mpich, we have BTW,
We should fix them. |
Okay, I think I did what you described at #5184 |
Thanks for auditing: for many years MPICH tried hard not to use _GNU_SOURCE , so it didn't matter when we included configure.h . At some point _GNU_SOURCE was useful enough to check for but a lot of header files were not updated. |
I had a build on a PPC64 RH7.5 system that failed saying
aligned_alloc() needed declared. What happened is _GNU_SOURCE
was used during configure (comes from mpl/include/config.h.in)
so when automake queries if aligned_alloc() is declared it
detects that it is. But the include order used in various
.c/.h doesn't guarantee that mpl.h is included before stdlib.h
and the declaration only appears if _GNU_SOURCE comes before
stdlib.h
Signed-off-by: Mark Allen markalle@us.ibm.com