#2207: support all of C++11 in Cactus or the Einstein Toolkit ---------------------------------+------------------------- Reporter: Roland Haas | Type: enhancement Status: new | Priority: minor Milestone: | Component: Cactus Version: development version | Keywords: ---------------------------------+------------------------- We are currently allowing a subset of C++11 to be used in Cactus and the Einstein Toolkit. Looking at configure.in the supported features are:
* the auto specifier * C++ lambdas * C++ range based for
To support all interesting features one would need at least icpc 15 as well as g++ 4.8 and clang 3.3.
== Compiler support ==
The major compilers provide the following information on the features they support:
* [[http://en.cppreference.com/w/cpp/compiler_support%7COverview on cppreference.com]] * [[http://software.intel.com/en-us/articles/c0x-features-supported-by- intel-c-compiler|Features supported by Intel compilers]] * [[http://gcc.gnu.org/projects/cxx0x.html%7CFeatures supported by gcc compilers]] * [[http://clang.llvm.org/cxx_status.html%7CFeatures supported by clang compilers]]
This summarizes the specific C++11 **language** features.
|| ||= Description =||= GCC version =||= Intel version =||= Clang version =||= Notes =|| ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm|N2672]] =|| initializer lists || 4.4 || 14.0 || 3.1 || Wikipedia: [[http://en.wikipedia.org/wiki/C%2B%2B11#Initializer_lists%7C(1)]] [[http://en.wikipedia.org/wiki/C%2B%2B11#Uniform_initialization%7C(2)]] || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf|N2242]] \ [[http://www .open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf|N2552]] =|| variadic templates || 4.3 \ 4.4 || 12.1 || 2.9 || Wikipedia: [[http://en.wikipedia.org/wiki/Variadic_template%7C(1)]] || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf|N1737]] \ [[http://www .open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf|N1984]] =|| ''auto'' type || 4.4 || 12.0 || 2.9 || Wikipedia: [[http://en.wikipedia.org/wiki/C%2B%2B11#Type_inference%7C(1)]] || ||= [[http://www.open- std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html|N2930]] =|| range-based for loops || 4.6 || 13.0 || 3.0 || Wikipedia: [[http://en.wikipedia.org/wiki/C%2B%2B11#Range-based_for_loop%7C(1)]] || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf|N2431]] =|| ''nullptr'' constant || 4.6 || 12.1 || 3.0 || Wikipedia: [[http://en.wikipedia.org/wiki/C%2B%2B11#Null_pointer_constant%7C(1)]] || ||= [[http://www.open- std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf|N2927]] =|| lambda functions || 4.5 || 12.0 || 3.1 || Wikipedia: [[http://en.wikipedia.org/wiki/Anonymous_function#C.2B.2B_.28since_C.2B.2B11.2...)]] || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2010/n3052.html|N3052]] =|| lambda function conversions || ? || 13.0 || ? || || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf|N2761]] =|| standardized attributes || 4.8 || 12.1 || 3.3 || Wikipedia: [[http://en.wikipedia.org/wiki/C%2B%2B11#Attributes%7C(1)]] || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf|N1986]] =|| delegating constructors || 4.7 || 14.0 || 3.0 || Wikipedia: [[http://en.wikipedia.org/wiki/C%2B%2B11#Object_construction_improvement%7C(1)]] || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html|N2118]] =|| rvalue references || 4.3 || 12.0 || 2.9 || Wikipedia: [[http://en.wikipedia.org/wiki/C%2B%2B11#Rvalue_references_and_move_constructo...)]] || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm|N2346]] =|| defaulted and deleted methods || 4.4 || 12.0 || 2.9, 3.0 || Wikipedia: [[http://en.wikipedia.org/wiki/C%2B%2B11#Explicitly_defaulted_and_deleted_spec...)]] || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm|N2442]] =|| raw string literals || 4.5 || 14.0 || 3.0 || Stackoverflow: [[http://stackoverflow.com/a/5460235%7C(1)]] || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf|N2235]] =|| generalized constant expressions || 4.6 || 14.0 || 3.1 || Wikipedia: [[http://en.wikipedia.org/wiki/C++11#constexpr_.E2.80.93_Generalized_constant_...)]] || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf|N2343]] \ [[http://www .open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf|N3276]] =|| declared type of an expression || 4.3 \ 4.8.1 || 12.0 || 2.9 \ 3.1 || Wikipedia: [[http://en.wikipedia.org/wiki/Decltype%7C(1)]] || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf|N2437]] =|| explicit conversion operators || 4.5 || 13.0 || 3.0 || Stroustrup 4th edition, 18.4.2 || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html|N1757]] =|| right angle brackets || 4.3 || 11.1 || 2.9 || ''>>'' for template arguments || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm|N3272]] =|| override and final || 4.7 || 14.0 || 3.0 || Wikipedia: [[http://en.wikipedia.org/wiki/C%2B%2B11#Explicit_overrides_and_final%7C(1)]] || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf|N2258]] =|| template aliases || 4.7 || 12.1 || 3.0 || Wikipedia: [[http://en.wikipedia.org/wiki/C%2B%2B11#Alias_templates%7C(1)]] || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html|N3053]] =|| move special member functions || 4.6 || 14.0 || 3.0 || || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm|N2659]] =|| thread-local storage || 4.8 || 15.0 || 3.3 || || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf|N2341]] =|| Alignment support || 4.8 || 15.0 || 3.3 || || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2008/n2756.htm|N2756]] =|| Non-static data member initializers || 4.7 || 14.0 || 3.0 || || ||= [[http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf|N2347 ]] || Strongly- typed enums || 4.4 || 14.0 || 2.9 || ||
This summarizes the specific C++11 **library** features.
||= Description =||= libstdc++ version =||= libc++ version =||= Notes =|| || ''std::begin'', ''std::end'' || 4.5 || * || || || smart pointers || <4.5 || * || Wikipedia: [[http://en.wikipedia.org/wiki/Smart_pointer#C.2B.2B_smart_pointers%7C(1)]] \ Conversion between smart pointers to convertible types is not supported until libstdc++-4.6.1 || || ''std::map::emplace'' || 4.8 || || || || ''std::vector::emplace'' || <4.5 || * || || || ''<regex>'' || 4.9 || || cplusplus.com: [[http://www.cplusplus.com/reference/regex/%7C(1)]] || || ''<type_traits>'' || <4.5 || || cplusplus.com: [[http://www.cplusplus.com/reference/type_traits/%7C(1)]] || || ''<chrono>'' || 4.4 || || Stroustrup 4th edition || || ''<atomic>'' || 4.5 || || cplusplus.com: [[http://www.cplusplus.com/reference/atomic/%7C(1)]] \ std::atomic::exchange does not compile for pointer types with Intel 13 (works with Intel 14) || || ''std::array'' || <4.6 || || || || ''std::to_string'' || || || || || ''std::unordered_map'' || || || || || || ''std::function'' || <=4.6 || || || * First version unknown; libc++ claims [[http://libcxx.llvm.org/index.html #dir-structure|full support]] for all C++11 features.\ See the [[https://gcc.gnu.org/onlinedocs/gcc-4.6.4/libstdc++/manual/manual/status.html... documentation]] (under 20.9.4.3) for a list of unsupported traits.
#2207: support all of C++11 in Cactus or the Einstein Toolkit --------------------------+--------------------------------- Reporter: Roland Haas | Owner: (none) Type: enhancement | Status: new Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+---------------------------------
Comment (by Roland Haas):
I had a look at the (non-personal machines) in simfactory2.
=== unknown status === * angel.ini * compute1.ini * compute20.ini * compute2.ini * compute3.ini * compute4.ini * compute5.ini * compute.ini * nvidia1.ini * nvidia.ini * pi0005009.ini * titan.ini
* vesta.ini # uses the IBM compiler (a Blue Gene/Q)
=== likely turned off ==== * philip.ini * shelob.ini * s-kraken.ini
=== too old if on === * saw.ini * tianhe1a.ini # cannot be accessed other than through a VPN
=== known too old === * mike.ini * qb.ini * requin.ini # cluser is up and running: http://ganglia.sharcnet.ca/?c=requin&m=load_one&r=hour&s=descend... * sciama.ini # cluster is up http://www.sciama.icg.port.ac.uk/coremap2.htm
#2207: support all of C++11 in Cactus or the Einstein Toolkit --------------------------+--------------------------------- Reporter: Roland Haas | Owner: (none) Type: enhancement | Status: new Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+---------------------------------
Comment (by Roland Haas):
saw, s-kraken and requin are very old. Last year, a set of new machines was made available to researcher. I have retired them based on suggestions by Erik.
The new machines are Cedar, Graham, and Niagara.
#2207: support all of C++11 in Cactus or the Einstein Toolkit --------------------------+--------------------------------- Reporter: Roland Haas | Owner: (none) Type: enhancement | Status: new Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+---------------------------------
Comment (by Roland Haas):
Erik says (offline) that
* compute1.ini * compute20.ini * compute2.ini * compute3.ini * compute4.ini * compute5.ini * compute.ini * nvidia1.ini * nvidia.ini * pi0005009.ini * titan.ini
are old machines at PI that will be retired in the next month or so.
There seems to be little standing in the way of declaring C++11 to be a requirement for Cactus or the Einstein Toolkit.
#2207: support all of C++11 in Cactus or the Einstein Toolkit --------------------------+--------------------------------- Reporter: Roland Haas | Owner: (none) Type: enhancement | Status: new Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+---------------------------------
Comment (by Roland Haas):
I gained access to Vesta (or had before but not realised it). Turns out that even the newest IBM XL compiler (that they have, but maybe in general): @ibm-compilers-2017-10 which is version 12.1 (see https://www.ibm.com/support/knowledgecenter/en/SS2LWA) does not support range based for loops of the type {{{ #include <vector> int main() { std::vector<int> xs(10); for (int& x: xs) x = 42; ; return 0; } }}} and fails with {{{ /soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/bin/bgxlC_r -o conftest -g -qrtti -qlanglvl=autotypededuction -qlanglvl=decltype -qlanglvl=rightanglebracket:extc1x -qsuppress=1500-036 -g -DCARPET_AVOID_LAMBDA -DCARPET_USE_BOOST_FOREACH -DCARPET_USE_BOOST_SHARED_PTR -DCARPET_ENABLE_BBOXSET2 -DCARPET_USE_BBOXSET2 conftest.C 1>&5 "configure", line 7458.15: 1540-0063 (S) The text ":" is unexpected. }}}
Thus vesta is currently not a supported machine anymore and requiring full C++11 support is not going to make things any worse. Also, given that the change requiring range based for loops is from Tue Apr 26 07:47:33 2016 -0400 git hash 86d7765529c63b69d58d869248f9c2080f53978b "Cactus: Enable C++11 by default, and require it" and that no one complained so far, it seems safe to state that vesta is not used by anyone.
I would thus suggest to mark it in simfactory as only supporting ET_2015_11 which is the release before range based loops became mandatory.
#2207: support all of C++11 in Cactus or the Einstein Toolkit --------------------------+--------------------------------- Reporter: Roland Haas | Owner: (none) Type: enhancement | Status: new Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+---------------------------------
Comment (by Roland Haas):
This leaves the LONI machines
* mike.ini * qb.ini * shelob.ini * philipp.ini
as the only ones not yet supporting C++11 (though it should be just a matter of updating the simfactory files to use a newer compiler).
#2207: support all of C++11 in Cactus or the Einstein Toolkit --------------------------+--------------------------------- Reporter: Roland Haas | Owner: (none) Type: enhancement | Status: new Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+---------------------------------
Comment (by Erik Schnetter):
Regarding Vesta: I find that the C++ front-end of xlC leaves much to be desired and is basically unusable for any modern C++ code. Instead of using IBM's xlC, I used to use bgclang, a version of clang with BlueGene specific optimizations <https://www.alcf.anl.gov/user-guides/bgclang- compiler>. In other words, Vesta should still be supported, but the very old version of xlC available there isn't.
#2207: support all of C++11 in Cactus or the Einstein Toolkit --------------------------+--------------------------------- Reporter: Roland Haas | Owner: (none) Type: enhancement | Status: new Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+---------------------------------
Comment (by Roland Haas):
Ok, I will take a look once more. The option list uses /soft/compilers /ibmcmp-oct2017/vacpp/bg/12.1/bin/bgxlC_r which looks like the IBM xL compiler.
Looking at the website you pointed to, as well as in /soft/compilers/bgclang/wbin/ I cannot find a Fortran compiler though.
Do you know off-hand if there is one that would be compatible with clang's runtime library (eg for stdio and OpenMP threads)?
trac@lists.einsteintoolkit.org