Skip to content

Explicitly set cxx standard for GNU compiler#599

Closed
mcfadden8 wants to merge 2 commits intodevelopfrom
bugfix/mcfadden8/explicitly-set-cxx-std-for-gnu
Closed

Explicitly set cxx standard for GNU compiler#599
mcfadden8 wants to merge 2 commits intodevelopfrom
bugfix/mcfadden8/explicitly-set-cxx-std-for-gnu

Conversation

@mcfadden8
Copy link
Copy Markdown
Contributor

@mcfadden8 mcfadden8 commented Sep 30, 2022

Newer versions of the GNU compiler uses a may use newer c++ standards which could cause cmake compilation tests to yeild false-positive results when it says that a c++17 feature exists and is usable by when the target/using is actually building c++14 targets.

The problem caused the check_cxx_source_compiles check (https://github.com/LLNL/Umpire/blob/develop/cmake/SetupCompilerFlags.cmake#L14-L27) to produce a false-positve because it was using running g++ without any -std=c++14 argument. The default c++ standard for 11.2.0 g++ is 17. So, this check would succeed and the Umpire source code would fail to compile later since it was using -std=c++14

NOTE: This PR contains one fix and one hack. The hack needs to be resolved before this may be considered for merging.

NOTE 2: I've attempted to address the hack mentioned above by separating out the initialization of the compiler family variables to a different (new) file and am including that file earlier in BLTMacros.cmake.

This problem was reported by a spack user here and is internally documented in an Umpire jira ticket here.

Newer versions of the GNU compiler uses a may use newer c++ standards
which could cause cmake compilation tests to yeild false-positive
results when it says that a c++17 feature exists and is usable by when
the target/using is actually building c++14 targets.
@mcfadden8
Copy link
Copy Markdown
Contributor Author

Closing this since it will be addressed by #600

@mcfadden8 mcfadden8 closed this Oct 3, 2022
@mcfadden8 mcfadden8 deleted the bugfix/mcfadden8/explicitly-set-cxx-std-for-gnu branch October 3, 2022 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant