Summary: | media-libs/opencv-4.4.0[pch,eigen] with dev-cpp/eigen-3.3.7-r1 - .../opencv-4.1.2/modules/core/include/opencv2/core/private.hpp:66:12: fatal error: Eigen/Core: No such file or directory | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Dennis Schridde <dschridde+gentoobugs> |
Component: | Current packages | Assignee: | Amy Liffey <amynka> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alecm, gentoo, nrndda, orzel, rossbridger.cc, sam, stefantalpalaru, trxman |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://github.com/opencv/opencv/issues/14868 https://github.com/opencv/opencv/pull/13337 https://bugs.gentoo.org/show_bug.cgi?id=747949 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 738380, 746596 | ||
Attachments: | build.log |
Description
Dennis Schridde
2020-07-24 17:41:08 UTC
Upstream issue: https://github.com/opencv/opencv/issues/14868 A working opencv-4.1.2-r4 is available in my overlay: https://github.com/stefantalpalaru/gentoo-overlay (In reply to Ștefan Talpalaru from comment #1) > Upstream issue: https://github.com/opencv/opencv/issues/14868 > > A working opencv-4.1.2-r4 is available in my overlay: > https://github.com/stefantalpalaru/gentoo-overlay He makes this change to the ebuild: ``` --- /var/cache/portage/gentoo/media-libs/opencv/opencv-4.1.2-r3.ebuild 2020-06-22 21:09:08.000000000 +0200 +++ stefantalpalaru/media-libs/opencv/opencv-4.1.2-r4.ebuild 2020-08-06 09:33:52.267681332 +0200 @@ -439,6 +439,13 @@ fi fi + # https://bugs.gentoo.org/733796 + if use eigen; then + GLOBALCMAKEARGS+=( + -DEIGEN_INCLUDE_PATH="$(pkg-config --cflags-only-I eigen3 | sed 's/^-I//')" + ) + fi + # workaround for bug 413429 tc-export CC CXX ``` That upstream issue is actually quite old and the bug there already fixed in a PR. Looking at the patch helped to track this down further, though. dev-cpp/eigen-3.3.7-r1 does not install a FindEigen3.cmake file: # rg find_package /tmp/portage/media-libs/opencv-4.1.2-r3/work/opencv-4.1.2/ | rg -i eigen /tmp/portage/media-libs/opencv-4.1.2-r3/work/opencv-4.1.2/cmake/OpenCVFindLibsPerf.cmake: find_package(Eigen3 QUIET) # q list -e eigen | rg cmake /usr/lib64/cmake/eigen3/Eigen3Targets.cmake /usr/lib64/cmake/eigen3/UseEigen3.cmake /usr/lib64/cmake/eigen3/Eigen3Config.cmake /usr/lib64/cmake/eigen3/Eigen3ConfigVersion.cmake Is OpenCV ready to work with find_package(Eigen3) in config mode? https://cmake.org/cmake/help/latest/command/find_package.html#full-signature-and-config-mode I tried to get Eigen's instructions [1] on how to use it somehow into the OpenCV build system, but failed. I followed the instructions at the top of .../opencv-4.1.2/cmake/OpenCVModule.cmake on how to use ocv_add_module, adding extra dependencies using ocv_target_link_libraries from .../opencv-4.1.2/cmake/OpenCVUtils.cmake. OPENCV_MODULE_opencv_photo_LINK_DEPS contains Eigen3::Eigen now (verified in .../opencv-4.1.2-abi_x86_64.amd64/CMakeVars.txt), but the include path is still not added when calling the compiler to build that module. WIP patch (does not fix the problem): ``` --- opencv-4.1.2/modules/photo/CMakeLists.txt.orig 2020-08-06 12:52:45.144912049 +0200 +++ opencv-4.1.2/modules/photo/CMakeLists.txt 2020-08-06 12:52:55.558857166 +0200 @@ -4,4 +4,5 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations -Wshadow) endif() -ocv_define_module(photo opencv_imgproc OPTIONAL opencv_cudaarithm opencv_cudaimgproc WRAP java python js) +ocv_add_module(photo opencv_imgproc OPTIONAL opencv_cudaarithm opencv_cudaimgproc WRAP java python js) +ocv_target_link_libraries(opencv_photo Eigen3::Eigen) ``` [1]: https://eigen.tuxfamily.org/dox/TopicCMakeGuide.html (In reply to Dennis Schridde from comment #4) > I tried to get Eigen's instructions [1] on how to use it somehow into the > OpenCV build system, but failed. [...] It appears all modules are affected, so maybe I did not actually fail, but would have to patch more modules. On the other hand .../opencv-4.1.2/cmake/OpenCVFindLibsPerf.cmake should already have done something that should have had the same effect, but globally for all modules: ``` list(APPEND OPENCV_LINKER_LIBS Eigen3::Eigen) ``` Is this specific to exactly eigen-3.3.7-r1? Or should I say, can I mask that version and go back eigen-3.3.7 to work around this for now? Thanks. Yes, reverting eigen to 3.3.7 makes compilation of opencv-4.1.2-r3 working. https://github.com/devurandom/gentoo-overlay/commit/196633deb29b999b6e07f0cc37af3929340a6ab9 fixes this for media-libs/opencv-4.4.0. (In reply to Dennis Schridde from comment #8) > https://github.com/devurandom/gentoo-overlay/commit/ > 196633deb29b999b6e07f0cc37af3929340a6ab9 fixes this for > media-libs/opencv-4.4.0. Not adopting it without any gentoo developers' endorsement. 3 months later, still getting opencv-4.4.0/modules/core/include/opencv2/core/private.hpp:70:12: fatal error: Eigen/Core: No such file or directory 70 | # include <Eigen/Core> | ^~~~~~~~~~~~ compilation terminated. pathetic... (In reply to Nebojsa Trpkovic from comment #10) > 3 months later, still getting > > opencv-4.4.0/modules/core/include/opencv2/core/private.hpp:70:12: fatal > error: Eigen/Core: No such file or directory > 70 | # include <Eigen/Core> > | ^~~~~~~~~~~~ > compilation terminated. > > pathetic... Please do not make such comments here. We're all trying our best and a huge version bump was just done to opencv. When I get a chance, I'll see if there's a better solution than the include path hack, but we may have to go with it for now. You can use USE=-eigen for now if that's possible. (In reply to Sam James from comment #11) > (In reply to Nebojsa Trpkovic from comment #10) > > 3 months later, still getting > > > > opencv-4.4.0/modules/core/include/opencv2/core/private.hpp:70:12: fatal > > error: Eigen/Core: No such file or directory > > 70 | # include <Eigen/Core> > > | ^~~~~~~~~~~~ > > compilation terminated. > > > > pathetic... > > Please do not make such comments here. We're all trying our best and a huge > version bump was just done to opencv. When I get a chance, I'll see if > there's a better solution than the include path hack, but we may have to go > with it for now. > > You can use USE=-eigen for now if that's possible. Thanks. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=990ef023d106b220f1f52945440509f0af2db0e0 commit 990ef023d106b220f1f52945440509f0af2db0e0 Author: Sam James <sam@gentoo.org> AuthorDate: 2020-10-11 18:35:46 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2020-10-11 19:16:12 +0000 media-libs/opencv: drop pch support (fixes eigen build) PCH support is broken when using CMake and apparently opencv is no exception. Closes: https://bugs.gentoo.org/733796 Package-Manager: Portage-3.0.4, Repoman-3.0.1 Signed-off-by: Sam James <sam@gentoo.org> media-libs/opencv/opencv-4.4.0.ebuild | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) |