[Openmp-commits] [PATCH] D89426: [libomptarget] Require LLVM source tree to build libomptarget

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Oct 14 14:26:48 PDT 2020


JonChesterfield created this revision.
JonChesterfield added a reviewer: jdoerfert.
Herald added subscribers: openmp-commits, mgorny.
Herald added a project: OpenMP.
JonChesterfield requested review of this revision.
Herald added a subscriber: sstefan1.

[libomptarget] Require LLVM source tree to build libomptarget

This is to permit reliably #including files from the LLVM tree in libomptarget,
as an improvement on the copy and paste that is currently in use. See D87841 <https://reviews.llvm.org/D87841>
for the first example of removing duplication given this new requirement.

The weekly openmp dev call reached consensus on this approach. See also D87841 <https://reviews.llvm.org/D87841>
for some alternatives that were considered. In the future, we may want to
introduce a new top level repo for shared constants, or start using the ADT
library within openmp.

This will break sufficiently exotic build systems, trivial fixes as below.

Building libomptarget as part of the monorepo will continue to work.
If openmp is built separately, it now requires a cmake macro indicating
where to find the LLVM source tree.

If openmp is built separately, without the llvm source tree already on disk,
the build machine will need a copy of a subset of the llvm source tree and
the cmake macro indicating where it is.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89426

Files:
  openmp/libomptarget/CMakeLists.txt


Index: openmp/libomptarget/CMakeLists.txt
===================================================================
--- openmp/libomptarget/CMakeLists.txt
+++ openmp/libomptarget/CMakeLists.txt
@@ -29,6 +29,11 @@
 # Get dependencies for the different components of the project.
 include(LibomptargetGetDependencies)
 
+# LLVM source tree is required at build time for libomptarget
+if (NOT LLVM_MAIN_INCLUDE_DIR)
+  message(FATAL_ERROR "Missing definition for LLVM_MAIN_INCLUDE_DIR")
+endif()
+
 # This is a list of all the targets that are supported/tested right now.
 set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} aarch64-unknown-linux-gnu")
 set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} powerpc64le-ibm-linux-gnu")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89426.298238.patch
Type: text/x-patch
Size: 739 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20201014/4c06dc6d/attachment.bin>


More information about the Openmp-commits mailing list