-
Notifications
You must be signed in to change notification settings - Fork 41
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
makefile: workaround boost errors under latest compilers #757
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 is how any system library like that should come in most likely, makes perfect sense.
It looks like this workaround breaks when The three potential paths forward that I see are:
|
Default system paths are included by the `-isystem` method unless otherwise specified. If they are not explicitly added to a -I the warnings should be supppressed just by nature of coming from those places. Note the test lower down in the bug where no listing and -I behave the same.
…Sent from my iPad
On Sep 30, 2020, at 2:18 PM, Stephen Herbein <[email protected]> wrote:
It looks like this workaround breaks when BOOST_PREFIX=/usr, as per this GCC bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129
The two paths forward that I see are:
* Check if BOOST_PREFIX is one of the default system search paths, and if it is, still use -I. Unfortunately, I think this means the warnings will only be silenced if boost isn't in a default system location
* Check if BOOST_PREFIX is one of the default system search paths, and if it is, set BOOST_CPPFLAGS="" and rely on the compiler picking up the header from one of the default paths
* Insert compiler-specific pragmas to turn off warnings for certain includes:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include <third-party-library/header.h>
#pragma GCC diagnostic pop
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub<#757 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAFBFNI5X5H2HXSMZDTFIJDSIOOADANCNFSM4R7RCFRA>.
|
Ok. IIUC it sounds like Any objections to just checking for |
d7e872d
to
02e5495
Compare
That latest change seems to have done the trick. Works on both the Travis tests and under Spack. @trws , can you give the new couple of lines at the end of the boost.m4 a quick look? |
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.
LGTM! This builds correctly on my test system. I did ask one question, but I'm almost sure these changes can be merged. Thanks!
dnl Due to a change in GCC 6+, searching a default system path via -isystem | ||
dnl causes compilation issues. Let the compiler find headers in default | ||
dnl system paths "naturally". | ||
if test "$BOOST_CPPFLAGS" = "-isystem /usr/include" ; then |
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.
Is is possible that $BOOST_CPPFLAGS will resolve to something like -isystem __ /usr/include
(where __
indicates multiple whitsepaces) or -isystem /usr/include/
? I don't see that it's defined elsewhere in flux-sched (and based on the file here these cases won't occur), but I want to make sure.
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.
That's a good question.
I don't see that it's defined elsewhere in flux-sched (and based on the file here these cases won't occur), but I want to make sure.
That was the conclusion of my analysis as well. The only other case I could think of was the user manually specifying the variable at the configuration line BOOST_CPPFLAGS=/usr/include/ ./configure
, but I don't think we can really protect against the user shooting themselves in the foot in that scenario.
Problem: when using the latest gcc/clang compilers, older boost versions create multiple warnings to be emitted. Our use of `-Werror` turns these warnings in boost into hard errors, despite being in a third-party dependency. Solution: use `-isystem` rather than `-I` for the boost cppflags to denote that the boost headers are system-provided headers, which turns off most static analysis warnings for those headers. Special care must be taken to ensure that a compiler default system path (i.e., `/usr/include`) is not passed to `-isystem` to avoid compilation issues in GCC 6+. Related Documentation: - Clang: http://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-in-system-headers - GCC: https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html
02e5495
to
b7d7e19
Compare
Codecov Report
@@ Coverage Diff @@
## master #757 +/- ##
==========================================
+ Coverage 75.94% 75.95% +0.01%
==========================================
Files 82 82
Lines 9220 9220
==========================================
+ Hits 7002 7003 +1
+ Misses 2218 2217 -1
Continue to review full report at Codecov.
|
Problem: when using the latest gcc/clang compilers, older boost versions
create multiple warnings to be emitted. Our use of
-Werror
turnsthese warnings in boost into hard errors, despite being in a third-party
dependency.
Solution: use
-isystem
rather than-I
for the boost cppflags todenote that the boost headers are system-provided headers, which turns
off most static analysis warnings for those headers.
Related Documentation:
Closes #300
Closes #747
Closes #732