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: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Amy Liffey
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-14 14:33 UTC by Thomas Capricelli
Modified: 2019-07-16 05:16 UTC (History)
0 users

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)