Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to compile a program on a cluster (as a non-privileged user), which requires gcc-4.6, but the cluster has only gcc-4.1.2.

I don't want to tell the administrator to update gcc, because 1) he is busy and would do it only after several days. 2) He probably wouldn't update it anyway, since other users may need the older gcc version (gcc is not backward compatible)

I tried to compile gcc from source, which seems more difficult that it sounds, since it requires several other packages to be installed (GMP, MPFR, MPC, ...), and when I did it, after several hours I got a message like

checking for __gmpz_init in -lgmp... no
configure: error: libgmp not found or uses a different ABI (including static vs shared).

at which point a got stuck.

My question is: what is the easiest way to install the latest version of gcc as a non-privileged user? (something like apt-get install XXXXX, with an option to not install as root for example)

The setup of the cluster is the following:

CentOS release 5.4 (Final)
Rocks release 5.3 (Rolled Tacos)

If there are no other options than compiling from source, do you have any ideas how to handle the above error?

share|improve this question
up vote 1 down vote accepted

I'd say you need to compile it your self.

On to your error message. Did you compile GMP yourself? You probably need to do that and pass its information to configure so it doesn't try to use the old one from the system.

share|improve this answer
Thank you for the reply. Yes I compiled GMP myself. I also added the following flags when confiuring MPC: ./configure --disable-shared --with-mpfr=/home/USERNAME/mpfr-3.1.1 --with-gmp-include=/home/USERNAME/gmp-5.0.5 and got the error above – voth Dec 18 '12 at 12:20
I don't have easy access to gcc's configure script right now, but you need to pass it something for the lib, what you have passed is just for the include files. Possibly there's a plain --with-gmp flag to use. – Daniel Landau Dec 18 '12 at 12:25
Yes I also tried --with-gmp istead, and then I get checking for gmp.h... no configure: error: gmp.h cannot be found or is unusable.. Additionally, The configure script does not let --with-gmp and --with-gmp-include to be used at the same time. Since the question is evolving to a programming rather than an administration issue, do you think is should be moved to Stack Overflow? (not sure how this is done) – voth Dec 18 '12 at 12:31
If you check the help text (./configure --help), it says that --with-gmp=PATH is equivalent to --with-gmp-include=PATH/include plus --with-gmp-lib=PATH/lib, so you do need either both the specific ones or the plain one. – Daniel Landau Dec 19 '12 at 7:29
I solved the problem using the instructions from this post. Thank you for your help. – voth Dec 19 '12 at 18:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.