Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 577410 - dev-util/nvidia-cuda-toolkit: media-libs/opencv-3.1.0-r2 fails to compile due to >=gcc-4.9 (CUDA)
Summary: dev-util/nvidia-cuda-toolkit: media-libs/opencv-3.1.0-r2 fails to compile due...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-14 18:15 UTC by Sven Müller
Modified: 2016-06-09 18:30 UTC (History)
5 users (show)

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


Attachments
emerge --info (emerge_info.txt,16.53 KB, text/plain)
2016-03-14 18:15 UTC, Sven Müller
Details
build.log (build.log,173.52 KB, text/plain)
2016-03-14 18:17 UTC, Sven Müller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Müller 2016-03-14 18:15:59 UTC
Created attachment 428234 [details]
emerge --info

Generating moc_singlefilterview.cpp
/usr/lib64/qt5/bin/moc -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0_build/modules/cvv -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv_contrib-3.1.0/modules/cvv -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0_build -I/usr/include/eigen3 -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/lib64/qt5/mkspecs/linux-g++ -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtWidgets -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv_contrib-3.1.0/modules/cvv/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv_contrib-3.1.0/modules/cvv/src -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/cudev/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/core/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/flann/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/imgproc/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/ml/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/imgcodecs/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/videoio/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/highgui/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/features2d/include -I/usr/include -I/usr/include -DCVAPI_EXPORTS -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -D__OPENCV_BUILD=1 -o /var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0_build/modules/cvv/moc_singlefilterview.cpp /var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv_contrib-3.1.0/modules/cvv/src/view/singlefilterview.hpp 
Generating moc_translationsmatchview.cpp
/usr/lib64/qt5/bin/moc -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0_build/modules/cvv -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv_contrib-3.1.0/modules/cvv -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0_build -I/usr/include/eigen3 -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/lib64/qt5/mkspecs/linux-g++ -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtWidgets -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv_contrib-3.1.0/modules/cvv/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv_contrib-3.1.0/modules/cvv/src -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/cudev/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/core/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/flann/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/imgproc/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/ml/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/imgcodecs/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/videoio/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/highgui/include -I/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0/modules/features2d/include -I/usr/include -I/usr/include -DCVAPI_EXPORTS -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -D__OPENCV_BUILD=1 -o /var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0_build/modules/cvv/moc_translationsmatchview.cpp /var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv_contrib-3.1.0/modules/cvv/src/view/translationsmatchview.hpp 
make[2]: Leaving directory '/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0_build'
[  0%] Built target opencv_cvv_automoc
make[1]: Leaving directory '/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0_build'
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
 * ERROR: media-libs/opencv-3.1.0-r2::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=media-libs/opencv-3.1.0-r2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-libs/opencv-3.1.0-r2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/media-libs/opencv-3.1.0-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-libs/opencv-3.1.0-r2/temp/environment'.
 * Working directory: '/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0_build'
 * S: '/var/tmp/portage/media-libs/opencv-3.1.0-r2/work/opencv-3.1.0'
!!! When you file a bug report, please include the following information:
GENTOO_VM=  CLASSPATH="" JAVA_HOME="/etc/java-config-2/current-system-vm"
JAVACFLAGS="" COMPILER=""
and of course, the output of emerge --info =opencv-3.1.0

Maybe it's related to gcc-5.3. But I don't have any clue, why it fails. Didn't discover an usable error message.
Comment 1 Sven Müller 2016-03-14 18:17:02 UTC
Created attachment 428236 [details]
build.log
Comment 2 Andreas Sturmlechner gentoo-dev 2016-03-14 18:21:17 UTC
In file included from /opt/cuda/include/cuda_runtime.h:59:0,
                 from <command-line>:0:
/opt/cuda/include/host_config.h:82:2: error: #error -- unsupported GNU version! gcc 4.9 and up are not supported!
 #error -- unsupported GNU version! gcc 4.9 and up are not supported!
  ^


Interesting.
Comment 3 Sven Müller 2016-03-14 19:13:35 UTC
Thanks for this hint. Found in nvidia-cuda-toolkit-6.5.14.ebuild:

src_prepare() {
        local cuda_supported_gcc

        cuda_supported_gcc="4.7 4.8"

        sed \
                -e "s:CUDA_SUPPORTED_GCC:${cuda_supported_gcc}:g" \
                "${FILESDIR}"/cuda-config.in > "${T}"/cuda-config || die
}

If use a Nvidia Quadro FX3800 graphics card. It's supported by the nvidia legacy driver 340.xx. That's also the constraint for the nvidia-cuda-toolkit version (limited to 6.5.x).

I just tried it without cuda support. Opencv compiles fine. 

How do we want to treat this problem now? The best thing would be, if nvidia supports >=gcc-4.9 for compiling the nvidia-cuda-toolkit. But I guess, they won't backport any patches to the legacy versions.
Comment 4 Silvio 2016-03-21 21:25:34 UTC
I confirm, as for r1 versions it is necessary to put:


=media-libs/opencv-3.1.0-r1 -cuda
=media-libs/opencv-3.1.0-r2 -cuda

in 

/etc/portage/package.use

and than it compiles..
Comment 5 David Seifert gentoo-dev 2016-03-25 17:10:18 UTC
I suggest adding a pkg_pretend() check for this and failing on GCC 5 and above. Is this ok with all parties?
Comment 6 Sven Müller 2016-05-07 18:38:32 UTC
Daniel:
The check should be aware of the older CUDA versions. I would conjecture, >=nvidia-cuda-toolkit-7 may compile with gcc-5 and therefore, opencv should compile with >= gcc-4.9 too.
Comment 7 Amy Liffey gentoo-dev 2016-06-09 18:30:14 UTC
Fixed in opencv-2.4.12-r1 and opencv-3.1.0-r4.