It is possible but you have to manage everything about it. The kernel and other program rely on a given version of gcc libraries and if you change it it can cause you major problems so…
Maybe if you need different versions for development you can do things in a VM with a kernel and other program that like the version in question. IMO it is very complicated and I’d need a really good reason to even try it.
Well that’s a bummer… guess I’ll have to stick with Ubuntu or try a different flavour of Linux after all. And I just spent 5 days setting SUSE with everything I need…
Unfortunately, VM is gonna be complicated as I’m using CUDA, and I got some pre-complied CUDA libraries that will only compile with gcc46. I could just copy the binaries for gcc46 and g++46 and whatever libraries I need (then link everything manually), but I do this kind of stuff very often and this will be a real drag having to move binaries of compilers around (assuming they will even work in SUSE).
Also is openmp support in gcc missing? Can’t seem to locate libgomp or find a way to install it.
> Hi, first time poster here… hope this is the right place!
> Is it possible to install multiple versions of gcc (say 4.6, 4.8 and
> 4.9) at the same time? Using zypper, it seems to want to replace one
> with the other (and I can’t even find 4.6…).
Well, yes, 4.8 and 4.9 have separate packages, so yes, those can be
installed side-by-side, as far as I can tell.
For 4.6 you would probably need to use some other repo or roll your own,
but that wouldn’t be difficult to do with OBS.
But the system has to run on one and the others are there just for compiling and maybe running the compile programs. It is unlike java (which you can have multiple versions) in that the C libraries are absolutely needed for the system to run. Running VM’s with properly configure system for each version is the lest likely to cause any problem or be too complicated to manage.
So the OP never said why they wanted to do this and maybe some other work around may be possible if we understood the problem they are trying to solve with multiple C++ versions.
I would indeed want the other versions only for compiling my own codes and not for OS related stuff.
My issue was that when trying to install different version via zypper I was only given an option to uninstall 48 or break 49 (so not a full install? I’m not sure how this part works…). I guess I’ll take the plunge and install it ‘broken’ to see what does and doesn’t work.
On 2015-05-01 23:46, qiUip wrote:
> My issue was that when trying to install different version via zypper I
> was only given an option to uninstall 48 or break 49 (so not a full
> install? I’m not sure how this part works…). I guess I’ll take the
> plunge and install it ‘broken’ to see what does and doesn’t work.
No, that will not work, IIRC. I think you have to install it on another
path, which is not possible to do with a prepared rpm. I have the vague
recollection of having read about this before.
On Fri, 01 May 2015 21:06:02 +0000, gogalthorp wrote:
> But the system has to run on one and the others are there just for
> compiling and maybe running the compile programs. It is unlike java
> (which you can have multiple versions) in that the C libraries are
> absolutely needed for the system to run. Running VM’s with properly
> configure system for each version is the lest likely to cause any
> problem or be too complicated to manage.
Using osc to do local builds also would take care of this. I use osc to
build stuff for SLES 11 SP3 - which uses a different version of GCC than
openSUSE 13.x - and that works just fine. osc actually sets up the
proper build environment based on the repos selected as build
Had a look at OSC and it seems too much hassle and quite a learning curve when I’m trying to streamline my research… Maybe I’m just missing something, but I couldn’t seem to find out how to search for specific applications or how to easily manage installed ones - and I spent a good hour+ on it.
I’m still getting very weird behaviour with my parallel (OpenMP) codes in openSUSE (using gcc48) and overall a quite confused experience so far. I still want a simple way to install multiple versions of the same compilers, but I guess for when I truly need that I’ll just boot into Ubuntu or OSX on my laptop. Maybe when I have more time I’ll look into OSC in more detai as I would really like to be able to stop booting into different OSes and using different comps…
If the programs are open source just recompile them but if binary blobs you have to get the people that made them recompile. Easier said then done
Another possibility is that what you really need is the libraries. If so then perhaps putting the appropriate lib in the same directory as the executable would work. You don’t actually need the compiler just the correct libs. Most programs will look at local directory first before going to the path to find a lib
Been awhile since I dabbled in a little CUDA, I can’t remember for sure that there was any kernel modification, I only remember that an nVidia GPU with CUDA support was required (I think today there aren’t special CUDA GPUs, all proprietary nVidia drivers should support CUDA).
If that’s the case, I’d guess that it should be possible to build your special environment in a Linux container, and I’d probably recommend openSUSE 13.1 to be sure you have access to the older gcc libraries.
To build in a Linux container, you can do this either with LXC or Docker (the latter would be my preference today).
In a Docker container specifically, the only shared resources between your Host and each Container “Guest” would be CPU resources. Everything related to the the running Container should run in its own isolated namespace and to the guest, everything would appear as bare metal hardware.
> Thanks a lot Jim.
> Had a look at OSC and it seems too much hassle and quite a learning
> curve when I’m trying to streamline my research… Maybe I’m just
> missing something, but I couldn’t seem to find out how to search for
> specific applications or how to easily manage installed ones - and I
> spent a good hour+ on it.
Once you get it set up, it’s actually a lot simpler. It does have a
little bit of a learning curve, but once you get there, it is extremely
> I’m still getting very weird behaviour with my parallel (OpenMP) codes
> in openSUSE (using gcc48) and overall a quite confused experience so
> far. I still want a simple way to install multiple versions of the same
> compilers, but I guess for when I truly need that I’ll just boot into
> Ubuntu or OSX on my laptop. Maybe when I have more time I’ll look into
> OSC in more detai as I would really like to be able to stop booting into
> different OSes and using different comps…
> Thanks again!
No problem - I understand the need. Something else you might look at as
an alternative is using Vagrant to deploy different build environments
based on the compilation need. It’s again a little more involved than
doing what you’re dong with Ubuntu or OSX, but something that I always
try to keep in mind as well is when there’s multiple sets of libraries,
compilers, and other stuff installed, managing the differences in the
environments can be pretty hairy, and if you indavertently link to the
wrong version of something, that can create all sorts of problems.
Separate environments are going to give you a clean “sandbox” to work
from where you know the dependent libraries are all you’re going to link
to - and for the version of the compiler you’re using.
OSC helps manage some of that, because the build environment is specific
to the requirements given at build time (in the spec file if an RPM
target is used, or whatever’s used for building .deb packages or other
platforms). OSC is part of the open build services at build.opensuse.org,
so that might also give you some stuff to look at that can help you with
your build stuff. The thing that OSC brings that OBS doesn’t do on its
own is local builds - builds on the build service servers tend to take a
bit longer to execute because they’re queued up with other packages being
built in the cluster.