The most recent releases of the LLVM OpenMP runtime include support for OMPT. They also include a compatibility layer to make it usable with programs compiled both by GCC and Clang or ICC.
The first step is to get the runtime's source code:
git clone https://github.com/llvm/llvm-project.git --depth=1
.
LLVM has switched to a monorepo, so in order to avoid downloading absolutely everything, the depth
argument tells git to just get the last version.
Then you can get in and build the runtime:
cd llvm-project
mkdir build-openmp && cd build-openmp
cmake ../openmp -DCMAKE_C_COMPILER=<C compiler> -DCMAKE_CXX_COMPILER=<C++ compiler> -DCMAKE_INSTALL_PREFIX=/path/to/install
make install
Then make sure to add the installed paths to your *_PATH
if you want to use it:
export OPENMP_INSTALL_DIR=/path/to/install
export CPLUS_INCLUDE_PATH=$OPENMP_INSTALL_DIR/include:$CPLUS_INCLUDE_PATH
export C_INCLUDE_PATH=$OPENMP_INSTALL_DIR/include:$C_INCLUDE_PATH
export LIBRARY_PATH=$OPENMP_INSTALL_DIR/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=$OPENMP_INSTALL_DIR/lib:$LD_LIBRARY_PATH