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

remove cmake logic for -fconcepts and -fconcepts-ts flags #379

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

nmm0
Copy link
Contributor

@nmm0 nmm0 commented Feb 14, 2025

I'm suggesting that we remove the logic in our cmake that tries to add the -fconcepts and -fconcepts-ts flags.

First of all, the -fconcepts-ts branch is broken, because the condition checks COMPILER_SUPPORTS_FCONCEPTS instead of COMPILER_SUPPORTS_FCONCEPTS_TS, so it wasn't used anyway.

Secondly, pretty much every modern compiler will enable this if you enable -std=c++20, and we only add this flag if we enable -std=c++20. In the rare cases someone is trying to build mdspan on a platform that doesn't do this, they can simply add -DCMAKE_CXX_FLAGS=-fconcepts to their cmake command line invocation or preset.

Note that us manually adding this flag breaks builds in small niche use cases (that can easily be worked around); i.e. when using CMAKE_CXX_CLANG_TIDY with gcc as clang does not recognize the flag but it is forced on. So the motivation for this is pretty minor but I think it would be good to clean up some of our cmake anyway.

…pts-ts` branch was broken and the flag is enabled by default in C++20 mode
@nmm0
Copy link
Contributor Author

nmm0 commented Mar 3, 2025

Also, GCC 15 is removing support for -fconcepts-ts. It won't have any effect anymore.

Copy link
Contributor

@mhoemmen mhoemmen left a comment

Choose a reason for hiding this comment

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

Thanks @nmm0 ! : - ) config.hpp doesn't seem to use this CMake option anyway, so removing this shouldn't change the code.

Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning that up

@dalg24 dalg24 merged commit b092922 into kokkos:stable Mar 4, 2025
15 checks passed
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.

3 participants