[PATCH] D75001: [OpenMP][cmake] ignore warning on unknown CUDA version

Kelvin Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 21 16:30:13 PST 2020


kkwli0 created this revision.
kkwli0 added reviewers: tra, ABataev, JonChesterfield, jdoerfert, ye-luo.
Herald added subscribers: guansong, mgorny.

With CUDA 10.2 installed on the system, the compiler issues a warning about unknown CUDA version.  The warning message makes the `LIBOMP_HAVE_VERSION_SCRIPT_FLAG` test returns false.  As a result, building libomp fails.

  /opt/rh/devtoolset-8/root/usr/lib/gcc/ppc64le-redhat-linux/8/../../../../bin/ld: ../../../../lib/libomp.so: version node not found for symbol omp_get_num_places_@@VERSION
  /opt/rh/devtoolset-8/root/usr/lib/gcc/ppc64le-redhat-linux/8/../../../../bin/ld: failed to set dynamic section sizes: Bad value

This patch is to make the `libomp_check_linker_flag` function called in the `LIBOMP_HAVE_VERSION_SCRIPT_FLAG` test more tolerable with the warning message.


https://reviews.llvm.org/D75001

Files:
  openmp/runtime/cmake/LibompCheckLinkerFlag.cmake


Index: openmp/runtime/cmake/LibompCheckLinkerFlag.cmake
===================================================================
--- openmp/runtime/cmake/LibompCheckLinkerFlag.cmake
+++ openmp/runtime/cmake/LibompCheckLinkerFlag.cmake
@@ -38,7 +38,8 @@
 
   if(try_compile_result)
     foreach(regex IN LISTS failed_regexes)
-      if("${OUTPUT}" MATCHES ${regex})
+      # Ignore the warning about the newer or unknown CUDA version.
+      if(("${OUTPUT}" MATCHES ${regex}) AND NOT ("${OUTPUT}" MATCHES "Unknown CUDA version"))
         set(retval FALSE)
       endif()
     endforeach()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75001.245982.patch
Type: text/x-patch
Size: 584 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200222/f44e3b56/attachment.bin>


More information about the cfe-commits mailing list