Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Installing redundant compilers
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
mreff555
Apprentice
Apprentice


Joined: 10 Mar 2011
Posts: 231
Location: Philadelphia

PostPosted: Sun Jun 29, 2014 12:50 pm    Post subject: Installing redundant compilers Reply with quote

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
View user's profile Send private message
mreff555
Apprentice
Apprentice


Joined: 10 Mar 2011
Posts: 231
Location: Philadelphia

PostPosted: Sun Jun 29, 2014 12:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22657

PostPosted: Sun Jun 29, 2014 3:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
defer-
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jun 2007
Posts: 140
Location: Finland

PostPosted: Sun Jun 29, 2014 4:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Sun Jun 29, 2014 7:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum