[Openmp-commits] [PATCH] D125698: [Libomptarget] Don't build the device runtime without a new Clang

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon May 16 08:55:08 PDT 2022

jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, JonChesterfield, tianshilei1992, ye-luo, nikic, ronlieb.
Herald added a subscriber: mgorny.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

The OpenMP device offloading library is a bitcode library and thus only
expect to build and linked with the same version of clang that was used
to create it. This somewhat copmlicates the building process as we
require the Clang that was just built to be used to create the library.
This is either done with a two-step build, where OpenMP is built with
the Clang that was just installed, or through the
`-DLLLVM_ENABLE_RUNTIMES=openmp` option. This has always been the case,
but recent changes have caused this to make it difficult to build the
rest of OpenMP. This patchs adds a check to not build the OpenMP device
runtime if the current compiler is not Clang with the same version as
the LLVM installation. This should allow users to build OpenMP as a
project using any compiler without it erroring out due to the bitcode
library, but if users require it they will need to use the above methods
to compile it.

  rG LLVM Github Monorepo



Index: openmp/libomptarget/CMakeLists.txt
--- openmp/libomptarget/CMakeLists.txt
+++ openmp/libomptarget/CMakeLists.txt
@@ -84,8 +84,15 @@
 # Build offloading plugins and device RTLs if they are available.
+  add_subdirectory(DeviceRTL)
+  libomptarget_say("Not building DeviceRTL, CMake compiler '${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_VERSION}' is not 'Clang ${LIBOMPTARGET_LLVM_VERSION}'.")
+  libomptarget_say("  Use the 'LLVM_ENABLE_RUNTIMES=openmp' option instead")
 # Add tests.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125698.429733.patch
Type: text/x-patch
Size: 900 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220516/33439bd9/attachment-0001.bin>

More information about the Openmp-commits mailing list