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 ?
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 … :
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 … ».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
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
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!
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.
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
Or, if you accidentally over-write LEAP 15's default gcc, just "force re-instal" the package, egCode:rpm -ql package_name
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).Code:zypper in -f 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!
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.
Bookmarks