[Openmp-commits] [PATCH] D41508: [OMPT] Build runtime with OMPT support by default

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sat Dec 23 01:58:41 PST 2017


protze.joachim updated this revision to Diff 128073.
protze.joachim added a comment.

I added the requirement for hardware architecture support to LIBOMP_HAVE_OMPT_SUPPORT. 
This way one would also get an error when manually turing LIBOMP_OMPT_SUPPORT=on on an unsupported architecture.

Also implemented Jonas' suggestion.


https://reviews.llvm.org/D41508

Files:
  runtime/CMakeLists.txt
  runtime/cmake/config-ix.cmake


Index: runtime/cmake/config-ix.cmake
===================================================================
--- runtime/cmake/config-ix.cmake
+++ runtime/cmake/config-ix.cmake
@@ -236,7 +236,15 @@
 if(NOT LIBOMP_HAVE___BUILTIN_FRAME_ADDRESS)
   set(LIBOMP_HAVE_OMPT_SUPPORT FALSE)
 else()
-  if((WIN32 AND LIBOMP_HAVE_PSAPI) OR APPLE OR (NOT WIN32 AND LIBOMP_HAVE_WEAK_ATTRIBUTE))
+  if( # hardware architecture supported?
+     ((LIBOMP_ARCH STREQUAL x86_64) OR
+      (LIBOMP_ARCH STREQUAL i386) OR
+      (LIBOMP_ARCH STREQUAL arm) OR
+      (LIBOMP_ARCH STREQUAL aarch64) OR
+      (LIBOMP_ARCH STREQUAL ppc64le) OR
+      (LIBOMP_ARCH STREQUAL ppc64))
+     AND # OS supported?
+     ((WIN32 AND LIBOMP_HAVE_PSAPI) OR APPLE OR (NOT WIN32 AND LIBOMP_HAVE_WEAK_ATTRIBUTE)))
     set(LIBOMP_HAVE_OMPT_SUPPORT TRUE)
   else()
     set(LIBOMP_HAVE_OMPT_SUPPORT FALSE)
Index: runtime/CMakeLists.txt
===================================================================
--- runtime/CMakeLists.txt
+++ runtime/CMakeLists.txt
@@ -301,13 +301,12 @@
 
 # OMPT-support defaults to ON for OpenMP 5.0+ and if the requirements in
 # cmake/config-ix.cmake are fulfilled.
-if((${LIBOMP_OMP_VERSION} GREATER 49) AND (LIBOMP_HAVE_OMPT_SUPPORT))
-  set(LIBOMP_OMPT_SUPPORT TRUE CACHE BOOL
-    "OMPT-support?")
-else()
-  set(LIBOMP_OMPT_SUPPORT FALSE CACHE BOOL
-    "OMPT-support?")
+set(OMPT_DEFAULT FALSE)
+if ((${LIBOMP_OMP_VERSION} GREATER 49) AND (LIBOMP_HAVE_OMPT_SUPPORT))
+  set(OMPT_DEFAULT TRUE)
 endif()
+set(LIBOMP_OMPT_SUPPORT ${OMPT_DEFAULT} CACHE BOOL
+  "OMPT-support?")
 
 set(LIBOMP_OMPT_DEBUG FALSE CACHE BOOL
   "Trace OMPT initialization?")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41508.128073.patch
Type: text/x-patch
Size: 1644 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20171223/e7051997/attachment.bin>


More information about the Openmp-commits mailing list