particle-diffusion/src/CMakeLists.txt sets default optimization level to -O3, regardless of the CMAKE_BUILD_TYPE
Version
oneAPI Base Tookit 2021.4
Environment
Ubuntu 20.04
Coffee Lake / GEN9 graphics
Steps to reproduce
from particle-diffusion sample directory run:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=DEBUG ..
Observed behavior
Running "cmake -DCMAKE_BUILD_TYPE=DEBUG .." results in both -O0 and -O3 specified in flags.make:
CMakeFiles/motionsim.exe.dir/flags.make:CXX_FLAGS = -g -O0 -O3 -std=c++17 -g
As the result, dpcpp seem to performs -O3 optimization, defeating the purpose of DEBUG build
Expected behavior
cmake uses -O0 -g compiler flags when CMAKE_BUILD_TYPE=DEBUG is set
Summary
particle-diffusion/src/CMakeLists.txt sets default optimization level to -O3, regardless of the CMAKE_BUILD_TYPE
Version
oneAPI Base Tookit 2021.4
Environment
Ubuntu 20.04 Coffee Lake / GEN9 graphics
Steps to reproduce
from particle-diffusion sample directory run: mkdir build cd build cmake -DCMAKE_BUILD_TYPE=DEBUG ..
Observed behavior
Running "cmake -DCMAKE_BUILD_TYPE=DEBUG .." results in both -O0 and -O3 specified in flags.make: CMakeFiles/motionsim.exe.dir/flags.make:CXX_FLAGS = -g -O0 -O3 -std=c++17 -g As the result, dpcpp seem to performs -O3 optimization, defeating the purpose of DEBUG build
Expected behavior
cmake uses -O0 -g compiler flags when CMAKE_BUILD_TYPE=DEBUG is set