Skip to content

How to build pandora for debugging, profiling and release

leoisl edited this page May 17, 2019 · 1 revision
  1. Go to a build folder
  2. Build the project accordingly to what you want to do:
    1. For debugging:
      • cmake -DCMAKE_BUILD_TYPE=Debug .. && make -j 4
      • Flags passed to compiler: -g
      • ctest -VV will work here, so you can check if the code is indeed working;
      • If you do not use this to debug, variables will get optimized out and functions will get inlined, making it hard to debug;
    2. For profiling (e.g. callgrind):
      • cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. && make -j 4
      • Flags passed to compiler: -O2 -g -DNDEBUG
      • ctest -VV will NOT work here as asserts are turned off;
    3. For release (or if you want to test the most optimized executable):
      • cmake -DCMAKE_BUILD_TYPE=Release .. && make -j 4
      • Flags passed to compiler: -O3 -DNDEBUG
      • ctest -VV will NOT work here as asserts are turned off;
Clone this wiki locally