TimerReport change requires C++11, but Cactus does not

Create issue
Issue #1877 closed
Ian Hinder created an issue

The commit https://bitbucket.org/cactuscode/cactusutils/commits/5c812eb236f4ff033fc1c279cf9eadca9933bbda uses C++11 features which are not enabled by Cactus autoconf. Erik warned in the ET call yesterday that this might be a problem. The error you get is

Checking status of thorn TimerReport In file included from /usr/include/c++/4.8/array:35:0, from /home/jenkins/workspace/KrancTutorial/Cactus/arrangements/CactusUtils/TimerReport/src/Output.cc:16: /usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options. #error This file requires compiler and library support for the

This is when compiling without an optionlist on Ubuntu 14.04.

  • If we want to require C++11 for Cactus, then we should configure for it (i.e. add the -std=gnu++11 option when configuring, as is done in several simfactory optionlists).
  • My feeling is that C++11 compiler support might not be diffuse enough or mature enough to require for Cactus, which prides itself on portability, but I'm not up-to-date on the current C++ landscape. The above error message, on a version of Ubuntu which has been LTS up to a week ago, suggests that the GCC authors were also not sufficiently confident in the implementation. The GCC C++11 page doesn't seem to list recent GCC versions, but the latest version listed (4.8) still describes the support as "experimental".
  • Maybe the C++11 features being used in TimerReport are not critical, and can be easily worked around?

Keyword:

Comments (4)

  1. Erik Schnetter
    • removed comment

    The systems I tested (Edison, Queen Bee, Comet, Core, Bethe, and a few others) all compiled the code fine. I've been using C++11 features in Carpet for some time, usually enabled by the -std=c++0x flag. This seemed to work well for both the Intel and GNU compilers.

    If this flag works here as well, then I'd be tempted to make this the default. If not, I'll implement the respective work-arounds. To my knowledge, this requires (1) creating structs instead of using lambda expressions in two places, and (2) replacing std::array by a struct holding an old-style array. Both look straightforward.

  2. Ian Hinder reporter
    • changed status to resolved
    • removed comment

    Erik has added a flag to the Cactus configure script to require C++11. If this causes a problem we can revisit it.

  3. Log in to comment