Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 913740 - media-libs/opencv-4.8.0-r1 - cuda support should build with relevant gcc
Summary: media-libs/opencv-4.8.0-r1 - cuda support should build with relevant gcc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Paul Zander
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-07 05:56 UTC by Kfir Ozer
Modified: 2024-01-10 12:33 UTC (History)
3 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 Kfir Ozer 2023-09-07 05:56:12 UTC
if dev-util/nvidia-cuda-toolkit version 1.8.* installed, it should use gcc 11, if version 12.* it should use gcc 12. i remember that i saw some packages that already do that.

i have version 11.8.4 installed so i switched to gcc 11 in order to compile opencv with cuda support.

Reproducible: Always
Comment 1 Sven Eden 2023-10-12 17:49:06 UTC
Meanwhile I use the following "workaround":

* Use the "ebuild" command to "prepare" opencv
* Edit temp/environment in the portage build directory and append
  -DCUDA_HOST_COMPILER=/usr/x86_64-pc-linux-gnu/gcc-bin/12/gcc
  to GLOBALCMAKEARGS
* Use the "ebuild" command to "merge" opencv
Comment 2 Pacho Ramos gentoo-dev 2023-11-28 09:56:40 UTC
I couldn't find any package doing it by itself :/

The best I could find is Arch workaround: they RDEPEND on gcc-12 and add some symlinks in the cuda bindir. With it, cuda will use the right gcc without getting the failure and admin manually downgrading the gcc (and remembering to get it back after)
https://gitlab.archlinux.org/archlinux/packaging/packages/cuda/-/blob/main/PKGBUILD?ref_type=heads#L103
Comment 3 Paul Zander 2023-11-28 10:02:23 UTC
The fix will be in the next batch of -4.8.1 changes which should come in the next few days.
Comment 4 Sven Eden 2023-12-21 12:46:08 UTC
(In reply to Paul Zander from comment #3)
> The fix will be in the next batch of -4.8.1 changes which should come in the
> next few days.

I had to use my "workaround" from comment 1 for the latest opencv-4.8.1, I synced portage today, because I still got the "Unsupported Compiler" error.
Comment 5 Larry the Git Cow gentoo-dev 2024-01-10 12:33:57 UTC
The bug has been closed via the following commit(s):

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

commit 0e9205edb9922309ecd568b7085fd59726c7d2ca
Author:     Paul Zander <negril.nx+gentoo@gmail.com>
AuthorDate: 2023-12-08 14:58:23 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-01-10 12:32:37 +0000

    media-libs/opencv: add 4.8.1-r1
    
    Closes: https://bugs.gentoo.org/702258
    Closes: https://bugs.gentoo.org/830294
    Closes: https://bugs.gentoo.org/883375
    Closes: https://bugs.gentoo.org/913740
    Closes: https://bugs.gentoo.org/914922
    Closes: https://bugs.gentoo.org/917121
    Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/opencv/Manifest                         |   7 +
 .../files/opencv-4.8.1-ade-0.1.2a.tar.gz.patch     |  18 +
 .../opencv-4.8.1-drop-python2-detection.patch      |  23 +
 ...ncv-4.8.1-eliminate-lto-compiler-warnings.patch |  36 ++
 .../opencv/files/opencv-4.8.1-libpng16.patch       |  58 ++
 .../opencv/files/opencv-4.8.1-opencv_test.patch    |  18 +
 .../files/opencv-4.8.1-python3_12-support.patch    |  25 +
 .../opencv-4.8.1-use-system-flatbuffers.patch      |  36 ++
 .../files/opencv-4.8.1-use-system-opencl.patch     |  25 +
 ...rib-4.8.1-NVIDIAOpticalFlowSDK-2.0.tar.gz.patch |  20 +
 .../opencv/files/opencv_contrib-4.8.1-rgbd.patch   |  15 +
 media-libs/opencv/metadata.xml                     |  34 +-
 media-libs/opencv/opencv-4.8.1-r1.ebuild           | 644 +++++++++++++++++++++
 13 files changed, 945 insertions(+), 14 deletions(-)