You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's been 4 years since issue #1659 (2019), where we kept track of the C++11 transition for LAMMPS, and 3 years (2020) since C++11 was allowed in LAMMPS core.
In a similar way, this issue now documents the current state of common compilers among popular Linux distributions.
By now, moving to C++14 is a trivial change, since most compilers at least default to C++14, if not already C++17.
The only exception is the default RHEL7 compiler, which barely supports C+11. I personally don't consider this a blocker, given that most HPC centers, even if they still use RHEL7-based systems, will provide newer GCC compilers.
As a side note, GCC versions prior to v9.x should not be used for C++17 due to various quirks and bugs.
Currently, C++17 is currently only required by KOKKOS 4.
Proposal to assess impact
// for C++14
#ifndef LAMMPS_CXX14
#if __cplusplus <= 201402L
#error LAMMPS is planning to transition to C++14. Do disable this error please use a C++14-compliant compiler or define LAMMPS_CXX14 in your makefile
#endif
#endif// alternative for C++17
#ifndef LAMMPS_CXX17
#if __cplusplus <= 201703L
#error LAMMPS is planning to transition to C++17. Do disable this error please use a C++17-compliant compiler or define LAMMPS_CXX17 in your makefile
#endif
#endif
Unlike with C++11 there is currently little external pressure from contributors to use a more recent C++ standard.
Internally, there is currently only Kokkos requiring a post-C++11 standard.
The latest Googletest release (1.13) requires C++14, but we don't use any of its features, so we can stick with version 1.12 for now. It also would not be a problem to raise the C++ standard only for testing, since this is not considered a core functionality of LAMMPS from the user perspective (very few users enable and use testing).
libfmt is "self-adapting" for C++11 to C++20. The latest development version still is compatible with C++11 without loss of functionality.
If we bring this to a LAMMPS developer discussion, there should be a list of benefits, i.e. new features or corrections in C++14 (or C++17?) that would have a positive impact on LAMMPS or could remove workarounds and/or inefficient or complex code. I would thus want to wait before adding the pre-processor check until a consensus about if and when to make a change is found.
Summary
It's been 4 years since issue #1659 (2019), where we kept track of the C++11 transition for LAMMPS, and 3 years (2020) since C++11 was allowed in LAMMPS core.
In a similar way, this issue now documents the current state of common compilers among popular Linux distributions.
By now, moving to C++14 is a trivial change, since most compilers at least default to C++14, if not already C++17.
The only exception is the default RHEL7 compiler, which barely supports C+11. I personally don't consider this a blocker, given that most HPC centers, even if they still use RHEL7-based systems, will provide newer GCC compilers.
As a side note, GCC versions prior to v9.x should not be used for C++17 due to various quirks and bugs.
Currently, C++17 is currently only required by KOKKOS 4.
Proposal to assess impact
Target Platforms
-std=c++11
)-std=c++11
)Testing default C++ compiler standard
References:
The text was updated successfully, but these errors were encountered: