C++11/14 (gcc 4.8) now the baseline

RFC-91 has been adopted, and the coding standards and C++11/14 policy updated accordingly. Developers are now free to use modern C++ features in accordance. Jenkins and Buildbot are using gcc 4.8 or 4.9 already.

To enable gcc 4.9 on the LSST cluster, adding “exec scl enable devtoolset-3 bash” to your .bash_profile is suggested.

Recommendations for sources for a coding/style guide for modern C++ would be appreciated, either in a separate topic here or (if a strong enough candidate) in an RFC.

1 Like

Here is my suggestion on enabling devtoolset for systems that use scl enable devtoolset. Add the following as the last line of your .bash_profile:

exec scl enable devtoolset-3 bash

The exec means you just have one shell; when you exit from that you are done.

Some systems use module load instead of scl enable and I don’t know the details (but apparently the exec is not needed).

I also found I had to move my code that modifies the prompt to my .bashrc file, as it was ignored if it was in my .bash_profile.

To be clear, this line has to be the last line in the file.

Thanks, @timj. I updated my reply accordingly.

GCC 4.8 is a bit problematic in terms of full C++11 support. We noticed yesterday that std::regex does not work in that version (we were attempting to remove boost::regex from Qserv).

The new C++ Core Guidelines might be interesting to follow up on.