Address handling of CMAKE_BUILD_TYPE, -O0 for debug builds, etc.
Created by: bartlettroscoe
It seems there is some confusion/unhappiness with the way that Trilinos (through TriBITS) is dealing with CMAKE_BUILD_TYPE
and the insertion or not of -O0 for "Debug" (or "DEBUG") builds.
For the way the CMake and TriBITS manipulates compiler flags, see "Selecting compiler and linker options" in the Trilinos Build Reference.
On one hand, we want TriBITS (and therefore Trilinos) to keep with raw CMake behavior intact as much as possible (so that people who know CMake already will know how to work with Trilinos), but that would mean that -O0 would not show up in "Debug" builds. On the other hand, we should override default raw CMake behavior when raw CMake behavior it is actually counter-intuitive (in which case you would add -O0 to "Debug" builds). But then that gets TriBITS into the business of knowing how to set compiler flags for all compilers and on platforms. Do we want to step on the CMake's communities ties like this? Do we really want to own this?
This Issue Ticket is to log the discussion of this topic and potentially come up with some action to address this in a way that makes people (by some definition) happy.
Tasks:
- Add
-DNDEBUG
to C and C++ RELEASE compiler flags by default for GCC (see below) [Done] - Add
-O0
to C, C++, and Fortran debug flags for Intel builds ...