[Openmp-commits] [PATCH] D35719: [CMake] Allow to disable building libomptarget
Jonas Hahnfeld via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Jul 20 23:44:45 PDT 2017
Hahnfeld created this revision.
Herald added a subscriber: mgorny.
libomptarget is not yet ready for prime time:
- Offloading to NVIDIA GPUs is not completed yet (compiler, device RTL)
- The generic ELF plugin for offloading to the host (meant for testing) uses a single instance of the OpenMP runtime (libomp). That is why omp_is_initial_device() returns 1 which makes the tests fail.
Because of these reasons, we want to disable building (and testing!) for release 5.0.
Introduce OPENMP_ENABLE_LIBOMPTARGET with the same defaults as before. This allows to disable building with a simple switch. For release 5.0, the default will be inverted, i.e. disabled by default on all platforms.
See https://bugs.llvm.org/show_bug.cgi?id=33859
https://reviews.llvm.org/D35719
Files:
CMakeLists.txt
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -4,9 +4,17 @@
add_subdirectory(runtime)
+
+set(ENABLE_LIBOMPTARGET ON)
# Currently libomptarget cannot be compiled on Windows or MacOS X.
# Since the device plugins are only supported on Linux anyway,
# there is no point in trying to compile libomptarget on other OSes.
-if (NOT (WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))
+if (WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ set(ENABLE_LIBOMPTARGET OFF)
+endif()
+
+option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading."
+ ${ENABLE_LIBOMPTARGET})
+if (OPENMP_ENABLE_LIBOMPTARGET)
add_subdirectory(libomptarget)
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35719.107634.patch
Type: text/x-patch
Size: 754 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20170721/faa393f9/attachment.bin>
More information about the Openmp-commits
mailing list