messed up with gcc! [Solved]

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

Post Reply
fjkhf
Simple Hen
Posts: 97
Joined: Tue Jun 26, 2012 13:41

messed up with gcc! [Solved]

Post by fjkhf » Sat Dec 14, 2013 9:40

Hello,

I messed up gcc and now it is full of errors when compiling.

I removed

Code: Select all

sys-devel/base-gcc-4.6.4  sys-devel/gcc-4.6.4 sys-devel/gcc-4.7.3
(I couldn't remove gcc-4.7.3)

and I reinstalled.
I also chose gcc-4.6.4 (with gcc-config) ,and I did

Code: Select all

env-update && source /etc/profile


Also ,I did

Code: Select all

rm /usr/bin/g++
rm /usr/bin/gcc

ln -s /usr/bin/g++-4.6.4 /usr/bin/g++
ln -s /usr/bin/gcc-4.6.4 /usr/bin/gcc


but still the same problem.

My gcc doesn't work.

Any solotuions?

Thank you !

----------------UPDATE----------------------------------

I noticed something!

When I do which gcc as user returns

Code: Select all

 /opt/cuda/bin/gcc

ans as root returns

Code: Select all

/usr/bin/gcc
(also,trying as root to compile doesn't work either)

My bashrc has:

Code: Select all

export PATH=~/bin:$PATH
export PATH=/opt/cuda/bin:$PATH
export PATH=~/opt/bin:$PATH
export LD_LIBRARY_PATH=/opt/cuda/lib64:$LD_LIBRARY_PATH
export CUDA_ROOT=/opt/cuda/bin


What should I do?
Last edited by fjkhf on Thu Dec 19, 2013 13:58, edited 1 time in total.

Stupot
Sagely Hen
Posts: 1629
Joined: Wed Feb 14, 2007 3:44
Location: St. Louis, MO, USA

Re: messed up with gcc!

Post by Stupot » Sat Dec 14, 2013 17:51

Wait, so you removed

Code: Select all

sys-devel/base-gcc-4.6.4  sys-devel/gcc-4.6.4 s


And then reinstalled them?

Reinstalled them how? Portage or Entropy?

You shouldn't have to remove and set symlinks manually like you did. I'd imagine there's some set of eselect commands and others you should/could use instead. Such as "eselect env update" and stuff.


But I guess the real question I have is, what is it that you are actually attempting to accomlpish by this? Are you looking to use portage only and compile with gcc-4.6.4? If so, why? Let us know what your end goal is and perhaps we can find a better solution than changing your system's gcc (which is typically not a great idea, especially for portage based systems).

User avatar
sabayonino
Sagely Hen
Posts: 3155
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: messed up with gcc!

Post by sabayonino » Sun Dec 15, 2013 10:19

fjkhf wrote:My gcc doesn't work.

any errors/logs to report ?
[Che Cos'è Il Calcolo Distribuito (BOINC)

BOINC ready ! Sabayon+BOINC = BILD ,my Sabayon spin :cyclops: - Ready to crunch for the Science everywhere :)

fjkhf
Simple Hen
Posts: 97
Joined: Tue Jun 26, 2012 13:41

Re: messed up with gcc!

Post by fjkhf » Sun Dec 15, 2013 18:49

Hello ,

I use entropy.I just removed and reinstalled in order to see if it works but it doesn't.

I used the symlinks because I thought this is the right thing to do.

I just want the compiler to work!

I don't have any erros to report ,just the compiler that doesn't understand the commands.

Thanks

fjkhf
Simple Hen
Posts: 97
Joined: Tue Jun 26, 2012 13:41

Re: messed up with gcc!

Post by fjkhf » Sun Dec 15, 2013 20:02

Also, notice that

When I do which gcc as user returns


Code: Select all

    /opt/cuda/bin/gcc



and as root returns


Code: Select all

  /usr/bin/gcc

Stupot
Sagely Hen
Posts: 1629
Joined: Wed Feb 14, 2007 3:44
Location: St. Louis, MO, USA

Re: messed up with gcc!

Post by Stupot » Tue Dec 17, 2013 5:57

Did you try reinstalling gcc (4.7.3)?

Just give

Code: Select all

#equo install gcc


a try if you haven't yet. That should redo the necessary sym linking necessary for it to work.

fjkhf
Simple Hen
Posts: 97
Joined: Tue Jun 26, 2012 13:41

Re: messed up with gcc!

Post by fjkhf » Tue Dec 17, 2013 21:59

Yes, I have gcc 4.7.3.

I can't understand why as user it gives me /opt/cuda/bin/gcc.

Isn't a way to change that?(if this is the problem,I don't know)

Stupot
Sagely Hen
Posts: 1629
Joined: Wed Feb 14, 2007 3:44
Location: St. Louis, MO, USA

Re: messed up with gcc!

Post by Stupot » Wed Dec 18, 2013 21:12

I know you have gcc 4.7.3. I'm asking you to reinstall it and see if that fixes anything for you.

fjkhf
Simple Hen
Posts: 97
Joined: Tue Jun 26, 2012 13:41

Re: messed up with gcc!

Post by fjkhf » Thu Dec 19, 2013 13:58

Finally , I again removed gcc and g++ , I reinstalled ,made the symlinks and now it works.

Post Reply