Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 689838 - media-libs/opencv-3.4.x - In file included from modules/stitching/opencv_stitching_pch_dephelp.cxx:1: .../work/opencv-3.4.1/modules/stitching/include/opencv2/stitching/detail/matchers.hpp:52:12: fatal error: opencv2/xfeatures2d/cuda.hpp: File o directory
Summary: media-libs/opencv-3.4.x - In file included from modules/stitching/opencv_stit...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Amy Liffey
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2019-07-14 14:33 UTC by Thomas Capricelli
Modified: 2020-12-27 04:37 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Capricelli 2019-07-14 14:33:26 UTC
I got hit by the famous error (lot of report on the net like this:)

In file included from /tmp/portage/media-libs/opencv-3.4.1-r6/work/opencv-3.4.1/modules/stitching/include/opencv2/stitching.hpp:49,
                 from /tmp/portage/media-libs/opencv-3.4.1-r6/work/opencv-3.4.1/modules/stitching/src/precomp.hpp:59,
                 from modules/stitching/opencv_stitching_pch_dephelp.cxx:1:
/tmp/portage/media-libs/opencv-3.4.1-r6/work/opencv-3.4.1/modules/stitching/include/opencv2/stitching/detail/matchers.hpp:52:12: fatal error: opencv2/xfeatures2d/cuda.hpp: File o directory non esistente
 #  include "opencv2/xfeatures2d/cuda.hpp"
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


The reason is not as trivial as it seems. I want to emerge with USE="contrib contrib_xfeatures2d -cuda".

This happens in the 'stitching' module. In opencv module kinda autodetect other features and adapt. In this case
* the xfeatures2d detects that cuda is not used and compiles fine
* the 'stitching' module detects xfeatures2d and allows more code paths with a define. The problem is that it only works with a cuda-enabled xfeatures2d. 

All of those information is courtesy of people from irc channel #opencv

My 'solution', locally, is to add 
    GLOBALCMAKEARGS+=(
        -DBUILD_opencv_stitching=OFF
    )

in the ebuild. and it emerges fine with that.

The 'real' solution would be to have a rule "contrib_xfeatures2d and -cuda -> disable stitching". But that's where my ebuild skills stops..

Hope someone can do something with this..

(https://bugs.gentoo.org/685106 is unrelated while similar : it's in the case of actually using cuda)
Comment 1 Larry the Git Cow gentoo-dev 2020-10-16 21:48:02 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c21b91ad2464439514aae406a0c0d5f310aca1d

commit 5c21b91ad2464439514aae406a0c0d5f310aca1d
Author:     Ross Charles Campbell <rossbridger.cc@gmail.com>
AuthorDate: 2020-10-14 02:17:02 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2020-10-16 21:47:50 +0000

    media-libs/opencv: version bump to 4.5.0
    
    Bug: https://bugs.gentoo.org/701790
    Bug: https://bugs.gentoo.org/700176
    Bug: https://bugs.gentoo.org/717812
    Bug: https://bugs.gentoo.org/703658
    Bug: https://bugs.gentoo.org/689838
    Closes: https://bugs.gentoo.org/666716
    Closes: https://bugs.gentoo.org/747163
    Closes: https://bugs.gentoo.org/729190
    Closes: https://bugs.gentoo.org/699730
    Closes: https://bugs.gentoo.org/672840
    Package-Manager: Portage-3.0.8, Repoman-3.0.1
    
    Signed-off-by: Ross Charles Campbell <rossbridger.cc@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/17899
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/opencv/Manifest            |   2 +
 media-libs/opencv/opencv-4.5.0.ebuild | 555 ++++++++++++++++++++++++++++++++++
 2 files changed, 557 insertions(+)
Comment 2 Larry the Git Cow gentoo-dev 2020-12-27 04:34:12 UTC
The bug has been closed via the following commit(s):

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

commit e402fc2e336e59a514557c6c1bdb014cb590fad1
Author:     Ross Charles Campbell <rossbridger.cc@gmail.com>
AuthorDate: 2020-12-24 06:05:46 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2020-12-27 04:34:08 +0000

    media-libs/opencv: version bump, remove old
    
     - Added constraint on CPU flags on x86
    
     - Also closed out bugs that wasn't reported reproducible on newer versions
    
    Closes: https://bugs.gentoo.org/751781
    Closes: https://bugs.gentoo.org/703658
    Closes: https://bugs.gentoo.org/706040
    Closes: https://bugs.gentoo.org/721706
    Closes: https://bugs.gentoo.org/689838
    Package-Manager: Portage-3.0.12, Repoman-3.0.2
    Signed-off-by: Ross Charles Campbell <rossbridger.cc@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/18801
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/opencv/Manifest                         |  4 ++--
 ...{opencv-4.4.0-r1.ebuild => opencv-4.5.1.ebuild} | 26 +++++++++++++++-------
 2 files changed, 20 insertions(+), 10 deletions(-)