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()
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()
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits