[Openmp-commits] [PATCH] D108534: [OpenMP][Docs] add clang to LLVM_ENABLE_PROJECTS in build instructions

Michael Kruse via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Aug 23 16:29:08 PDT 2021

Meinersbur added a comment.

In D108534#2959955 <https://reviews.llvm.org/D108534#2959955>, @JonChesterfield wrote:

> Mismatch between clang and the deviceRTL is really easy to do by accident with the ENABLE_PROJECTS approach and we don't do anything like burn a git hash into the deviceRTL to check at runtime that they match. I'm inclined to say that we should totally disable openmp offloading when not building via ENABLE_RUNTIMES. Anyone know how to spell that in cmake?

I think it is the other way around `ENABLE_PROJECTS=clang;openmp` ensures that the deviceRTL is built with with same clang as the clang the user will end up with. Problems occur when OpenMP's `CMakeLists.txt` tries to use the host compiler for the deviceRTL just because its `CMAKE_C_COMPILER_ID` is `clang`. Unfortunately this is also the mechanism how the `LLVM_ENABLE_RUNTIMES=openmp` builds finds its deviceRTL compiler. My patch to avoid this behaviour was controversial: D101663 <https://reviews.llvm.org/D101663>.

I agree that compiling deviceRTL (and by extension libomptarget) should be disabled if no suitable compiler is found. A suitable compiler might either be specified using `LIBOMPTARGET_NVPTX_CUDA_COMPILER` or `$<TARGET_FILE:clang>` if available. I don't see a good reason to disable building libomptarget entirely with `LLVM_ENABLE_PROJECTS=openmp` builds if clang is found in the same build.

  rG LLVM Github Monorepo



More information about the Openmp-commits mailing list