I am working on an HPC cluster that has the CentOS installed. My project requires the installation of the g++ >= 4.8.1 on the server. However, the gcc (g++) installed on the cluster is 4.4. And whats more problematic is that I am not allowed root access, so I cant use the sudo command on the cluster to install the gcc.

So, I decided to install the gcc version locally. For this, I followed these instructions. In the instructions, I simply replaced gcc 4.5 with gcc 5.1 and the word "user" with my username on the command line with the versions of gmp, mpc, and mpfr remaining the same. But however, the installation failed when I ran the command "make install" for the gcc with the following error:

"/home/<username>/build/gcc-5.1.0/host-x86_64-unknown-linux-gnu/gcc/cc1: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory"

Is there some other way of installing the latest gcc version on the HPC cluster locally?

  • You could try a more recent HOWTO. A quick google finds this one: vultr.com/docs/how-to-install-gcc-on-centos-6 - but search around, there may be other, better ones. this one assumes you have root, but you can adapt it for non-root user (e.g. by setting install prefix, lib dir, incl. dir paths etc)
    – cas
    Commented Nov 14, 2015 at 5:14
  • @cas But it seems that the above approach requires sudo privilege, but I am not allowed that privilege on the cluster. Commented Nov 14, 2015 at 5:18
  • If you don't understand the instructions in your URL enough to adapt them for 5.1 or the instructions in the URL i posted to adapt them for non-root, then perhaps you shouldn't be trying to install an updated gcc. Lack of understanding will likely lead to disaster. or broken/buggy compiles leading to unreliable/unreproducible results. If it was just gcc and not g++ it might be worth trying, but updating g++ also means updating libstdc++ (and everything that depends on it, including boost etc libs).
    – cas
    Commented Nov 14, 2015 at 5:22
  • Upgrading gcc, g++ and libstdc++ is a huge project that has taken distro dev teams months to do. You're not going to do it by yourself in a few days. You would be better off modifying your project code so that it compiles with the gcc/g++ version on your cluster....far less work, far fewer problems to fix, far less fassle.
    – cas
    Commented Nov 14, 2015 at 5:23
  • @cas Yes, I am unable to understand the instructions in the url. Perhaps you are right, I should ask some other administrator to install it or modify my project's code.... Commented Nov 14, 2015 at 5:27

1 Answer 1


You could try downloading it directly from mirror.centos.org with the command wget then changing it's privileges and running it ./.

I don't believe you need sudo for this process. But that depends on your allowed privileges.

You must log in to answer this question.

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