Skip to content

Optimisation Fine Tuning, 1.0 branch (2017.04.10.)

This is to fix ATLINFR-1642.

Until now the compiler optimisation flags were simply left at their default values. CMake at the moment sets the following values for these for GCC:

CMAKE_CXX_FLAGS_RELEASE = -DNDEBUG -O3
CMAKE_CXX_FLAGS_RELWITHDEBINFO = -DNDEBUG -O2 -g
CMAKE_CXX_FLAGS_DEBUG = -g

It was the -O3 setting that was causing us trouble so far.

With this update the AtlasCompilerSettings.cmake file now explicitly sets these flags. So that by default we would use -O2 for Release mode as well.

In order to keep it possible to override these settings from the command line (for experimental builds for instance), I had to introduce 3 new cache variables. (There's a long explanation to why this was needed.) These are:

  • ATLAS_CXX_FLAGS_RELEASE
  • ATLAS_CXX_FLAGS_RELWITHDEBINFO
  • ATLAS_CXX_FLAGS_DEBUG

In order to use some custom value for the compiler optimisation instead of the new defaults, one has to set one of these from the command line.

Merge request reports