GNU bug report logs - #48251
[PATCH] gnu: Update opencv

Previous Next

Package: guix-patches;

Reported by: Andy Tai <lichengtai <at> gmail.com>

Date: Thu, 6 May 2021 06:01:02 UTC

Severity: normal

Tags: patch

Done: Andy Tai <atai <at> atai.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48251 in the body.
You can then email your comments to 48251 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#48251; Package guix-patches. (Thu, 06 May 2021 06:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andy Tai <lichengtai <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 06 May 2021 06:01:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andy Tai <lichengtai <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Update opencv
Date: Wed, 5 May 2021 22:59:37 -0700
* gnu/packages/image-processing.scm (opencv): Update to 3.4.14
[arguments]: Adjust #:configure-flags.
[inputs]: add opencl-headers, ocl-icd
---
 gnu/packages/image-processing.scm | 120 +++++++++++++++++++++++-------
 1 file changed, 95 insertions(+), 25 deletions(-)

diff --git a/gnu/packages/image-processing.scm
b/gnu/packages/image-processing.scm
index ed21b26812..127fbbf8c0 100644
--- a/gnu/packages/image-processing.scm
+++ b/gnu/packages/image-processing.scm
@@ -65,6 +65,7 @@
   #:use-module (gnu packages image)
   #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages maths)
+  #:use-module (gnu packages opencl)
   #:use-module (gnu packages pdf)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages photo)
@@ -385,7 +386,7 @@ integrates with various databases on GUI toolkits
such as Qt and Tk.")
 (define-public opencv
   (package
     (name "opencv")
-    (version "3.4.3")
+    (version "3.4.14")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -394,14 +395,35 @@ integrates with various databases on GUI
toolkits such as Qt and Tk.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "06bc61r8myym4s8im10brdjfg4wxkrvsbhhl7vr1msdan2xddzi3"))
-              (patches
-               (search-patches "opencv-fix-build-of-grfmt_jpeg2000.cpp.patch"))
+                "0xfgky4j65vq1vy6wcb6p913akgyjw0fdh9b8x6ni7xdladzi0mz"))
+              ;;(patches
+              ;; (search-patches
"opencv-fix-build-of-grfmt_jpeg2000.cpp.patch"))
               (modules '((guix build utils)))
               (snippet
                '(begin
                   ;; Remove external libraries. We have all available in Guix:
-                  (delete-file-recursively "3rdparty")
+                  ;; except quirc not packaged yet in Guix
+                  ;;(delete-file-recursively "3rdparty")
+                  (for-each delete-file-recursively
+                      '("3rdparty/carotene"
+                        "3rdparty/cpufeatures"
+                        "3rdparty/ffmpeg"
+                        "3rdparty/include"
+                        "3rdparty/ippicv"
+                        "3rdparty/ittnotify"
+                        "3rdparty/libjasper"
+                        "3rdparty/libjpeg"
+                        "3rdparty/libjpeg-turbo"
+                        "3rdparty/libpng"
+                        "3rdparty/libtengine"
+                        "3rdparty/libtiff"
+                        "3rdparty/libwebp"
+                        "3rdparty/openexr"
+                        "3rdparty/openvx"
+                        "3rdparty/protobuf"
+                        ;;"3rdparty/quirc"
+                        "3rdparty/tbb"
+                        "3rdparty/zlib"))

                   ;; Milky icon set is non-free:
                   (delete-file-recursively
"modules/highgui/src/files_Qt/Milky")
@@ -462,7 +484,23 @@ integrates with various databases on GUI toolkits
such as Qt and Tk.")
              ;; defined in xfeatures2d/cmake/download_{vgg|bootdesc}.cmake
              ;; Cmp this bug entry:
              ;; https://github.com/opencv/opencv_contrib/issues/1131
-             "-DBUILD_opencv_xfeatures2d=OFF")
+             "-DBUILD_opencv_xfeatures2d=OFF"
+
+             ;; face module disabled as it downloads data
face_landmark_model.dat, etc.
+             ;; cannot be carried out during guix package build
+             "-DBUILD_opencv_face=OFF"
+
+             ;; allowing external VTK to be found
+             (string-append "-DVTK_DIR=" (assoc-ref %build-inputs
"vtk") "/lib/cmake/vtk-8.0")
+
+             ;; allowing external OpenEXR to be found
+             ;; for OpenEXR the cmake search script for OpenEXR
assumes ilmbase libs also should be found
+             ;; else it will try to force building the local OpenEXR
in 3rdParty directory which we don't want
+             (string-append "-DOPENEXR_ROOT:PATH=" (assoc-ref
%build-inputs  "openexr"))
+             (string-append "-DILMBASE_ROOT:PATH=" (assoc-ref
%build-inputs  "ilmbase"))
+
+             )
+
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'disable-broken-tests
@@ -481,7 +519,7 @@ integrates with various databases on GUI toolkits
such as Qt and Tk.")
              ;; But I couldn't figure out which file was missing:
              (substitute*
"../opencv-contrib/modules/face/test/test_face_align.cpp"
                (("(TEST\\(CV_Face_FacemarkKazemi, )(can_detect_landmarks\\).*)"
-                 all pre post)
+                all pre post)
                 (string-append pre "DISABLED_" post)))

              ;; Failure reason: Bad accuracy
@@ -489,6 +527,21 @@ integrates with various databases on GUI toolkits
such as Qt and Tk.")
              (substitute*
"../opencv-contrib/modules/rgbd/test/test_odometry.cpp"
                (("(TEST\\(RGBD_Odometry_Rgbd, )(algorithmic\\).*)"
all pre post)
                 (string-append pre "DISABLED_" post)))
+
+             ;; Failure reason: data reading failure
+             ;; these tests fail due to data reading using protobuf
+             (substitute* "modules/dnn/test/test_layers.cpp"
+               (("(TEST_P\\(Test_Caffe_layers, )(Accum\\).*)" all pre post)
+                (string-append pre "DISABLED_" post)))
+             (substitute* "modules/dnn/test/test_layers.cpp"
+               (("(TEST_P\\(Test_Caffe_layers,
)(DataAugmentation\\).*)" all pre post)
+                (string-append pre "DISABLED_" post)))
+             (substitute* "modules/dnn/test/test_layers.cpp"
+               (("(TEST_P\\(Test_Caffe_layers, )(Resample\\).*)" all pre post)
+                (string-append pre "DISABLED_" post)))
+             (substitute* "modules/dnn/test/test_layers.cpp"
+               (("(TEST_P\\(Test_Caffe_layers, )(Correlation\\).*)"
all pre post)
+                (string-append pre "DISABLED_" post)))
              #t))

          (add-after 'unpack 'unpack-submodule-sources
@@ -497,10 +550,21 @@ integrates with various databases on GUI
toolkits such as Qt and Tk.")
              (mkdir "../opencv-contrib")
              (copy-recursively (assoc-ref inputs "opencv-extra")
                                "../opencv-extra")
-             (invoke "tar" "xvf"
-                     (assoc-ref inputs "opencv-contrib")
-                     "--strip-components=1"
-                     "-C" "../opencv-contrib")))
+             (copy-recursively (assoc-ref inputs "opencv-contrib")
+                               "../opencv-contrib")
+             #t))
+
+         (add-after 'unpack  'patch-cmake-files
+             (lambda _
+             ;; make ILMBASE_ROOT effective
+               (substitute* "cmake/OpenCVFindOpenEXR.cmake"
+                 (("SET\\(SEARCH_PATHS") "SET\(SEARCH_PATHS\n
\"${ILMBASE_ROOT}\""))
+
+             ;; disable 3rdparty opencl header installation
+             ;; as we use Guix's opencl header
+               (substitute* "cmake/OpenCVDetectOpenCL.cmake"
+                 (("ocv_install_3rdparty_licenses")
+                   "#ocv_install_3rdparty_licenses"))))

          (add-after 'set-paths 'add-ilmbase-include-path
            (lambda* (#:key inputs #:allow-other-keys)
@@ -512,18 +576,21 @@ integrates with various databases on GUI
toolkits such as Qt and Tk.")
                                   "/include/OpenEXR"
                                   ":" (or (getenv "CPATH") "")))
            #t))
-       (add-before 'check 'start-xserver
-         (lambda* (#:key inputs #:allow-other-keys)
-           (let ((xorg-server (assoc-ref inputs "xorg-server"))
-                 (disp ":1"))
-             (setenv "HOME" (getcwd))
-             (setenv "DISPLAY" disp)
-             ;; There must be a running X server and make check
doesn't start one.
-             ;; Therefore we must do it.
-             (zero? (system (format #f "~a/bin/Xvfb ~a &" xorg-server
disp)))))))))
+
+         (add-before 'check 'start-xserver
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((xorg-server (assoc-ref inputs "xorg-server"))
+                     (disp ":1"))
+                 (setenv "HOME" (getcwd))
+                 (setenv "DISPLAY" disp)
+                 ;; There must be a running X server and make check
doesn't start one.
+                 ;; Therefore we must do it.
+                 (zero? (system (format #f "~a/bin/Xvfb ~a &"
xorg-server disp))))
+               #t)))))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("xorg-server" ,xorg-server-for-tests) ; For running the tests
+       ("opencl-headers" ,opencl-headers)
        ("opencv-extra"
         ,(origin
            (method git-fetch)
@@ -532,7 +599,7 @@ integrates with various databases on GUI toolkits
such as Qt and Tk.")
                   (commit version)))
            (file-name (git-file-name "opencv_extra" version))
            (sha256
-            (base32 "08p5xnq8n1jw8svvz0fnirfg7q8dm3p4a5dl7527s5xj0f9qn7lp"))))
+            (base32 "1m257hi34p511v4g3g2qx7ny8q2pgfi28lzkfmkilwhmhhw8iw0h"))))
        ("opencv-contrib"
         ,(origin
            (method git-fetch)
@@ -540,9 +607,9 @@ integrates with various databases on GUI toolkits
such as Qt and Tk.")
                   (url "https://github.com/opencv/opencv_contrib")
                   (commit version)))
            (file-name (git-file-name "opencv_contrib" version))
-           (patches (search-patches "opencv-rgbd-aarch64-test-fix.patch"))
+           ;;(patches (search-patches "opencv-rgbd-aarch64-test-fix.patch"))
            (sha256
-            (base32
"1f334glf39nk42mpqq6j732h3ql2mpz89jd4mcl678s8n73nfjh2"))))))
+            (base32
"11mqxnc5bw4yrdy7nwmrl8b98dxsql6s5pvk50dwdswlp06824m6"))))))
     (inputs `(("libjpeg" ,libjpeg-turbo)
               ("libpng" ,libpng)
               ("jasper" ,jasper)
@@ -551,15 +618,18 @@ integrates with various databases on GUI
toolkits such as Qt and Tk.")
               ("libtiff" ,libtiff)
               ("hdf5" ,hdf5)
               ("libgphoto2" ,libgphoto2)
+              ("v4l-utils" ,v4l-utils)                   ;libv4l2
               ("libwebp" ,libwebp)
               ("zlib" ,zlib)
               ("gtkglext" ,gtkglext)
               ("openexr" ,openexr)
               ("ilmbase" ,ilmbase)
-              ("gtk+" ,gtk+-2)
+              ("gtk+-2" ,gtk+-2)
+              ("gtk+" ,gtk+)
+              ("ocl-icd" ,ocl-icd) ;for OpenCL support
               ("python-numpy" ,python-numpy)
               ("protobuf" ,protobuf)
-              ("vtk" ,vtk)
+              ("vtk" ,vtk-8)
               ("python" ,python)))
     ;; These three CVEs are not a problem of OpenCV, see:
     ;; https://github.com/opencv/opencv/issues/10998
-- 
2.26.3




Information forwarded to guix-patches <at> gnu.org:
bug#48251; Package guix-patches. (Thu, 06 May 2021 06:11:02 GMT) Full text and rfc822 format available.

Message #8 received at 48251 <at> debbugs.gnu.org (full text, mbox):

From: Andy Tai <lichengtai <at> gmail.com>
To: 48251 <at> debbugs.gnu.org
Subject: Re: bug#48251: Acknowledgement ([PATCH] gnu: Update opencv)
Date: Wed, 5 May 2021 23:10:00 -0700
A comment on the patch:

I do not have ARM64 hardware so someone interested in that aspect may
want to run the patch on ARM64 to see no bad effects.  Note the two
patches for ARM64 are commented out as they don't apply; I did not try
to update the two patches, if needed.
 wish to submit further information on this problem, please




Information forwarded to guix-patches <at> gnu.org:
bug#48251; Package guix-patches. (Sat, 12 Nov 2022 20:02:02 GMT) Full text and rfc822 format available.

Message #11 received at 48251 <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 48251 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Christopher Baines <mail <at> cbaines.net>
Date: Sat, 12 Nov 2022 20:01:00 +0000
[Message part 1 (text/plain, inline)]
Hi,

I was looking for any pending patches for opencv-python but found this
orphaned one.

Current version of ocv in Guix - 4.5.4.

https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/image-processing.scm#n460

Regards,
Oleg
[Message part 2 (text/html, inline)]

bug closed, send any further explanations to 48251 <at> debbugs.gnu.org and Andy Tai <lichengtai <at> gmail.com> Request was from Andy Tai <atai <at> atai.org> to control <at> debbugs.gnu.org. (Sat, 04 Feb 2023 05:04:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 04 Mar 2023 12:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 50 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.