Explorar o código

Merge topic 'FindBLAS/OpenBLAS-OpenMP'

f7f3d8987a FindBLAS: Add dependency of OpenBLAS on OpenMP for BLA_STATIC

Acked-by: Kitware Robot <[email protected]>
Merge-request: !5487
Brad King %!s(int64=5) %!d(string=hai) anos
pai
achega
08b0668043
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      Modules/FindBLAS.cmake

+ 7 - 1
Modules/FindBLAS.cmake

@@ -586,16 +586,22 @@ if(BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All")
     else()
       find_package(Threads REQUIRED)
     endif()
+    set(_threadlibs "${CMAKE_THREAD_LIBS_INIT}")
+    if(BLA_STATIC)
+      find_package(OpenMP COMPONENTS C)
+      list(PREPEND _threadlibs "${OpenMP_C_LIBRARIES}")
+    endif()
     check_blas_libraries(
       BLAS_LIBRARIES
       BLAS
       sgemm
       ""
       "openblas"
-      "${CMAKE_THREAD_LIBS_INIT}"
+      "${_threadlibs}"
       ""
       ""
       )
+    unset(_threadlibs)
   endif()
 endif()