summaryrefslogtreecommitdiff
path: root/sci-libs/caffe2/files/caffe2-2.1.2-fix-openmp-link.patch
blob: 3f2d0ae3c30a7330be20e2be7833738fe2f45c33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Fix "undefined symbol: omp_get_max_active_levels" in mkl + <nothing else> builds
https://github.com/pytorch/pytorch/issues/116576
--- a/caffe2/CMakeLists.txt
+++ b/caffe2/CMakeLists.txt
@@ -1575,6 +1575,10 @@ if(BUILD_SHARED_LIBS)
     target_link_libraries(torch_global_deps TBB::tbb)
   endif()
 
+  if(USE_OPENMP)
+    target_link_libraries(torch_global_deps OpenMP::OpenMP_CXX)
+  endif()
+
   install(TARGETS torch_global_deps DESTINATION "${TORCH_INSTALL_LIB_DIR}")
 endif()