[OpenMP] Add implementation and tests of Archer tool

Authored by protze@itc.rwth-aachen.de <protze@itc.rwth-aachen.de> on Nov 17 2019, 4:23 PM.


[OpenMP] Add implementation and tests of Archer tool

The tool provides TSAN annotations for OpenMP synchronization. The tool
is activated if no other OMPT tool is loaded.

The tool detects whether the application was built with TSan and rejects
activation according to the OMPT protocol if there is no TSan-rt.

Differential Revision: https://reviews.llvm.org/D45890

Event Timeline

protze@itc.rwth-aachen.de <protze@itc.rwth-aachen.de> committed rG2b8115b10b03: [OpenMP] Add implementation and tests of Archer tool (authored by protze@itc.rwth-aachen.de <protze@itc.rwth-aachen.de>).Nov 18 2019, 5:45 AM


I'm building clang + openmp like this

cmake -G Ninja ../src/llvm-src/llvm -DCMAKE_BUILD_TYPE=Release '-DLLVM_ENABLE_PROJECTS=clang;openmp'

and I see failures like

/usr/bin/ld: cannot find /build-directory/lib/clang/10.0.0/lib/linux/libclang_rt.tsan-x86_64.a: No such file or directory
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)

is this expected behaviour? Maybe I forgot to enable something or this way of building won't work?



I believe I'm having a problem with Archer when I run the OpenMP tests with an architecture that doesn't support TSan yet:

clang-10: error: unsupported option '-fsanitize=thread' for target 'riscv64-redhat-linux'

I think it would be helpful if we could detect whether the target supports TSan and disable Archer tests otherwise.



Given the variables defined in file tools/archer/tests/CMakeLists.txt, I wonder if this should be config.has_libatomic = @LIBARCHER_HAVE_LIBATOMIC@ instead.

The current variable is unset when the lit.cfg configuration file is generated in my installation, which then causes check-openmp target to fail before executing any test.