Skip to content

Conversation

@hjelmn
Copy link
Member

@hjelmn hjelmn commented Nov 14, 2019

This fixes a bug in the configuration system identified by a
change in the C++ standard. C++20 adds a new mandatory header
named version. This (and any system) header will always be
included with <> and not "". On case-insensitive filesystems
this new header conflicts with the VERSION file at the top
level of the build tree.

To fix this issue Open MPI needs to use -iquote instead of -I
for non-system include paths to ensure that these include are
only searched for the quote form of include. This commit also
adds a check to ensure that if the compiler does not support
-iquote that it falls back to -I until support can be added.

Fixes #7155

Signed-off-by: Nathan Hjelm [email protected]

@hjelmn
Copy link
Member Author

hjelmn commented Nov 14, 2019

@isuruf Please test to verify this fixes the issue.

@ibm-ompi
Copy link

The IBM CI (GNU Compiler) build failed! Please review the log, linked below.

Gist: https://gist.github.com/413fde5d1cc19b7aef62ab7b8976026e

@ibm-ompi
Copy link

The IBM CI (XL Compiler) build failed! Please review the log, linked below.

Gist: https://gist.github.com/4e1d87832c39a6b596d5567ae6df7e3b

@isuruf
Copy link

isuruf commented Nov 15, 2019

Unfortunately this does not work. This would work only if there were only implementation files in the repo directory and they used quotes to find the header files.

@ggouaillardet
Copy link
Contributor

I'll have a look at it and see if that can be fixed.

BTW, +1 for the branch name :-)

@rhc54
Copy link
Contributor

rhc54 commented Nov 15, 2019

I strongly disagree with the WG21 person who told you this is "our problem". Their action is equivalent to us declaring a global symbol called "x" and then insisting that any program which conflicts with that symbol is "wrong".

The accepted way of "taking" a namespace is to prefix or suffix the name with something associated with your software. Thus, WG21 should have declared the required file to be something like "version.cpph" or "cpp.version.h" - and not just blanket declare ownership of the name "version".

This whole thing is absurd and unnecessary. If some standards body is going to be this stupid, then we shouldn't enable them. Just detect that the compiler has a conflict with "version" and abort with an error message directing the user to use some other compiler - and tell their vendor to stop being dumb about it.

@hjelmn
Copy link
Member Author

hjelmn commented Nov 15, 2019

@ggouaillardet I see the problem. Fixing.

@hjelmn
Copy link
Member Author

hjelmn commented Nov 15, 2019

@rhc54 I don't disagree with you in the slightest. I do think with should disallow #include <> for internal Open MPI headers so this PR is not the worst idea :).

@hjelmn
Copy link
Member Author

hjelmn commented Nov 15, 2019

@ggouaillardet @rhc54 The discussion is better in a private-ish channel. More in slack.

@ggouaillardet
Copy link
Contributor

@hjelmn I just noted your comment and pushed my fixes to this PR

@hjelmn
Copy link
Member Author

hjelmn commented Nov 15, 2019

@ggouaillardet Indeed. Beat me by 30 seconds! Ok, I will reorder the changes now so the fixes come before the -iquote change.

@hjelmn hjelmn force-pushed the fix_what_wg21_calls_our_problem_not_theirs_seriously__in_some_ways_they_are_correct_but_wtf branch from 1b3111f to a048b3c Compare November 15, 2019 02:17
@hjelmn
Copy link
Member Author

hjelmn commented Nov 15, 2019

@ggouaillardet Done. @isuruf Should work now.

@ggouaillardet
Copy link
Contributor

@hjelmn feel free to squash both commits and/or reword my commit message

@hjelmn
Copy link
Member Author

hjelmn commented Nov 15, 2019

@ggouaillardet They should be separate I think. Makes it clear why that change was done.

@ggouaillardet
Copy link
Contributor

fair enough, and in that case, my commit message has to be rewritten.

@hjelmn
Copy link
Member Author

hjelmn commented Nov 15, 2019

Indeed. Will update the commit message.

@ggouaillardet ggouaillardet force-pushed the fix_what_wg21_calls_our_problem_not_theirs_seriously__in_some_ways_they_are_correct_but_wtf branch from a048b3c to a393f68 Compare November 15, 2019 04:08
@hjelmn hjelmn force-pushed the fix_what_wg21_calls_our_problem_not_theirs_seriously__in_some_ways_they_are_correct_but_wtf branch from a393f68 to 4237a6c Compare November 15, 2019 04:27
@ggouaillardet ggouaillardet force-pushed the fix_what_wg21_calls_our_problem_not_theirs_seriously__in_some_ways_they_are_correct_but_wtf branch from 4237a6c to 194f681 Compare November 15, 2019 04:54
@jsquyres
Copy link
Member

This looks like a good idea (many thanks, @hjelmn!), but I'm really not going to have an opportunity to think about this deeply / review it properly until after SC. Can we hold off on merging until after SC / Thanksgiving, perchance?

@hjelmn
Copy link
Member Author

hjelmn commented Nov 15, 2019

Did a little more digging:

  • gcc/icc/g++/icpc: -I directories will take precedence over stdc++ and system directories. must use -iquote.
  • xlc/xlc++: c++ standard library search paths take precedence over -I unless -qcpp_stdinc is specified. so nothing to do.
  • pgcc/pgc++: I don't see anything we can do here other than explicitly add a -I for the stdc++ search path. -I always takes precedence.

@hjelmn hjelmn force-pushed the fix_what_wg21_calls_our_problem_not_theirs_seriously__in_some_ways_they_are_correct_but_wtf branch 2 times, most recently from a8b40bb to 6ea574b Compare November 15, 2019 19:41
@hjelmn
Copy link
Member Author

hjelmn commented Nov 15, 2019

This PR will only be merged after the thanksgiving break since the next two weeks are busy for many of us.

@isuruf
Copy link

isuruf commented Nov 16, 2019

I tried this on OSX with clang 9 and it works. Thanks @hjelmn, @ggouaillardet

ggouaillardet and others added 2 commits March 9, 2020 21:13
This commit fixes an issue with the include usage in some
ompi source files. These source files are using the <> form
of include when the "" form is correct (as these are internal,
**not** system headers).

Signed-off-by: Gilles Gouaillardet <[email protected]>
Signed-off-by: Nathan Hjelm <[email protected]>
This fixes a bug in the configuration system identified by a
change in the C++ standard. C++20 adds a new mandatory header
named version. This (and any system) header will always be
included with <> and not "". On case-insensitive filesystems
this new header conflicts with the VERSION file at the top
level of the build tree.

To fix this issue Open MPI needs to use -iquote instead of -I
for non-system include paths to ensure that these include are
only searched for the quote form of include. This commit also
adds a check to ensure that if the compiler does not support
-iquote that it falls back to -I until support can be added.

References open-mpi#7155

Signed-off-by: Nathan Hjelm <[email protected]>
@jsquyres jsquyres force-pushed the fix_what_wg21_calls_our_problem_not_theirs_seriously__in_some_ways_they_are_correct_but_wtf branch from 6ea574b to a6212fe Compare March 10, 2020 12:38
@jsquyres
Copy link
Member

@hjelmn Somehow this PR fell off our radar in the post-SC/Thanksgiving/Christmas crush.

I just rebased it to top of master and fixed some conflicts. Please verify, and then let's merge.

@jsquyres
Copy link
Member

This time, Cray had a false error (network connectivity to github). Try again...

bot:ompi:retest

@hjelmn
Copy link
Member Author

hjelmn commented Mar 30, 2020

Looks good to go.

@jsquyres
Copy link
Member

@hjelmn We require github reviews on master now. Can you please give a formal review? 😄

@hjelmn
Copy link
Member Author

hjelmn commented Mar 30, 2020

Can i review my own PR?

@hjelmn hjelmn merged commit 160ff18 into open-mpi:master Mar 30, 2020
@jsquyres
Copy link
Member

ZOMG. I forgot this was your PR! Hahaha!

Ok, I just reviewed. :-)

rhc54 added a commit to rhc54/openpmix that referenced this pull request Apr 4, 2020
This fixes a bug in the configuration system identified by a
change in the C++ standard. C++20 adds a new mandatory header
named version. This (and any system) header will always be
included with <> and not "". On case-insensitive filesystems
this new header conflicts with the VERSION file at the top
level of the build tree.

To fix this issue PMIx needs to use -iquote instead of -I
for non-system include paths to ensure that these include are
only searched for the quote form of include. This commit also
adds a check to ensure that if the compiler does not support
-iquote that it falls back to -I until support can be added.

Tracks open-mpi/ompi#7169

Signed-off-by: Ralph Castain <[email protected]>
rhc54 added a commit to rhc54/openpmix that referenced this pull request Apr 4, 2020
This fixes a bug in the configuration system identified by a
change in the C++ standard. C++20 adds a new mandatory header
named version. This (and any system) header will always be
included with <> and not "". On case-insensitive filesystems
this new header conflicts with the VERSION file at the top
level of the build tree.

To fix this issue PMIx needs to use -iquote instead of -I
for non-system include paths to ensure that these include are
only searched for the quote form of include. This commit also
adds a check to ensure that if the compiler does not support
-iquote that it falls back to -I until support can be added.

Tracks open-mpi/ompi#7169

Signed-off-by: Ralph Castain <[email protected]>
rhc54 added a commit to rhc54/openpmix that referenced this pull request Apr 4, 2020
This fixes a bug in the configuration system identified by a
change in the C++ standard. C++20 adds a new mandatory header
named version. This (and any system) header will always be
included with <> and not "". On case-insensitive filesystems
this new header conflicts with the VERSION file at the top
level of the build tree.

To fix this issue PMIx needs to use -iquote instead of -I
for non-system include paths to ensure that these include are
only searched for the quote form of include. This commit also
adds a check to ensure that if the compiler does not support
-iquote that it falls back to -I until support can be added.

Tracks open-mpi/ompi#7169

Signed-off-by: Ralph Castain <[email protected]>
rhc54 added a commit to rhc54/prrte that referenced this pull request Apr 6, 2020
This fixes a bug in the configuration system identified by a
change in the C++ standard. C++20 adds a new mandatory header
named version. This (and any system) header will always be
included with <> and not "". On case-insensitive filesystems
this new header conflicts with the VERSION file at the top
level of the build tree.

To fix this issue PRRTE needs to use -iquote instead of -I
for non-system include paths to ensure that these include are
only searched for the quote form of include. This commit also
adds a check to ensure that if the compiler does not support
-iquote that it falls back to -I until support can be added.

Tracks open-mpi/ompi#7169

Fixes openpmix#481

Signed-off-by: Ralph Castain <[email protected]>
cpshereda pushed a commit to cpshereda/openpmix that referenced this pull request Apr 16, 2020
This fixes a bug in the configuration system identified by a
change in the C++ standard. C++20 adds a new mandatory header
named version. This (and any system) header will always be
included with <> and not "". On case-insensitive filesystems
this new header conflicts with the VERSION file at the top
level of the build tree.

To fix this issue PMIx needs to use -iquote instead of -I
for non-system include paths to ensure that these include are
only searched for the quote form of include. This commit also
adds a check to ensure that if the compiler does not support
-iquote that it falls back to -I until support can be added.

Tracks open-mpi/ompi#7169

Signed-off-by: Ralph Castain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libc++ version header conflict

7 participants