Whatever you do will be insignificant, but it is very important that you do it.
- Mahatma Gandhi

Wednesday, January 27, 2010

Compiling New GCC on Old RHEL 4

We're trying to run some new software that requires a fairly new version (4.4.2) of the gcc compiler, but we're on RHEL4. Solution? Compiling it myself. Usually, this isn't too much of a problem. Today I ran into a few snags. I thought I would post this quick and dirty solution to the problem in hopes of making it a little easier for somebody else if they ran into the same issue.
First, the new version of gcc requires mpfr and gmp. I had those installed from some previous work, so I pointed to them with the --with-gmp= and --with-mpfr= configure options. Configure seemed to work OK, but then it would bomb during the make with an error:
checking for suffix of object files... configure: error: in `/$HOME/gcc-4.4.2/i686-pc-linux-gnu/libgcc':
I was dumbfounded. After some looking, and several articles that appeared to be talking about something totally different, I decided to experiment with LD_LIBRARY_PATH, my old friend / nemesis. It seems that if I set LD_LIBRARY_PATH to the lib directories where I installed gmp and mpfr, the make works fine. For some reason, it wasn't enough to pass them as arguments to configure. Happily, this solved my problems. Go (con)figure!

No comments: