diff options
Diffstat (limited to 'dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-fix-openmp-checking.patch')
-rw-r--r-- | dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-fix-openmp-checking.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-fix-openmp-checking.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-fix-openmp-checking.patch new file mode 100644 index 00000000..6053a315 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-fix-openmp-checking.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From 46520b6fa766aabcb8c8bc0ead485d30bae965ea Mon Sep 17 00:00:00 2001 | ||
2 | From: Chin Huat Ang <chin.huat.ang@intel.com> | ||
3 | Date: Tue, 20 Aug 2019 12:20:33 +0800 | ||
4 | Subject: [PATCH] fix openmp checking | ||
5 | |||
6 | Make sure that we supply -fopenmp when using OpenMP supplied by compiler | ||
7 | and dont look for it locally. | ||
8 | |||
9 | Upstream-Status: Submitted | ||
10 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
11 | Signed-off-by: Chin Huat Ang <chin.huat.ang@intel.com> | ||
12 | --- | ||
13 | inference-engine/cmake/dependencies.cmake | 6 +----- | ||
14 | inference-engine/cmake/ie_parallel.cmake | 4 ++-- | ||
15 | inference-engine/src/mkldnn_plugin/CMakeLists.txt | 1 + | ||
16 | 3 files changed, 4 insertions(+), 7 deletions(-) | ||
17 | |||
18 | diff --git a/inference-engine/cmake/dependencies.cmake b/inference-engine/cmake/dependencies.cmake | ||
19 | index d3cdf95..64435ca 100644 | ||
20 | --- a/inference-engine/cmake/dependencies.cmake | ||
21 | +++ b/inference-engine/cmake/dependencies.cmake | ||
22 | @@ -86,11 +86,7 @@ if (WIN32) | ||
23 | ENVIRONMENT "OMP" | ||
24 | VERSION_REGEX ".*_([a-z]*_([a-z0-9]+\\.)*[0-9]+).*") | ||
25 | elseif(LINUX) | ||
26 | - RESOLVE_DEPENDENCY(OMP | ||
27 | - ARCHIVE_LIN "iomp.tgz" | ||
28 | - TARGET_PATH "${TEMP}/omp" | ||
29 | - ENVIRONMENT "OMP" | ||
30 | - VERSION_REGEX ".*_([a-z]*_([a-z0-9]+\\.)*[0-9]+).*") | ||
31 | + set(OMP "-fopenmp") | ||
32 | else(APPLE) | ||
33 | RESOLVE_DEPENDENCY(OMP | ||
34 | ARCHIVE_MAC "iomp_20190130_mac.tgz" | ||
35 | diff --git a/inference-engine/cmake/ie_parallel.cmake b/inference-engine/cmake/ie_parallel.cmake | ||
36 | index 18ccdf0..2738ee5 100644 | ||
37 | --- a/inference-engine/cmake/ie_parallel.cmake | ||
38 | +++ b/inference-engine/cmake/ie_parallel.cmake | ||
39 | @@ -68,8 +68,8 @@ function(set_ie_threading_interface_for TARGET_NAME) | ||
40 | endif () | ||
41 | |||
42 | if (NOT OMP_LIBRARIES_RELEASE OR NOT OMP_LIBRARIES_DEBUG) | ||
43 | - find_library(OMP_LIBRARIES_RELEASE ${omp_lib_name} ${lib_rel_path} NO_DEFAULT_PATH) | ||
44 | - find_library(OMP_LIBRARIES_DEBUG ${omp_lib_name} ${lib_dbg_path} NO_DEFAULT_PATH) | ||
45 | + find_library(OMP_LIBRARIES_RELEASE ${omp_lib_name}) | ||
46 | + find_library(OMP_LIBRARIES_DEBUG ${omp_lib_name}) | ||
47 | ext_message(STATUS "OMP Release lib: ${OMP_LIBRARIES_RELEASE}") | ||
48 | ext_message(STATUS "OMP Debug lib: ${OMP_LIBRARIES_DEBUG}") | ||
49 | endif () | ||
50 | diff --git a/inference-engine/src/mkldnn_plugin/CMakeLists.txt b/inference-engine/src/mkldnn_plugin/CMakeLists.txt | ||
51 | index df81a5a..96c7f1c 100644 | ||
52 | --- a/inference-engine/src/mkldnn_plugin/CMakeLists.txt | ||
53 | +++ b/inference-engine/src/mkldnn_plugin/CMakeLists.txt | ||
54 | @@ -50,6 +50,7 @@ if (THREADING STREQUAL "TBB") | ||
55 | set(MKLDNN_THR MKLDNN_THR_TBB) | ||
56 | elseif (THREADING STREQUAL "OMP") | ||
57 | set(MKLDNN_THR MKLDNN_THR_OMP) | ||
58 | + target_link_options(${TARGET_NAME} PRIVATE -fopenmp) | ||
59 | else() | ||
60 | set(MKLDNN_THR MKLDNN_THR_SEQ) | ||
61 | endif() | ||