summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-libs/caffe2/files/caffe2-2.1.2-fix-openmp-link.patch')
-rw-r--r--sci-libs/caffe2/files/caffe2-2.1.2-fix-openmp-link.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/sci-libs/caffe2/files/caffe2-2.1.2-fix-openmp-link.patch b/sci-libs/caffe2/files/caffe2-2.1.2-fix-openmp-link.patch
new file mode 100644
index 000000000000..3f2d0ae3c30a
--- /dev/null
+++ b/sci-libs/caffe2/files/caffe2-2.1.2-fix-openmp-link.patch
@@ -0,0 +1,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()
+