1 |
commit: e62eff34b2ebd90b7b23812d793456df4dba22fc |
2 |
Author: Yurii Moskalenko <yuramuv <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon Jul 3 01:21:32 2017 +0000 |
4 |
Commit: Amy Liffey <amynka <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jul 27 18:36:55 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e62eff34 |
7 |
|
8 |
media-libs/opencv: Fix usage CPU instructions |
9 |
|
10 |
.../opencv-3.2.0-fix_ussage_cpu_instructions.patch | 64 ++++++++++++++++++++++ |
11 |
...encv-3.2.0-r1.ebuild => opencv-3.2.0-r2.ebuild} | 1 + |
12 |
2 files changed, 65 insertions(+) |
13 |
|
14 |
diff --git a/media-libs/opencv/files/opencv-3.2.0-fix_ussage_cpu_instructions.patch b/media-libs/opencv/files/opencv-3.2.0-fix_ussage_cpu_instructions.patch |
15 |
new file mode 100644 |
16 |
index 00000000000..7b88216f329 |
17 |
--- /dev/null |
18 |
+++ b/media-libs/opencv/files/opencv-3.2.0-fix_ussage_cpu_instructions.patch |
19 |
@@ -0,0 +1,64 @@ |
20 |
+--- a/cmake/OpenCVCompilerOptions.cmake |
21 |
++++ b/cmake/OpenCVCompilerOptions.cmake |
22 |
+@@ -164,8 +164,6 @@ if(CMAKE_COMPILER_IS_GNUCXX) |
23 |
+ # Other optimizations |
24 |
+ if(ENABLE_OMIT_FRAME_POINTER) |
25 |
+ add_extra_compiler_option(-fomit-frame-pointer) |
26 |
+- else() |
27 |
+- add_extra_compiler_option(-fno-omit-frame-pointer) |
28 |
+ endif() |
29 |
+ if(ENABLE_FAST_MATH) |
30 |
+ add_extra_compiler_option(-ffast-math) |
31 |
+@@ -195,8 +193,6 @@ if(CMAKE_COMPILER_IS_GNUCXX) |
32 |
+ if(NOT MINGW) |
33 |
+ if(ENABLE_AVX) |
34 |
+ add_extra_compiler_option(-mavx) |
35 |
+- elseif(X86 OR X86_64) |
36 |
+- add_extra_compiler_option(-mno-avx) |
37 |
+ endif() |
38 |
+ if(ENABLE_AVX2) |
39 |
+ add_extra_compiler_option(-mavx2) |
40 |
+@@ -210,26 +206,18 @@ if(CMAKE_COMPILER_IS_GNUCXX) |
41 |
+ if(NOT OPENCV_EXTRA_CXX_FLAGS MATCHES "-mavx") |
42 |
+ if(ENABLE_SSE3) |
43 |
+ add_extra_compiler_option(-msse3) |
44 |
+- elseif(X86 OR X86_64) |
45 |
+- add_extra_compiler_option(-mno-sse3) |
46 |
+ endif() |
47 |
+ |
48 |
+ if(ENABLE_SSSE3) |
49 |
+ add_extra_compiler_option(-mssse3) |
50 |
+- elseif(X86 OR X86_64) |
51 |
+- add_extra_compiler_option(-mno-ssse3) |
52 |
+ endif() |
53 |
+ |
54 |
+ if(ENABLE_SSE41) |
55 |
+ add_extra_compiler_option(-msse4.1) |
56 |
+- elseif(X86 OR X86_64) |
57 |
+- add_extra_compiler_option(-mno-sse4.1) |
58 |
+ endif() |
59 |
+ |
60 |
+ if(ENABLE_SSE42) |
61 |
+ add_extra_compiler_option(-msse4.2) |
62 |
+- elseif(X86 OR X86_64) |
63 |
+- add_extra_compiler_option(-mno-sse4.2) |
64 |
+ endif() |
65 |
+ |
66 |
+ if(ENABLE_POPCNT) |
67 |
+@@ -238,16 +226,6 @@ if(CMAKE_COMPILER_IS_GNUCXX) |
68 |
+ endif() |
69 |
+ endif(NOT MINGW) |
70 |
+ |
71 |
+- if(X86 OR X86_64) |
72 |
+- if(NOT APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 4) |
73 |
+- if(OPENCV_EXTRA_CXX_FLAGS MATCHES "-m(sse2|avx)") |
74 |
+- add_extra_compiler_option(-mfpmath=sse)# !! important - be on the same wave with x64 compilers |
75 |
+- else() |
76 |
+- add_extra_compiler_option(-mfpmath=387) |
77 |
+- endif() |
78 |
+- endif() |
79 |
+- endif() |
80 |
+- |
81 |
+ # Profiling? |
82 |
+ if(ENABLE_PROFILING) |
83 |
+ add_extra_compiler_option("-pg -g" |
84 |
|
85 |
diff --git a/media-libs/opencv/opencv-3.2.0-r1.ebuild b/media-libs/opencv/opencv-3.2.0-r2.ebuild |
86 |
similarity index 99% |
87 |
rename from media-libs/opencv/opencv-3.2.0-r1.ebuild |
88 |
rename to media-libs/opencv/opencv-3.2.0-r2.ebuild |
89 |
index fc5c7aeb029..e8fe383042f 100644 |
90 |
--- a/media-libs/opencv/opencv-3.2.0-r1.ebuild |
91 |
+++ b/media-libs/opencv/opencv-3.2.0-r2.ebuild |
92 |
@@ -97,6 +97,7 @@ PATCHES=( |
93 |
"${FILESDIR}/${PN}-3.1.0-find-libraries-fix.patch" |
94 |
"${FILESDIR}/${P}-vtk.patch" |
95 |
"${FILESDIR}/${P}-gcc-6.0.patch" |
96 |
+ "${FILESDIR}/${PN}-3.2.0-fix_ussage_cpu_instructions.patch" |
97 |
) |
98 |
|
99 |
pkg_pretend() { |