View previous topic :: View next topic |
Author |
Message |
mreff555 Apprentice
Joined: 10 Mar 2011 Posts: 231 Location: Philadelphia
|
Posted: Sun Jun 29, 2014 12:50 pm Post subject: Installing redundant compilers |
|
|
I'm ripping my hair out trying to teach myself cuda. Ironically I gave up on TBB and atomic because I thought cuda would be more simple. nope.
Anyway, after finally "almost" making progress I discovered that my problem is that nvcc doesn't support gcc 4.7. Is there a way I can install 4.6 in addition to 4.7 and somehow intelligently switch between them? |
|
Back to top |
|
|
mreff555 Apprentice
Joined: 10 Mar 2011 Posts: 231 Location: Philadelphia
|
Posted: Sun Jun 29, 2014 12:59 pm Post subject: |
|
|
Solved my own problem. Sort of
gcc-4.6.3 was still installed. Honestly I don't know why, but I just symboliclly linked it to a file called gcc in the cuda bin directory. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22657
|
Posted: Sun Jun 29, 2014 3:38 pm Post subject: |
|
|
You can install major versions of gcc side-by-side via the SLOT mechanism. You should probably not create symlinks named gcc in searched paths, but instead either set your system compiler to the desired version of gcc or, preferably, configure nvcc to invoke a qualified gcc name. You probably want it to run gcc-4.6.4 instead of gcc. |
|
Back to top |
|
|
defer- Tux's lil' helper
Joined: 11 Jun 2007 Posts: 140 Location: Finland
|
Posted: Sun Jun 29, 2014 4:02 pm Post subject: |
|
|
You can use gcc-config -l to list available versions and gcc-config <number> to set active compiler system wide.
You can use different compiler temporarily by setting $CC variable.
CC=gcc-4.6.4 ./configure
CC=gcc-4.6.4 make _________________ https://github.com/defer- |
|
Back to top |
|
|
The Doctor Moderator
Joined: 27 Jul 2010 Posts: 2678
|
Posted: Sun Jun 29, 2014 7:45 pm Post subject: |
|
|
This sound like the perfect use of package.env to me. Create a file /etc/portage/env/gcc2 with the contents Code: | CC=gcc-4.6.4
CXX=g++-4.6.4 |
Then enter any packages you want to build with the older gcc version in a file /etc/portage/package.env like so Code: | dev-python/pycuda gcc2
dev-util/nvidia-cuda-sdk gcc2
dev-util/nvidia-cuda-toolkit gcc2 |
This will override the default CC and CXX flags in make.conf and will be persistent. _________________ First things first, but not necessarily in that order.
Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box. |
|
Back to top |
|
|
|