Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 398683 - Workaround for dev-util/nvidia-cuda-toolkit and gcc 4.4
Summary: Workaround for dev-util/nvidia-cuda-toolkit and gcc 4.4
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: Normal minor (vote)
Assignee: Justin Lecher (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-12 17:19 UTC by Nicolas Bigaouette
Modified: 2013-01-14 07:39 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 Nicolas Bigaouette 2012-01-12 17:19:46 UTC
dev-util/nvidia-cuda-toolkit cannot be used with gcc 4.5 and up. As such, one has to keep a version of gcc 4.4 or lower installed. If >=4.5 is selected with gcc-config, then the cuda compiler "nvcc" cannot compile anything: "error -- unsupported GNU version! gcc 4.5 and up are not supported!"

A workaround is to use the --compiler-bindir option to nvcc:
$ nvcc --compiler-bindir /usr/x86_64-pc-linux-gnu/gcc-bin/4.4.5 ...
but this puts the burden to every user of the machine. I'm looking for a solution/workaround system-wide.

According to http://stackoverflow.com/questions/6622454/cuda-incompatible-with-my-gcc-version creating symbolic links in cuda folder pointing to the right gcc will make it work. I tested it here and it works:
# for f in /usr/x86_64-pc-linux-gnu/gcc-bin/4.4*/*; do ln -s $f /opt/cuda/bin/`basename $f`; done
This allows keeping 4.5 (or others) as the active gcc version while using 4.4* for cuda only.

Could dev-util/nvidia-cuda-toolkit's ebuild include such a workaround? That might make it easier...

Thanks.

Reproducible: Always
Comment 1 Nicolas Bigaouette 2012-02-01 00:10:25 UTC
With cuda 4.1, this is no longer necessary. And actually, using this breaks nvcc, the cuda compiler.
Comment 2 Justin Lecher (RETIRED) gentoo-dev 2013-01-14 07:39:30 UTC
This is handled now with the new cuda.eclass as far as we can. We shouldn't workaround nvidias gcc version restrictions.