1

I would like to install devtools on a cluster that runs CentOS 5.4 (to get a higher version of gcc than the default one. I need gcc>4.7 to use some C++11 features)

However I don't have root permission. Is it possible to install devtools in my user home folder, without root access? The steps given in this answer assume root access is available. Thanks for any info or links.

2 Answers 2

1

Yes, certainly. But there are a few things to be aware of.

You should compile from source and give a prefix to your home directory:

./configure --prefix=$HOME

Of course add parameters as needed. make install will then install in /home/yourdir/bin, /home/yourdir/lib, etc. You may need to run 'ldconfig' manually on your lib directory to create shortened symlinks to your libraries.

In your shell environment, add the path to your personal 'bin' directory first, if it is not already done so. For example, add this to your .bashrc:

PATH=$HOME/bin:$PATH
LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH
export PATH LD_LIBRARY_PATH

This will make sure your own copy of gcc will be found first; LD_LIBRARY_PATH does the same for your own dynamic libraries.

Note that newer versions of gcc may require newer versions of binutils, the assembler and various libraries as well so you may end up with a lot more than just gcc. Also, I think it is recommended to first compile just the C compiler (with --enable-languages=C), then recompile gcc with itself to compile the C++ compiler.

Finally, the above may interfere with existing system C++ libraries; in the past I've had problems with linking C++ libraries compiled by different gcc versions into my programs. C libraries usually do not have this problem.

0

i don't think u can upgrade GCC if you are not root. Try downloading the rpm and install it, but chances are very less.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .