18.6.1. Debugging - 5.2 English - 57404

AOCL User Guide (57404)

Document ID
57404
Release Date
2025-12-29
Version
5.2 English

Debug Build Configuration

For debugging, use a debug build:

$ cmake -B build -DAU_BUILD_TYPE=Debug
$ cmake --build build

For more verbose output:

$ cmake -B build -DAU_BUILD_TYPE=Developer

Sanitizer Options

To catch bugs, enable sanitizers:

  • AddressSanitizer (memory errors):

    $ cmake -B build -DAU_BUILD_WITH_ASAN=ON
    
  • ThreadSanitizer (threading bugs):

    $ cmake -B build -DAU_BUILD_WITH_TSAN=ON
    
  • MemorySanitizer (uninitialized memory):

    $ cmake -B build -DAU_BUILD_WITH_MEMSAN=ON
    

Debug Symbols

Debug builds include full symbols for GDB/LLDB. Use -DCMAKE_BUILD_TYPE=Debug for debugging.

Debugging Tips:

  • Use logger module for runtime diagnostics

  • Enable verbose logging for CPU detection issues

  • Verify thread affinity using OS tools (taskset -p, hwloc-bind)

  • Check library loading with ldd (Linux) or Dependencies.exe (Windows)