-
Notifications
You must be signed in to change notification settings - Fork 89
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
Allow to optionally use C++17 #1548
Conversation
111ff51
to
56b1dc6
Compare
// | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
int main() { static_assert(__cplusplus >= CXX_STD); } |
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.
static_assert
should also have an error string (unless it's C++17+):
int main() { static_assert(__cplusplus >= CXX_STD); } | |
int main() { static_assert(__cplusplus >= CXX_STD, "Required C++ standard not supported."); } |
56b1dc6
to
e4c2467
Compare
12f8ab3
to
c12bac1
Compare
e4c2467
to
b6c6932
Compare
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! I think we need to note that this will might break the OpenCARP pipelines ? Because they want to explicitly set to C++14. It is not an issue, but probably needs an update from their side to set the GINKGO_CXX_STANDARD
.
@@ -112,4 +112,10 @@ | |||
// clang-format on | |||
|
|||
|
|||
/* Do we support C++17? */ |
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.
minor nit:
/* Do we support C++17? */ | |
/* Does the CXX compiler support C++17? */ |
c12bac1
to
a1d45ac
Compare
bb36d91
to
c46d056
Compare
a1d45ac
to
07f6d02
Compare
c46d056
to
9546c60
Compare
07f6d02
to
b42ab92
Compare
6b4521b
to
ae60198
Compare
9546c60
to
3698fb5
Compare
ae60198
to
49557f1
Compare
3698fb5
to
4c69493
Compare
49557f1
to
4a79442
Compare
4c69493
to
2aa609c
Compare
2aa609c
to
f2559d9
Compare
4a79442
to
172eb7d
Compare
f2559d9
to
b5fdf42
Compare
98fa10a
to
79de4c3
Compare
This PR is not required anymore. If we decide at a later point to enable c++17 optionally we can revive this. |
Based on: #1544
This PR allows to optionally use C++17. If the CMake option
CMAKE_CXX_STANDARD
is set, this will be the standard that is used to compile ginkgo. If this option is not used, then the highest available standard betweenc++14, c++17
will be used.Additionally, the macro
GINKGO_HAVE_CXX17
will be set to true or false, depending on the standard.Exception: DPCPP will still use C++17, and I have no idea of how the HIP setup works, but I'm guessing that it will ignore this.
PR Stack: