Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 663730 - media-libs/opencv-4.1.2 version bump
Summary: media-libs/opencv-4.1.2 version bump
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Amy Liffey
URL:
Whiteboard:
Keywords:
: 671708 (view as bug list)
Depends on: 689840
Blocks:
  Show dependency tree
 
Reported: 2018-08-15 20:30 UTC by Ulenrich
Modified: 2020-04-25 13:39 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
diff from opencv-3.4.1-r5 to opencv-4.0.1 (opencv-3.4.1-r5_to_4.0.1.patch,2.41 KB, patch)
2019-02-17 17:22 UTC, MW
Details | Diff
remove installation of opencl license txt (opencv-4.1.0-remove-opencl-license-install.patch,513 bytes, patch)
2019-05-19 22:43 UTC, Alexander Petermann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulenrich 2018-08-15 20:30:10 UTC
Trying a simple bump two of the patches do not work any more:
1. "${FILESDIR}/${P}-compilation-C-mode.patch"
2. eapply "${FILESDIR}/${PN}-3.3.0-remove-tiny-dnn-autodownload.patch"

First "compilation-C-mode" looked to me as if it has been upstreamed, but I got this error without the patch:

---
# emerge -1 media-libs/opencv

These are the packages that would be merged, in order:

Calculating dependencies  . . ........ done!
[ebuild  r  U  ] media-libs/opencv-3.4.2:0/3.4.2::pmaci [3.4.1-r2:0/3.4.1::gentoo] USE="contrib* contrib_cvv* -contrib_dnn contrib_hdf* -contrib_sfm -contrib_xfeatures2d -cuda -debug -dnn_samples eigen -examples ffmpeg* gdal -gflags -glog gphoto2 gstreamer gtk -ieee1394 (-ipp) java* jpeg jpeg2k lapack -libav -opencl openexr opengl openmp pch png python qt5 -tesseract -testprograms threads tiff v4l vaapi -vtk webp -xine" ABI_X86="32* (64) (-x32)" CPU_FLAGS_X86="-avx -avx2 -fma3 -popcnt sse sse2 sse3 sse4_1 -sse4_2 ssse3" PYTHON_TARGETS="python2_7 -python3_4 -python3_5 python3_6" 0 KiB

...

In file included from /usr/include/python3.6m/Python.h:53:0,
                 from /srv/portage/media-libs/opencv-3.4.2/work/opencv-3.4.2/modules/python/src2/cv2.cpp:8:
/usr/include/python3.6m/pyport.h:686:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
 #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  ^~~~~
make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/build.make:63: modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o] Error 1
make[2]: Leaving directory '/srv/portage/media-libs/opencv-3.4.2/work/opencv-3.4.2-abi_x86_32.x86'
make[1]: *** [CMakeFiles/Makefile2:7428: modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
make[1]: Leaving directory '/srv/portage/media-libs/opencv-3.4.2/work/opencv-3.4.2-abi_x86_32.x86'
make: *** [Makefile:163: all] Error 2
---
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2018-12-09 20:56:25 UTC
*** Bug 671708 has been marked as a duplicate of this bug. ***
Comment 2 MW 2019-02-17 09:12:39 UTC
I'm struggling to see how the question and the title are related. The question seems to concern =media-libs/opencv-3.4.2 and not =media-libs/opencv-4.0.1. Was this accidentally renamed?
Comment 3 Amy Liffey gentoo-dev 2019-02-17 17:10:46 UTC
(In reply to MW from comment #2)
> I'm struggling to see how the question and the title are related. The
> question seems to concern =media-libs/opencv-3.4.2 and not
> =media-libs/opencv-4.0.1. Was this accidentally renamed?

There is no question as far as I can see and it was not renamed accidentally, we are bumping it straight to 4.0.1 soon.
Comment 4 MW 2019-02-17 17:22:55 UTC
Created attachment 565658 [details, diff]
diff from opencv-3.4.1-r5 to opencv-4.0.1

Successfully built opencv-4.0.1 after ebuild changes in the attached patch.

The following issues will need to be sorted out:

1. Go through and see which of the PATCHES are still meaningful. My lazy approach of just ignoring the patches is viable only for testing/prototyping the ebuild.

2. Go through the list of build options and make sure things are up to date.
Comment 5 Amy Liffey gentoo-dev 2019-02-17 17:24:44 UTC
(In reply to MW from comment #4)
> Created attachment 565658 [details, diff] [details, diff]
> diff from opencv-3.4.1-r5 to opencv-4.0.1
> 
> Successfully built opencv-4.0.1 after ebuild changes in the attached patch.
> 
> The following issues will need to be sorted out:
> 
> 1. Go through and see which of the PATCHES are still meaningful. My lazy
> approach of just ignoring the patches is viable only for testing/prototyping
> the ebuild.
> 
> 2. Go through the list of build options and make sure things are up to date.

I already have ebuild, but I can inspire possibly.. Unfortunately it sometimes brings more work ..
Comment 6 MW 2019-02-17 17:36:15 UTC
(In reply to Amy Liffey from comment #5)
> I already have ebuild, but I can inspire possibly.. Unfortunately it
> sometimes brings more work ..

What's the status of your efforts? I am happy to help, if I can.
Comment 7 Amy Liffey gentoo-dev 2019-02-17 18:12:21 UTC
(In reply to MW from comment #6)
> (In reply to Amy Liffey from comment #5)
> > I already have ebuild, but I can inspire possibly.. Unfortunately it
> > sometimes brings more work ..
> 
> What's the status of your efforts? I am happy to help, if I can.

Not doing lazy effort test with all the useflags and checkout all the options. Tests are running it takes time and sometimes it does false positive bugs. Which takes time to resolve as well.
Comment 8 MW 2019-02-17 18:49:44 UTC
Cool, then there is little point in me doing anything at the moment?

 - Additional fiddling here shows that cuda is no longer a requirement for building with contrib_xfeatures2d (as was the case recently, see bug 636030).
 - The ebuild doesn't seem to provide a way of toggling OPENCV_ENABLE_NONFREE. Shouldn't there be one?
Comment 9 Amy Liffey gentoo-dev 2019-02-17 20:07:36 UTC
(In reply to MW from comment #8)
> Cool, then there is little point in me doing anything at the moment?
> 
>  - Additional fiddling here shows that cuda is no longer a requirement for
> building with contrib_xfeatures2d (as was the case recently, see bug 636030).
>  - The ebuild doesn't seem to provide a way of toggling
> OPENCV_ENABLE_NONFREE. Shouldn't there be one?

Actually maybe you can look into my overlay and see where it is the development there and maybe help? I just committed recent last version but it is surely not complete yet. [1]

[1] https://gitlab.com/Zelena/hell-overlay/commit/8a12c5d2dcaa4be7f3fe666a4d2d1a68e7e7d2d0#83f081e757c8f07605458a661a474f1a3bf6701a
Comment 10 MW 2019-02-18 19:30:27 UTC
(In reply to Amy Liffey from comment #9)
> Actually maybe you can look into my overlay and see where it is the
> development there and maybe help? I just committed recent last version but
> it is surely not complete yet. [1]
> 
> [1]
> https://gitlab.com/Zelena/hell-overlay/commit/
> 8a12c5d2dcaa4be7f3fe666a4d2d1a68e7e7d2d0#83f081e757c8f07605458a661a474f1a3bf6
> 701a

I have checked it out and verified that it works (x86_64-pc-linux-gnu, no-multilib), but I don't know what work remains to be done on this (except removing the cuda dependency from contrib_xfeatures_2d). The only other obvious change would be to move -DWITH_QUIRC=OFF down in the list to its corresponding place in CMakeLists.txt.

I will need some directions if I am to be able to help, but I also realise it's likely to take more time giving me the instructions than just doing the work instead :)
Comment 11 Raimund 2019-04-05 18:00:56 UTC
Hi all,

I can also confirm that I was able to compile openCV using the ebuild from here

> https://gitlab.com/Zelena/hell-overlay/commit/
> 8a12c5d2dcaa4be7f3fe666a4d2d1a68e7e7d2d0#83f081e757c8f07605458a661a474f1a3bf6
> 701a

with gcc 8.3.

However, I compiled it with the cuda flag enabled, and that doesn't work without the contrib flag, so this should be added to the first line of the REQUIRED_USE section. [1]

As I am using cuda 10.1, an additional patch is necessary for that [2]:
https://github.com/qc2105/opencv/commit/b32ba55150c5d678836a80700a126dae8c5b67f8

Seems like the other patch mentioned here [3] is already applied to the contributed file upstream.

[1] https://github.com/opencv/opencv/issues/12768
[2] https://github.com/opencv/opencv/issues/13952
[3] https://github.com/qc2105/opencv_contrib/commit/981165bcec5689c27322175d2d2ff9f6bbb80ceb
Comment 12 Ross Charles C. 2019-05-04 02:09:46 UTC
opencv 4.1.0 is already out: https://github.com/opencv/opencv/wiki/ChangeLog#version410
Comment 13 Alexander Petermann 2019-05-19 22:43:44 UTC
Created attachment 577330 [details, diff]
remove installation of opencl license txt

opencv 4.1.0 tries to install opencl license files from the 3rdparty folder, but the ebuild by Amy Liffey removes all files in this subfolder. So I removed the install line in the corresponding cmake file.
Comment 14 Thomas Capricelli 2019-07-14 18:18:37 UTC
(In reply to Amy Liffey from comment #9)
> Actually maybe you can look into my overlay and see where it is 

I tried this one today, along with the modification from MW (removing cuda dep for xfeatures2d).

It emerges successfully with USE="contrib contrib_xfeatures2d -cuda"

Unfortunately, because of https://bugs.gentoo.org/689840, xfeatures2d is not there anyway, but that's another story.
Comment 15 David Heidelberg (okias) 2019-10-30 22:12:16 UTC
can someone created PullReq from some existing solution?

It also blocks [1], since opencv 4.x removes dependency on gtkglext (since it can use GTK3)


[1] https://bugs.gentoo.org/698950
Comment 16 David Heidelberg (okias) 2019-10-30 22:13:12 UTC
can someone create PullReq from some existing solution?

It also blocks [1], since opencv 4.x removes dependency on gtkglext (since it can use GTK3)


[1] https://bugs.gentoo.org/698950
Comment 17 Amy Liffey gentoo-dev 2019-11-01 06:30:00 UTC
(In reply to David Heidelberg (okias) from comment #16)
> can someone create PullReq from some existing solution?
> 
> It also blocks [1], since opencv 4.x removes dependency on gtkglext (since
> it can use GTK3)
> 
> 
> [1] https://bugs.gentoo.org/698950

I will try to somehow make it work..
Comment 18 Larry the Git Cow gentoo-dev 2019-11-28 16:56:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2bb83a3237876597e597b7afcabd15e817ed717e

commit 2bb83a3237876597e597b7afcabd15e817ed717e
Author:     Amy Liffey <amynka@gentoo.org>
AuthorDate: 2019-11-28 16:44:07 +0000
Commit:     Amy Liffey <amynka@gentoo.org>
CommitDate: 2019-11-28 16:55:37 +0000

    media-libs/opencv: version bump 4.1.2
    
    Closes: https://bugs.gentoo.org/685106
    Closes: https://bugs.gentoo.org/678460
    Closes: https://bugs.gentoo.org/663730
    Closes: https://bugs.gentoo.org/689840
    Package-Manager: Portage-2.3.76, Repoman-2.3.16
    Signed-off-by: Amy Liffey <amynka@gentoo.org>

 media-libs/opencv/Manifest            |   2 +
 media-libs/opencv/metadata.xml        |   2 +
 media-libs/opencv/opencv-4.1.2.ebuild | 494 ++++++++++++++++++++++++++++++++++
 3 files changed, 498 insertions(+)
Comment 19 Johannes Hirte 2019-11-28 19:16:27 UTC
(In reply to Alexander Pitzer from comment #13)
> Created attachment 577330 [details, diff] [details, diff]
> remove installation of opencl license txt
> 
> opencv 4.1.0 tries to install opencl license files from the 3rdparty folder,
> but the ebuild by Amy Liffey removes all files in this subfolder. So I
> removed the install line in the corresponding cmake file.

Same problem with media-libs/opencv-4.1.2 again. The patch still works for this version.
Comment 20 Thomas Capricelli 2019-12-01 00:20:13 UTC
media-libs/opencv-4.1.2 doesn't work here.. As other reported, it fails with 

CMake Error at cmake_install.cmake:41 (file):
  file INSTALL cannot find
  "/tmp/portage/media-libs/opencv-4.1.2/work/opencv-4.1.2/3rdparty/include/opencl/LICENSE.txt".
Comment 21 Thomas Capricelli 2019-12-01 00:50:04 UTC
Also, the ebuild has a dependancy on pkg-config:

DEPEND="${RDEPEND}
    virtual/pkgconfig[${MULTILIB_USEDEP}]

Which is probably a left over from previous ebuilds, as the ebuild actually doesn't install any pkgconfig. Which breaks lot of programs based on opencv (probably some ebuilds too, haven't checked).


According to 
https://github.com/opencv/opencv/issues/13154#issuecomment-439335340

We now need to add OPENCV_GENERATE_PKGCONFIG=ON
Comment 22 Thomas Capricelli 2019-12-01 00:57:52 UTC
Another problem is the following. Not sure if it's opencv or gentoo/ebuild. I googled for it but couldn't find anything noteworthy.

When compiling projects, i have this error:

make: *** [Makefile:1047: akaze.o] Error 1
make: *** Attesa per i processi non terminati....
In file included from /usr/include/opencv4/opencv2/core/cvdef.h:10,
                 from /usr/include/opencv4/opencv2/core.hpp:52,
                 from /usr/include/opencv4/opencv2/imgcodecs.hpp:46,
                 from backend.cpp:14:
/usr/include/x86_64-pc-linux-gnu/opencv4/opencv2/core/cvdef.h:316:10: fatal error: cv_cpu_dispatch.h: File o directory non esistente


The file is there (/usr/include/opencv4/opencv2/core/cv_cpu_dispatch.h, but i dont get the trick between /usr/include/opencv4/opencv2/ and /usr/include/x86_64-pc-linux-gnu/opencv4/opencv2/

I got this problem with my own projects, and at least one ebuild now fails because of this: media-gfx/nomacs (with +opencv of course).
Comment 23 Aleksander Zatserkovnyy 2019-12-14 04:14:53 UTC
opencv 4.1.2-r2 installs cv2 python package in the path
/usr/lib/python3.6/site-packages/
, not in the /usr/lib64/python3.6/site-packages where other python packages are located. 

So , if you don't have link /usr/lib -> /usr/lib64 (the case take place on fresh gentoo installations) you will need to take some actions to make cv2 visible in python (PYTHONPATH or add links).
Comment 24 Amy Liffey gentoo-dev 2020-04-25 13:39:31 UTC
Seems to be in tree already..