Chapter 2.1 : To enable the debugging symbols



The first thing to do is to enable the debugging symbols in the compilation of our program.

So, we have to change the CMakeLists.txt file to enable these debugging symbols.



This is done with the function add_definitions. You can do :

1
add_definitions(-O3 -g)


if you still want good optimisations, or :

1
add_definitions(-Og)


if you want to keep some optimisations.

So, your CMakeLists.txt file will looks like :



1
2
3
4
5
6
project(HadamardProduct)
cmake_minimum_required(VERSION 3.0)

add_definitions(-O3 -g)

add_executable(hadamard_product main.cpp)


Then, we have to recompile your program :
1
make