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

Mimimal compiler version #5810

Closed
etam opened this issue Mar 30, 2024 · 5 comments
Closed

Mimimal compiler version #5810

etam opened this issue Mar 30, 2024 · 5 comments

Comments

@etam
Copy link

etam commented Mar 30, 2024

In COMPILING.txt it says

Pioneer is known to build on the following platforms and build systems:
Linux: CMake with GCC 4.9+ or Clang 6+

The commit eada00c uses std::reduce, which comes from c++17. This raises the required minimal compiler version.

With g++ 7 cmake adds flag -std=gnu++1z, but the std::reduce is available since g++ 9.

@Gliese852
Copy link
Contributor

Oh, apparently this is outdated information, we have been in C++17 for quite a long time

set(CMAKE_CXX_STANDARD 17)

Interesting that you had no problems for example with std::variant:

using PropertyBase = std::variant<

or with std::string_view:

size_t SplitString::step(std::string_view str)

@etam
Copy link
Author

etam commented Mar 30, 2024

I don't know if I have no problem with those other things. The compilation on the older system stops at the std::reduce and doesn't go any further.
It's not a problem for me and I'm not asking for compatibility.
It just means that COMPILING.txt needs a bit of an update.

@Gliese852
Copy link
Contributor

Yeah, I just wanted to point out that commit eada00c does not raise the required minimal compiler version.

@impaktor
Copy link
Member

impaktor commented Apr 2, 2024

So we should bump minimal GCC version from 4.9 to 9+?
And possibly clang from 6+ to 9+?

@Web-eWorks
Copy link
Member

Clang 6 has 99% of C++17 support already present. All filed Defect Reports against C++17 are fully implemented as of Clang 9, though the only fixes which are not present in Clang 7 are to [[nodiscard]] constructors and structured bindings, which we do not make use of in the Pioneer codebase.

That being said, Clang 9 is ~4 years old at this point and can be expected to be present on most LTS distributions (e.g Ubuntu 20.04 uses Clang 10 as the default clang package). Feel free to bump the version. GCC 9 is also a good minimum base, as it is the first release with a stable ABI for C++17 (according to the GCC documentation).

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

No branches or pull requests

4 participants