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.
- 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 - Set
OMP_DEBUGto enabled.$ export OMP_DEBUG=enabled - Compile the program to be debugged with
-gand-fopenmpoptions as follows for a sample C source file xyz.c.$ <compdir>/aocc-compiler-<ver>/bin/clang -g -fopenmp xyz.c -o xyz.outNote: The program to be debugged must have a dynamic link dependency onlibomp.sounder<compdir>/aocc-compiler-<ver>/libfor OpenMP-specific debugging to work correctly. You can check this usinglddon the generated binary, that isxyz.out. - Debug the binary
xyz.outby invokinggdbwith the plugin.gdb -x <compdir>/aocc-compiler-<ver>/ompd/__init__.py ./xyz.outNote: Use the<compdir>/aocc-compiler-<ver>/ompd/__init__.pyplugin.