How to install different version of gcc in different user account?

I want to use different version of gcc in order to build my programme

Do you have root access on the machine.If not I doubt you can install gcc.If you do though I’m not sure.A friend of mine has both gcc 2.96 and 3.something installed.It’s set up in such a way that gcc refers to 2.96 and gcc-3(or something like that refers to gcc 3.x.But that might be only possible with gcc-3 at least by just installing a package as he did.

Not sure, but you may be able to pass arguments to gcc’s configure script so when you “make install” it puts it in some local directory (in your userarea).

I heard In some Unix OA you could set up your owen system invariament.Path ,and execute directory!
Do you know somebody experienced in this?

You can set your own path but I don’t see how that is going to help you.I assume you can install gcc in a local dir like jmg said by changing the config script,but I’m not sure gcc is going to run correctly.What do you want to do exactly?

Step 1: Download gcc source (http://gcc.gnu.org/)

Step 2: Read instructions. When configuring, make sure you specify an installation root that you have write access to (say, ~/my-gcc/).

Step 3: Point your makefiles to ~/my-gcc/bin/gcc. If your Makefiles are halfway intelligent, this can usually be achieved with “make CC=~/my-gcc/bin/gcc”.

Step 4: Profit!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.