SENSEI-insitu / SENSEI

SENSEI ∙ Scalable in situ analysis and visualization

Home Page:https://sensei-insitu.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

-O3 is passed even for CMAKE_BUILD_TYPE=Debug

danlipsa opened this issue · comments

Both -g and -O3 are passed for debug build. That makes debugging difficult.

@burlen Any ideas here? Thanks!

When configuring SENSEI for Debug build -O3 is not present.

However, note that if you first configure SENSEI for a Release build, then later try to change to a Debug build, you will need to start fresh or modify your CMakeCache.txt manually since CMake will not reconfigure cached variables including CXX_FLAGS. This is not a bug in SENSEI but rather a feature of CMake.

Here are how the flags are set for a Debug build:

$ rm -rfI ./*; cmake -DCMAKE_BUILD_TYPE=Debug ..; grep CXX_FLAGS CMakeCache.txt
...
CMAKE_CXX_FLAGS:STRING=-fPIC -std=c++17 -Wall -Wextra -fvisibility=hidden
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG

After looking at our code, it may be the case that we could move the optimization related flags from CXX_FLAGS to CXX_FLAGS_RELEASE making the reconfigure unnecessary.