aboutsummaryrefslogtreecommitdiffstats
path: root/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-fix-openmp-checking.patch
blob: 6053a315959be0cd1e444f04750eadf32589ab42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
From 46520b6fa766aabcb8c8bc0ead485d30bae965ea Mon Sep 17 00:00:00 2001
From: Chin Huat Ang <chin.huat.ang@intel.com>
Date: Tue, 20 Aug 2019 12:20:33 +0800
Subject: [PATCH] fix openmp checking

Make sure that we supply -fopenmp when using OpenMP supplied by compiler
and dont look for it locally.

Upstream-Status: Submitted
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Chin Huat Ang <chin.huat.ang@intel.com>
---
 inference-engine/cmake/dependencies.cmake         | 6 +-----
 inference-engine/cmake/ie_parallel.cmake          | 4 ++--
 inference-engine/src/mkldnn_plugin/CMakeLists.txt | 1 +
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/inference-engine/cmake/dependencies.cmake b/inference-engine/cmake/dependencies.cmake
index d3cdf95..64435ca 100644
--- a/inference-engine/cmake/dependencies.cmake
+++ b/inference-engine/cmake/dependencies.cmake
@@ -86,11 +86,7 @@ if (WIN32)
             ENVIRONMENT "OMP"
             VERSION_REGEX ".*_([a-z]*_([a-z0-9]+\\.)*[0-9]+).*")
 elseif(LINUX)
-    RESOLVE_DEPENDENCY(OMP
-            ARCHIVE_LIN "iomp.tgz"
-            TARGET_PATH "${TEMP}/omp"
-            ENVIRONMENT "OMP"
-            VERSION_REGEX ".*_([a-z]*_([a-z0-9]+\\.)*[0-9]+).*")
+    set(OMP "-fopenmp")
 else(APPLE)
     RESOLVE_DEPENDENCY(OMP
             ARCHIVE_MAC "iomp_20190130_mac.tgz"
diff --git a/inference-engine/cmake/ie_parallel.cmake b/inference-engine/cmake/ie_parallel.cmake
index 18ccdf0..2738ee5 100644
--- a/inference-engine/cmake/ie_parallel.cmake
+++ b/inference-engine/cmake/ie_parallel.cmake
@@ -68,8 +68,8 @@ function(set_ie_threading_interface_for TARGET_NAME)
         endif ()
 
         if (NOT OMP_LIBRARIES_RELEASE OR NOT OMP_LIBRARIES_DEBUG)
-            find_library(OMP_LIBRARIES_RELEASE ${omp_lib_name} ${lib_rel_path} NO_DEFAULT_PATH)
-            find_library(OMP_LIBRARIES_DEBUG ${omp_lib_name} ${lib_dbg_path} NO_DEFAULT_PATH)
+            find_library(OMP_LIBRARIES_RELEASE ${omp_lib_name})
+            find_library(OMP_LIBRARIES_DEBUG ${omp_lib_name})
             ext_message(STATUS "OMP Release lib: ${OMP_LIBRARIES_RELEASE}")
             ext_message(STATUS "OMP Debug lib: ${OMP_LIBRARIES_DEBUG}")
         endif ()
diff --git a/inference-engine/src/mkldnn_plugin/CMakeLists.txt b/inference-engine/src/mkldnn_plugin/CMakeLists.txt
index df81a5a..96c7f1c 100644
--- a/inference-engine/src/mkldnn_plugin/CMakeLists.txt
+++ b/inference-engine/src/mkldnn_plugin/CMakeLists.txt
@@ -50,6 +50,7 @@ if (THREADING STREQUAL "TBB")
     set(MKLDNN_THR MKLDNN_THR_TBB)
 elseif (THREADING STREQUAL "OMP")
     set(MKLDNN_THR MKLDNN_THR_OMP)
+    target_link_options(${TARGET_NAME} PRIVATE -fopenmp)
 else()
     set(MKLDNN_THR MKLDNN_THR_SEQ)
 endif()