-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
C++23 support #838
C++23 support #838
Conversation
Hefty changes necessary to adapt to mdspan interface change from |
56863dc
to
146f5ce
Compare
Let's assess this now before wasting time moving forward on a patch we cannot merge. |
Sounds good, so the local build with a GCC version 13.2 and the macos CI build seem to be passing. Besides that it could become tricky to address the absence of a |
Sounds promising - GCC 11.4.1 on RedHat 9-type distributions is going to be the lower bound. There are quite a few errors there - what do you think? Regarding mdspan, can't we keep on using the Kokkos one in all cases for now? Even if there is one built in. |
They seem to be all caused by some static assert/requirement. Not sure why this is a problem in these cases and otherwise not though. Will try with the Kokkos |
How was the |
Kokkos mdspan does claim to support GCC 11 with C++23 with Wall, see their README. @garth-wells has done the mdspan header copy in the past. |
See https://github.com/kokkos/mdspan/tree/single-header. |
OK we have 2 builds passing, macos and the dolfinx integration are working (at least the basix build) |
Have you guys maybe got an idea what may be the cause for the very weird error I'm getting with this small snippet to test why the ubuntu builds are failing? Note that I can access with a This is observed with gcc version 11.4 #include "mdspan.hpp"
template <typename T, std::size_t D>
using mdspan_t = MDSPAN_IMPL_STANDARD_NAMESPACE::mdspan<T, MDSPAN_IMPL_STANDARD_NAMESPACE::dextents<std::size_t, D>>;
template<class...IndexType>
void pass(IndexType... indices)
{
static_assert(sizeof...(IndexType) == 2);
}
void test()
{
mdspan_t<double, 2> span;
static_assert(span.rank() == 2);
std::array<std::size_t, 2> indices = {0, 0};
static_assert(indices.size() == 2);
span[indices];
pass(0, 0);
static_assert(std::is_convertible_v<decltype((0,0)), mdspan_t<double, 2>::index_type>);
static_assert(std::is_nothrow_constructible_v<mdspan_t<double, 2>::index_type, decltype((0,0))>);
span[0, 0]; // but this fails with (rank() == sizeof...(SizeTypes)) evaluating to False
}
|
Okay a small update, I experimented with not updating the |
2e527cf
to
8dc7685
Compare
Not enforcing the standard fixes the cmake error with the intel compiler. It looks like they are not fully ready to support the iso standard for c++23 so it gets a different flag - which I assume causes the problem: https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2023-0/std-qstd.html I am not aware of how I could hint cmake to use this flag, and turning off the standard enforcement also is no good solution I imagine. How should we ago about this? |
Would be worth checking with a very modern version of Cmake installed in the CI to see if it passes the right flag. Otherwise you can detect the Intel Compiler and pass the flag manually. |
Newer |
As an aside, MSVC also doesn't support P2128R6 Multidimensional subscript operator yet so this is the right way to go for now. |
And PR2128R6 was only added in GCC 12 according to this RedHat article https://developers.redhat.com/articles/2022/04/25/new-c-features-gcc-12#c__23_features |
That could explain my findings with the code snippet before - not sure how it explains the assertion going off though. |
Is the website failure caused by the here introduced changes or does this originate from somewhere else? |
Something to do with documentation build - I don't fully understand the error (some sort of deprecation warning). |
Yeah, very weird, I'm not even sure it's the deprecation warning though. Never used any of the packages that get used for the website construction, so I'm not sure how to go about it. |
Should be fixed with FEniCS/web#187. |
No description provided.