Find the answer to your Linux question:
Results 1 to 10 of 10
Hey all! I have need of updating my gcc for testing purposes, but I want to keep my stable one (3.3.6) available as well. Looking at an old, unrelated guide ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252

    Multiple GCC Installations


    Hey all!

    I have need of updating my gcc for testing purposes, but I want to keep my stable one (3.3.6) available as well.

    Looking at an old, unrelated guide at the Gentoo site:

    http://www.gentoo.org/doc/en/new-upg...gentoo-1.4.xml

    I see that there is a way to install multiple gcc's and switch between them with the gcc-config tool:

    This will also have the beneficial side-effect of installing the gcc-config package on your system, which can be used to switch back and forth between various installed versions of GCC.
    Now then...as a test, I attempted to install gcc-3.3.5. When run with "-pv", I see that it will downgrade my current compiler, not install an unrelated one.


    My question is: how do I install a newer, ~x86 version of gcc while still keeping my current stable one around?

  2. #2
    Just Joined!
    Join Date
    Dec 2005
    Posts
    6
    There's an obvious answer, a rediculous answer, and a not-so-smart answer. The obvious answer is: just use the stable version...what do you need an unstable GCC for anyway? The rediculous answer: Use two installations of Gentoo. The not-so-smart answer? Well, that would be just use the unstable version, but again said...thats not too smart.

  3. #3
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    Um, first off, gcc versions > 3.3.6 now allow you to have multiple installations, managed by gcc-config (similar to java-config).

    And to answer the question, I needed it so I can test out capabilities in gcj that were not around in the stable version I was using. This particularly applies to regular expressions, which were not supported until gcj 3.4. I did end up using multiple installations, but it would have been nice to not need that.

  4. #4
    Linux Guru kkubasik's Avatar
    Join Date
    Mar 2004
    Location
    Lat: 39:03:51N Lon: 77:14:37W
    Posts
    2,396
    I've heard of people making gentoo 'sandboxes' where you basically follow enough of the install to create a section of your filesystem that you can chroot yourself into and play around without risking system-wide disaster.

    Granted, if you want to do some really heavy system hacking this isn't a great solution, but if you just wanna play with a bleeding edge toolchain, its as close to perfect as your prob gonna get...

    minus the extra day or 2 to set it up....
    Avoid the Gates of Hell. Use Linux
    A Penny for your Thoughts

    Formerly Known as qub333

  5. #5
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    Yeah...that's basically what I did (I installed through my existing Gentoo installation), but I was testing out a Java GUI, so I had to install X anyway .

    But X + Fluxbox isn't too bad.

  6. #6
    Just Joined!
    Join Date
    Jul 2006
    Posts
    2

    Installing multiple versions of gcc and using one which is required

    The listed below are the basic steps and you would be done.. to read more articles you can visit http://www.tarunworld.com/linux/keep...ng-them-2.html

    1. Copy the bz2 file to a director say /usr/src.
    2. Make a dir say named gcc 3.5 in /usr/src.
    3. Untar the contents of the zip file in this directory.
    4. go to the directory gcc 3.5 as cd gcc3.5
    5. on shell give the command as /usr/src/gcc3.5/configure --prefix=/opt/gcc
    6. on shell run make bootstrap.
    7. on shell run make install(do it as root).
    8. The gcc would be compiled 3 times and you might have to wait a while.
    9. After the process is completed on shell run export PATH=/opt/gcc/bin:$PATH.
    10. This command appends the gcc path to the environment path variable.
    11. Now check gcc --v and you would get version as 3.5.

    Regards

  7. #7
    Linux Enthusiast gruven's Avatar
    Join Date
    Dec 2004
    Location
    Arkansas
    Posts
    541
    Quote Originally Posted by sms_james
    The listed below are the basic steps and you would be done.. to read the complete article you can visit http://www.tarunworld.com/index.php?...d=26&Itemid=37

    1. Copy the bz2 file to a director say /usr/src.
    2. Make a dir say named gcc 3.5 in /usr/src.
    3. Untar the contents of the zip file in this directory.
    4. go to the directory gcc 3.5 as cd gcc3.5
    5. on shell give the command as /usr/src/gcc3.5/configure --prefix=/opt/gcc
    6. on shell run make bootstrap.
    7. on shell run make install(do it as root).
    8. The gcc would be compiled 3 times and you might have to wait a while.
    9. After the process is completed on shell run export PATH=/opt/gcc/bin:$PATH.
    10. This command appends the gcc path to the environment path variable.
    11. Now check gcc --v and you would get version as 3.5.

    Regards
    Holy thread resurrection batman!

    Anyway, I can simplify that process. If you have GCC 3.3.5 or greater (which you do because 3.4 is stable now) all you have to do is unmask whatever gcc you want and type
    Code:
    emerge -av gcc
    Done. It will slot it, and you can select the compiler by using eselect.

    Linux User #376741
    Code is Poetry

  8. #8
    Just Joined!
    Join Date
    Jul 2006
    Posts
    2
    Quote Originally Posted by gruven
    Holy thread resurrection batman!

    Anyway, I can simplify that process. If you have GCC 3.3.5 or greater (which you do because 3.4 is stable now) all you have to do is unmask whatever gcc you want and type
    Code:
    emerge -av gcc
    Done. It will slot it, and you can select the compiler by using eselect.
    Hey sorry buddy i corrected it.. i meant to say to read more atricles... chao.. well i try urs method.. never knew it.. thx

  9. #9
    AMM
    AMM is offline
    Just Joined!
    Join Date
    Sep 2006
    Posts
    3
    i have latest gcc-4.1.1 following gentoo 2006.1 minimal install.

    since I must use gcc-3.4.3, I installed it manulally in sperate directory and it works fine for me as long as i re-edit my Makefile to use this verion


    regards

    /AMM

  10. #10
    Linux Enthusiast gruven's Avatar
    Join Date
    Dec 2004
    Location
    Arkansas
    Posts
    541
    Quote Originally Posted by AMM
    i have latest gcc-4.1.1 following gentoo 2006.1 minimal install.

    since I must use gcc-3.4.3, I installed it manulally in sperate directory and it works fine for me as long as i re-edit my Makefile to use this verion


    regards

    /AMM
    GCC is slotted on gentoo, meaning that you can have more than one version installed through portage and switch between the two (or more) freely and easily with eselect. You should just use portage to handle your GCC installations. Much easier IMO.

    Linux User #376741
    Code is Poetry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •