Cantera / enhancements

Repository for proposed and ongoing enhancements to Cantera
11 stars 5 forks source link

Transition to C++14 #152

Closed ischoegl closed 2 years ago

ischoegl commented 2 years ago

Abstract

Now that Cantera 2.6 is released (which uses c++11), I wanted to post an update for discussion. Per comments elsewhere:

For Ubuntu, 16.04 just passed beyond Canonical's "end of support" period, which I tend to think of as sufficient for not worrying about it for new versions. 16.04 had GCC 5, and 18.04 has GCC 7.4 by default, so I guess C++14 is a pretty safe target there. For RHEL, though, it looks like RHEL7 is still a supported release, and it only has GCC 4.8, so we'd be leaving that version behind. I honestly don't know how much of an issue that is. RHEL8 was only released in mid-2019, and I know a lot of HPC systems tend to be pretty slow to upgrade. On the other hand, there are options for installing compilers besides the system packages (conda and spack, for example), so such users aren't completely without options.

Also:

Clang finished support for C++14 in 3.4 though under the standard name c++1y, and made C++14 the default C++ standard in Clang 6. GCC finished support for C++14 in GCC 5, and made C++14 the default C++ standard in GCC 6. Microsoft Visual Studio 2017 has implemented "almost all" C++14 features.

There just was an issue report about RHEL 7 and Cantera 2.6 (Cantera/cantera#1277), where there appear to be some issues with compiling Cantera with the default stack even while still supporting c++11.

speth commented 2 years ago

I'm not opposed to moving to C++14 now that 2.6.0 is out, but I think this decision should be based on the existence of useful features in the language standard. I don't see a lot of features relevant to Cantera in the list of new features in C++14. On the other hand, C++17 has some new features that I can see being broadly useful, such as structured bindings, but I don't know if we want to shift the required compiler versions that far just yet.

ischoegl commented 2 years ago

From the feature perspective, I don’t see a major advantage of c++14 either.