OpenMP Debugging Support (OMPD) - OpenMP Debugging Support (OMPD) - 57222

AOCC User Guide

Document_ID
57222
Release_Date
2026-05-12
Revision
5.2 English

Available in AOCC 2.3 or later.

The AOCC installation includes OMPD for debugging C/C++ OpenMP programs through a gdb plugin with limited functionality.
Note: Debugging the code that runs on an offloading device is not supported.
Complete the following steps to use OMPD for debugging C/C++ OpenMP programs through a gdb plugin.
Note: For using the OMPD plugin, Python 3.5 or later is required.
  1. Add folders ompd and lib to your LD_LIBRARY_PATH.
    $ export LD_LIBRARY_PATH=<compdir>/aocc-compiler-<ver>/ompd:<compdir>/aocc-compiler-<ver>/lib:$LD_LIBRARY_PATH
  2. Set OMP_DEBUG to enabled.
    $ export OMP_DEBUG=enabled
  3. Compile the program to be debugged with -g and -fopenmp options as follows for a sample C source file xyz.c.
    $ <compdir>/aocc-compiler-<ver>/bin/clang -g -fopenmp xyz.c -o xyz.out
    Note: The program to be debugged must have a dynamic link dependency on libomp.so under <compdir>/aocc-compiler-<ver>/lib for OpenMP-specific debugging to work correctly. You can check this using ldd on the generated binary, that is xyz.out.
  4. Debug the binary xyz.out by invoking gdb with the plugin.
    gdb -x <compdir>/aocc-compiler-<ver>/ompd/__init__.py ./xyz.out
    Note: Use the <compdir>/aocc-compiler-<ver>/ompd/__init__.py plugin.