Results 1 to 6 of 6

Thread: on gcc installation

  1. #1

    Default on gcc installation

    activated the repo /repositories/devel:/gcc/openSUSE_Factory
    and now zypper has installed gcc-4.5 and gcc-4.6 .
    running gcc-v shows the gcc-4.5 version is used at compilation.
    how to switch between gcc-4.5 and gcc-4.6 in this situation?
    tried to un-install the gcc-4.5 but then zypper removed parts
    of the xorg server for some reason, so gcc-4.5 must be installed.
    want to have multiple (custom) gcc versions and switch between them
    but keep the gcc-4.5 from OpenSuSE and its automatic updates.
    Is there a howto to do that on OpenSuSE Linux without breaking
    the zypper updates and the system installation ?
    Is it just a own gcc compilation with custom configure args and prefixes?
    Thanks.

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    25,196
    Blog Entries
    15

    Default Re: on gcc installation

    Quote Originally Posted by twlevo
    activated the repo /repositories/devel:/gcc/openSUSE_Factory
    and now zypper has installed gcc-4.5 and gcc-4.6 .
    running gcc-v shows the gcc-4.5 version is used at compilation.
    how to switch between gcc-4.5 and gcc-4.6 in this situation?
    tried to un-install the gcc-4.5 but then zypper removed parts
    of the xorg server for some reason, so gcc-4.5 must be installed.
    want to have multiple (custom) gcc versions and switch between them
    but keep the gcc-4.5 from OpenSuSE and its automatic updates.
    Is there a howto to do that on OpenSuSE Linux without breaking
    the zypper updates and the system installation ?
    Is it just a own gcc compilation with custom configure args and
    prefixes?
    Thanks.

    Hi
    Use the full path to gcc and export flags etc;
    Code:
    export CC=/usr/bin/gcc-4.6
    export CXX=/usr/bin/g++-4.6
    /usr/bin/gcc-4.6 -o something something.c
    --
    Cheers Malcolm (Linux Counter #276890)
    openSUSE 11.3 (x86_64) Kernel 2.6.34.4-0.1-default
    up 9:01, 2 users, load average: 0.27, 0.13, 0.08
    GPU GeForce 8600 GTS Silent - Driver Version: 256.53


  3. #3
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: on gcc installation

    If you want to change the default gcc system wide it should be possible with

    Code:
    update-alternatives --config gcc
    Otherwise follow the advise from malcolmlewis if you want to use it
    different per compilation.

    --
    openSUSE 11.2 64 bit | Intel Core2 Quad Q8300@2.50GHz | Gnome 2.28 | GeForce
    9600 GT | 4GB Ram
    openSUSE 11.3 64 bit | Intel Core2 Duo T9300@2.50GHz | Gnome 2.30 | Quadro
    FX 3600M | 4GB Ram


  4. #4

    Default Re: on gcc installation

    Tested it and it works as expected. Do not want to change gcc system wide
    to avoid conflicts with zypper updates and other troubles, only per compilation.
    Noticed the gcc46.spec file in gcc46-xxx.src.rpm can be used as example how
    to install own gcc versions without getting conflicts with zypper and suse install
    and it has no gcc-plugin support enabled, which is a new feature of gcc-4.5+.
    Also could be nice if Bison-2.4.3 is in gcc repo because of the new features.
    Thanks for the extra work done to have these new gcc features available now.

  5. #5
    Join Date
    Nov 2011
    Location
    Philadelphia,PA
    Posts
    6

    Default Re: on gcc installation

    Hello,

    @martin_helm

    update-alternatives doesn't seem to be doing it for me

    Code:
    update-alternatives --config gcc
    No alternatives for gcc.
    I've installed GCC 4.6 and I want GCC 4.6 to be the default system wide ? Do I set the symlink manually myself?

  6. #6
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: on gcc installation

    You need to define an entry for gcc to be able to use
    update-alternatives, this is off top of my head, so double check it by
    reading the man page before you use it
    Code:
    update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.5 1  \
    --slave /usr/bin/g++ g++ /usr/bin/g++-4.5
    update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 2  \
    --slave /usr/bin/g++ g++ /usr/bin/g++-4.6

    --
    PC: oS 11.4 (dual boot 12.1) 64 bit | Intel Core i7-2600@3.40GHz | KDE
    4.6.0 | GeForce GT 420 | 16GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.7.3 |
    nVidia ION | 3GB Ram

Tags for this Thread

Posting Permissions

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