Compiling and Linking for OMPD Support
Compiling and linking a program for OMPD support varies by compiler. The following is a summary of compiling and linking rules:
*Compiling with the -fopenmp option.
Most compilers require using the -fopenmp option to enable compiling for OpenMP. Check the compiler documentation for details.
*Linking with a special "lib-debug" version of the OpenMP and OMPD libraries.
The AMD Clang and AMD Flang compilers require linking with a special lib-debug version of the OpenMP and OMPD libraries. How to link the lib-debug version differs, depending on the compiler and its version:
AMD Clang:
*AMD Clang compiler drivers from ROCm 5.6 and newer: Use the -fopenmp-runtimelib=lib-debug compiler option to force the use of the library versions that support OMPD.
*AMD Clang compiler drivers from ROCm 5.5: The -fopenmp-runtimelib=lib-debug is not supported; instead, use RPATH or RUNPATH to search for the directory that contains the debug libraries with the OMPD support, then add that to the link command. For example, for ROCm 6.0.0, the directory is /opt/rocm-6.0.0/llvm/lib-debug.
AMD Flang:
Use use RPATH or RUNPATH as described for AMD Clang.
(While The newer AMD Flang compilers do support the -fopenmp-runtimelib=lib-debug option, the compiler driver mishandles it.) Note that the lib-debug version of the OpenMP and OMPD libraries contain DWARF debug information. It is not known if these versions of the library were also built optimized.
*HPE CCE
No special compiler options are required.
The HPE CCE cc and ftn compilers do not require any special RPATH or compiler options for OMPD support. However, in versions up to and including CCE 18.0.0, bugs in the OMPD library result in incorrect OMPD results.