Accepting request 546456 from KDE:Extra
OBS-URL: https://build.opensuse.org/request/show/546456 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/opencv?expand=0&rev=69
This commit is contained in:
parent
314d715c2b
commit
d0704134e2
33
fix_processor_detection_for_32bit_on_64bit.patch
Normal file
33
fix_processor_detection_for_32bit_on_64bit.patch
Normal file
@ -0,0 +1,33 @@
|
||||
--- opencv-3.3.0/cmake/OpenCVDetectCXXCompiler.cmake_orig 2017-10-27 06:32:16.790452991 +0200
|
||||
+++ opencv-3.3.0/cmake/OpenCVDetectCXXCompiler.cmake 2017-10-27 06:34:33.035306589 +0200
|
||||
@@ -60,6 +60,7 @@
|
||||
endif()
|
||||
endif()
|
||||
|
||||
+message(STATUS "Detected processor: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
if(MSVC64 OR MINGW64)
|
||||
set(X86_64 1)
|
||||
elseif(MINGW OR (MSVC AND NOT CMAKE_CROSSCOMPILING))
|
||||
@@ -76,11 +77,17 @@
|
||||
set(PPC64LE 1)
|
||||
endif()
|
||||
|
||||
-# Workaround for 32-bit operating systems on 64-bit x86_64 processor
|
||||
-if(X86_64 AND CMAKE_SIZEOF_VOID_P EQUAL 4 AND NOT FORCE_X86_64)
|
||||
- message(STATUS "sizeof(void) = 4 on x86 / x86_64 processor. Assume 32-bit compilation mode (X86=1)")
|
||||
- unset(X86_64)
|
||||
- set(X86 1)
|
||||
+# Workaround for 32-bit operating systems on x86_64/aarch64 processor
|
||||
+if(CMAKE_SIZEOF_VOID_P EQUAL 4 AND NOT FORCE_X86_64)
|
||||
+ message(STATUS "sizeof(void) = 4 on 64 bit processor. Assume 32-bit compilation mode")
|
||||
+ if (X86_64)
|
||||
+ unset(X86_64)
|
||||
+ set(X86 1)
|
||||
+ endif()
|
||||
+ if (AARCH64)
|
||||
+ unset(AARCH64)
|
||||
+ set(ARM 1)
|
||||
+ endif()
|
||||
endif()
|
||||
|
||||
# Similar code exists in OpenCVConfig.cmake
|
12
opencv-gles.patch
Normal file
12
opencv-gles.patch
Normal file
@ -0,0 +1,12 @@
|
||||
--- opencv-3.1.0.orig/modules/highgui/src/window_QT.cpp 2015-12-18 16:02:16.000000000 +0100
|
||||
+++ opencv-3.1.0/modules/highgui/src/window_QT.cpp 2016-02-26 22:31:37.004570651 +0100
|
||||
@@ -3165,7 +3165,9 @@
|
||||
|
||||
void OpenGlViewPort::initializeGL()
|
||||
{
|
||||
+#ifdef GL_PERSPECTIVE_CORRECTION_HINT
|
||||
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
|
||||
+#endif
|
||||
}
|
||||
|
||||
void OpenGlViewPort::resizeGL(int w, int h)
|
@ -1,3 +1,12 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Nov 25 14:29:14 UTC 2017 - stefan.bruens@rwth-aachen.de
|
||||
|
||||
- Readd opencv-gles.patch, it is *not* included upstream; otherwise
|
||||
build breaks on all GLES Qt5 platforms (armv6l, armv7l, aarch64)
|
||||
- add fix_processor_detection_for_32bit_on_64bit.patch
|
||||
- Correctly set optimizations and dynamic dispatch on ARM, use
|
||||
OpenCV 3.3 syntax on x86.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 13 09:21:35 UTC 2017 - mpluskal@suse.com
|
||||
|
||||
|
33
opencv.spec
33
opencv.spec
@ -33,10 +33,14 @@ Url: http://opencv.org/
|
||||
Source0: https://github.com/opencv/opencv/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
# This is the FACE module from the opencv_contrib package. Packaged separately to prevent too much usntable modules
|
||||
Source1: opencv_contrib_face-3.1.0.tar.bz2
|
||||
# PATCH-FIX-OPENCSUSE opencv-gles.patch -- Make sure PERSPECTIVE_CORRECTION_HINT is validated first, https://github.com/opencv/opencv/issues/9171
|
||||
Patch1: opencv-gles.patch
|
||||
# PATCH-FIX-OPENSUSE opencv-build-compare.patch -- avoid republish if some random external version number changes
|
||||
Patch8: opencv-build-compare.patch
|
||||
# PATCH-FIX-OPENSUSE 0001-Do-not-include-glx.h-when-using-GLES.patch -- Fix build error on 32bit ARM, due to incompatible pointer types
|
||||
# PATCH-FIX-OPENSUSE 0001-Do-not-include-glx.h-when-using-GLES.patch -- Fix build error on 32bit ARM, due to incompatible pointer types, https://github.com/opencv/opencv/issues/9171
|
||||
Patch11: 0001-Do-not-include-glx.h-when-using-GLES.patch
|
||||
# PATCH-FIX-OPENSUSE fix_processor_detection_for_32bit_on_64bit.patch -- Fix CPU detection for 32bit build on qemu-system-aarch64
|
||||
Patch12: fix_processor_detection_for_32bit_on_64bit.patch
|
||||
BuildRequires: cmake
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: libeigen3-devel
|
||||
@ -167,7 +171,10 @@ This package contains the documentation and examples for the OpenCV library.
|
||||
rm -f doc/packaging.txt
|
||||
|
||||
%build
|
||||
# TODO for OCV 3.3: https://github.com/opencv/opencv/wiki/CPU-optimizations-build-options
|
||||
# Dynamic dispatch: https://github.com/opencv/opencv/wiki/CPU-optimizations-build-options
|
||||
# x86: disable SSE on 32bit, do not dispatch AVX and later - SSE3
|
||||
# is the highest extension available on any non-64bit x86 CPU
|
||||
# ARM: ARMv6, e.g. RPi1, only has VFPv2
|
||||
%cmake \
|
||||
%if %{with tests}
|
||||
-DBUILD_TESTS=ON \
|
||||
@ -182,10 +189,26 @@ rm -f doc/packaging.txt
|
||||
-DWITH_IPP=OFF \
|
||||
-DWITH_TBB=ON \
|
||||
%ifarch %{ix86}
|
||||
-DENABLE_SSE=0 \
|
||||
-DENABLE_SSE2=0 \
|
||||
-DCPU_BASELINE_DISABLE=SSE \
|
||||
-DCPU_DISPATCH=SSE,SSE2,SSE3 \
|
||||
%endif
|
||||
-DENABLE_SSE3=0
|
||||
%ifarch x86_64
|
||||
-DCPU_BASELINE=SSE2 \
|
||||
-DCPU_DISPATCH=SSE3,SSE4_1,SSE4_2,AVX,FP16,AVX2 \
|
||||
%endif
|
||||
%ifarch %{arm}
|
||||
%ifarch armv7l armv7hl
|
||||
-DCPU_BASELINE=VFPV3 \
|
||||
-DCPU_DISPATCH=NEON \
|
||||
%else
|
||||
-DCPU_BASELINE_DISABLE=NEON,VFPV3 \
|
||||
%endif
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
-DCPU_BASELINE=NEON \
|
||||
-DCPU_DISPATCH=FP16 \
|
||||
%endif
|
||||
|
||||
make %{?_smp_mflags} VERBOSE=1
|
||||
|
||||
%check
|
||||
|
Loading…
Reference in New Issue
Block a user