Skip to content
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

Closed
wants to merge 6 commits into from

Conversation

MarcelKoch
Copy link
Member

@MarcelKoch MarcelKoch commented Feb 15, 2024

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 between c++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:

@MarcelKoch MarcelKoch self-assigned this Feb 15, 2024
@ginkgo-bot ginkgo-bot added reg:build This is related to the build system. reg:testing This is related to testing. mod:core This is related to the core module. mod:dpcpp This is related to the DPC++ module. labels Feb 15, 2024
//
// SPDX-License-Identifier: BSD-3-Clause

int main() { static_assert(__cplusplus >= CXX_STD); }
Copy link
Member

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+):

Suggested change
int main() { static_assert(__cplusplus >= CXX_STD); }
int main() { static_assert(__cplusplus >= CXX_STD, "Required C++ standard not supported."); }

Copy link
Member

@pratikvn pratikvn left a 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.

cmake/create_test.cmake Show resolved Hide resolved
@@ -112,4 +112,10 @@
// clang-format on


/* Do we support C++17? */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit:

Suggested change
/* Do we support C++17? */
/* Does the CXX compiler support C++17? */

@MarcelKoch MarcelKoch force-pushed the read-distributed-with-index-map branch from c12bac1 to a1d45ac Compare April 2, 2024 07:37
@MarcelKoch MarcelKoch force-pushed the optional-cxx17 branch 2 times, most recently from bb36d91 to c46d056 Compare April 2, 2024 17:31
@MarcelKoch MarcelKoch force-pushed the read-distributed-with-index-map branch from a1d45ac to 07f6d02 Compare April 2, 2024 17:31
@MarcelKoch MarcelKoch force-pushed the read-distributed-with-index-map branch from 07f6d02 to b42ab92 Compare April 4, 2024 10:29
@MarcelKoch MarcelKoch changed the base branch from read-distributed-with-index-map to distributed-row-gatherer April 4, 2024 10:30
@MarcelKoch MarcelKoch force-pushed the distributed-row-gatherer branch 2 times, most recently from 98fa10a to 79de4c3 Compare April 19, 2024 16:19
@MarcelKoch
Copy link
Member Author

This PR is not required anymore. If we decide at a later point to enable c++17 optionally we can revive this.

@MarcelKoch MarcelKoch closed this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod:core This is related to the core module. mod:dpcpp This is related to the DPC++ module. reg:build This is related to the build system. reg:testing This is related to testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants