Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Support for older gcc versions

  1. #1

    Default Support for older gcc versions

    I upgraded from 42.3 to 15. I appreciate that 15 supports the later version of gcc 7.3, but in 42.3 prior versions of gcc were supported such as 4.8, 5.3., and 6.2. Is it possible to install any of these prior versions of gcc on 15 ?

  2. #2
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    1,735

    Default Re: Support for older gcc versions

    Quote Originally Posted by eldiener View Post
    I upgraded from 42.3 to 15. I appreciate that 15 supports the later version of gcc 7.3, but in 42.3 prior versions of gcc were supported such as 4.8, 5.3., and 6.2. Is it possible to install any of these prior versions of gcc on 15 ?
    Possibly, unfortunately, you may have to build the earlier GCC versions from source: <http://mirrors.kernel.org/gnu/gcc/>.
    There is a "recipe" on Stackoverflow which may, or may not, be OK -- you may experience conflicts with Leap 15.0's GCC 7 … :
    Code:
    wget ftp://mirrors.kernel.org/gnu/gcc/gcc-4.9.0/gcc-4.9.0.tar.gz
    cd gcc-4.9.0
    ./contrib/download_prerequisites
    cd .. 
    cd gcc-build-4.9.0
    ../gcc-4.9.0/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
    make -j4  (wait for 40 min)
    make install
    Yes, yes, I know, previous compiler versions are sometimes needed to maintain existing applications but, IMHO, it is better to try and keep a system with the appropriate compiler version installed up and running for as long as the concerned application needs to maintained … « If you see what I mean … ».

  3. #3
    Join Date
    Sep 2008
    Posts
    2,881

    Default Re: Support for older gcc versions

    currently only gcc7.3 and gcc8.1 are available for LEAP 15.0
    http://download.opensuse.org/reposit...USE_Leap_15.0/
    while 3.3 4.8 7.3 and 8.1 are available for 42.3
    http://download.opensuse.org/reposit...USE_Leap_42.3/
    you could open a bug report and ask for those older compilers be made available for 15.0
    https://bugzilla.opensuse.org/
    or build them manually
    you can switch between gcc compilers using update-alternatives

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    9,236
    Blog Entries
    1

    Default Re: Support for older gcc versions

    You can get your ancient files including gcc from archived packages for old openSUSE versions

    https://ftp5.gwdg.de/pub/opensuse/di.../distribution/

    Installing an ancient gcc package should be fairly safe, even from another distribution or openSUSE version... gcc binaries are generally standalone without any dependencies.

    After you've installed your gcc,
    You can then set up an update-alternatives to switch your system between gcc.
    Again, this should generally be safe because a compiler is used only when compiling.... and that should happen only on rare occasions. Source generally needs to be compiled only once and not again.
    But still, I'd recommend that once you've compiled with a non-default gcc, when done you should switch back.

    For some software, you don't have access to the source spec file or in practically all cases it's just more convenient to switch the entire system instead of editing lines in a spec file.

    My Wiki page describing how to create an update-alternatives for gcc

    https://en.opensuse.org/User:Tsu2/gc...e-alternatives

    If you're really paranoid, you can run the gcc binary in a virtual machine or container.

    HTH,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  5. #5

    Default Re: Support for older gcc versions

    Quote Originally Posted by I_A View Post
    currently only gcc7.3 and gcc8.1 are available for LEAP 15.0
    http://download.opensuse.org/reposit...USE_Leap_15.0/
    while 3.3 4.8 7.3 and 8.1 are available for 42.3
    http://download.opensuse.org/reposit...USE_Leap_42.3/
    you could open a bug report and ask for those older compilers be made available for 15.0
    https://bugzilla.opensuse.org/
    or build them manually
    you can switch between gcc compilers using update-alternatives
    I think you mean '5.3', not '3.3', above. I understand I can build them manually. In the previous 42.3 there was no need for update-alternatives if I just used g++-4, g++-5 etc. when I needed to use the non-default version of gcc. I am a bit surprised that Leap 15.0 dropped these earlier versions, but it is OK and I can live without them. The only reason I like a number of earlier compiler versions of gcc ( and clang ) is because I need to test software on different versions of compilers.

  6. #6
    Join Date
    Sep 2008
    Posts
    2,881

    Default Re: Support for older gcc versions

    Quote Originally Posted by eldiener View Post
    I think you mean '5.3', not '3.3', above. I understand I can build them manually. In the previous 42.3 there was no need for update-alternatives if I just used g++-4, g++-5 etc. when I needed to use the non-default version of gcc. I am a bit surprised that Leap 15.0 dropped these earlier versions, but it is OK and I can live without them. The only reason I like a number of earlier compiler versions of gcc ( and clang ) is because I need to test software on different versions of compilers.
    with a filename gcc33-3.3.3-34.1.x86_64.rpm I'm guessing that's gcc 3 3.3.3 not 5.3 but I could be wrong

  7. #7

    Default Re: Support for older gcc versions

    Quote Originally Posted by tsu2 View Post
    You can get your ancient files including gcc from archived packages for old openSUSE versions

    https://ftp5.gwdg.de/pub/opensuse/di.../distribution/

    Installing an ancient gcc package should be fairly safe, even from another distribution or openSUSE version... gcc binaries are generally standalone without any dependencies.

    After you've installed your gcc,
    You can then set up an update-alternatives to switch your system between gcc.
    Again, this should generally be safe because a compiler is used only when compiling.... and that should happen only on rare occasions. Source generally needs to be compiled only once and not again.
    But still, I'd recommend that once you've compiled with a non-default gcc, when done you should switch back.

    For some software, you don't have access to the source spec file or in practically all cases it's just more convenient to switch the entire system instead of editing lines in a spec file.

    My Wiki page describing how to create an update-alternatives for gcc

    https://en.opensuse.org/User:Tsu2/gc...e-alternatives

    If you're really paranoid, you can run the gcc binary in a virtual machine or container.

    HTH,
    TSU
    Are you saying I can download an rpm file for some gcc version from a previous release of OpenSuse and install it in 15.0 using zypper or Yast ? I don't update-alternatives myself as long as the compiler is g++-n, which it always has been when multiple versions are installed.

  8. #8

    Default Re: Support for older gcc versions

    Quote Originally Posted by dcurtisfra View Post
    Possibly, unfortunately, you may have to build the earlier GCC versions from source: <http://mirrors.kernel.org/gnu/gcc/>.
    There is a "recipe" on Stackoverflow which may, or may not, be OK -- you may experience conflicts with Leap 15.0's GCC 7 … :
    Code:
    wget ftp://mirrors.kernel.org/gnu/gcc/gcc-4.9.0/gcc-4.9.0.tar.gz
    cd gcc-4.9.0
    ./contrib/download_prerequisites
    cd .. 
    cd gcc-build-4.9.0
    ../gcc-4.9.0/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
    make -j4  (wait for 40 min)
    make install
    Yes, yes, I know, previous compiler versions are sometimes needed to maintain existing applications but, IMHO, it is better to try and keep a system with the appropriate compiler version installed up and running for as long as the concerned application needs to maintained … « If you see what I mean … ».
    OK, thanks ! I realize I can build from source but I hate to go that route myself because of all the options I need to configure in some way. When OS offers a version I do not have to think about the options.

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    9,236
    Blog Entries
    1

    Default Re: Support for older gcc versions

    Quote Originally Posted by eldiener View Post
    Are you saying I can download an rpm file for some gcc version from a previous release of OpenSuse and install it in 15.0 using zypper or Yast ? I don't update-alternatives myself as long as the compiler is g++-n, which it always has been when multiple versions are installed.
    Yes.
    But after thinking about this more, you should install a package that's not <just> gcc, as you already know you want a gcc binary that specifies the version.

    So,
    You may want to inspect the contents of the RPM to verify that a gcc without version is not installed, else you should extract the files to an alternate site and then rename the gcc binary so that it doesn't over-write existing files. The following command lists the contents of the RPM
    Code:
    rpm -ql package_name
    Or, if you accidentally over-write LEAP 15's default gcc, just "force re-instal" the package, eg
    Code:
    zypper in -f gcc
    As for whether you need to install a gcc update-alternatives or not, it depends on what you're doing. If you're able to specify your choice of gcc by command line or spec file, then good for you. But sometimes a bigger application will run an install without giving the User a way to specify the gcc, and in that situation you have no choice but to do something like update-alternatives (an alternative is to rname gcc files so that the install can find the correct gcc).

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  10. #10

    Default Re: Support for older gcc versions

    Quote Originally Posted by tsu2 View Post
    Yes.
    But after thinking about this more, you should install a package that's not <just> gcc, as you already know you want a gcc binary that specifies the version.

    So,
    You may want to inspect the contents of the RPM to verify that a gcc without version is not installed, else you should extract the files to an alternate site and then rename the gcc binary so that it doesn't over-write existing files. The following command lists the contents of the RPM
    Code:
    rpm -ql package_name
    Or, if you accidentally over-write LEAP 15's default gcc, just "force re-instal" the package, eg
    Code:
    zypper in -f gcc
    As for whether you need to install a gcc update-alternatives or not, it depends on what you're doing. If you're able to specify your choice of gcc by command line or spec file, then good for you. But sometimes a bigger application will run an install without giving the User a way to specify the gcc, and in that situation you have no choice but to do something like update-alternatives (an alternative is to rname gcc files so that the install can find the correct gcc).

    TSU
    I found the latest packages for gcc4, gcc5, and gcc6 for Leap 42.3 on the website https://pkgs.org/. None of these packages, according to 'rpm -ql' , overwrite the main gcc package. I will try to install each one, for gcc c and gcc c++ into Leap 15.0. That https://pkgs.org is a wonderful website.

Page 1 of 3 123 LastLast

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
  •