Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm getting bootstrap errors while trying to install GCC and could use some help. I'm trying to compile GCC in my home directory on a shared system (cluster). The cluster has GCC 4.4.3, which I'm using to bootstrap the compilation. I wrote this little script to show what I'm doing and to help in debugging:

# Installation parameters
gccver=4.8.0
gmpver=5.1.1
mpcver=1.0.1
mpfrver=3.1.2
prefix=$HOME/local
langs=c,c++

# Download source
wget ftp://gnu.mirror.iweb.com/gnu/gcc/gcc-${gccver}/gcc-${gccver}.tar.gz
wget ftp://ftp.gnu.org/gnu/gmp/gmp-${gmpver}.tar.bz2
wget ftp://ftp.gnu.org/gnu/mpc/mpc-${mpcver}.tar.gz
wget ftp://ftp.gnu.org/gnu/mpfr/mpfr-${mpfrver}.tar.gz

# Unpack source
tar -xzvf gcc-${gccver}.tar.gz
tar -xjvf gmp-${gmpver}.tar.bz2
tar -xzvf mpc-${mpcver}.tar.gz
tar -xzvf mpfr-${mpfrver}.tar.gz

# Move dependency source directories into gcc source directory
mv gmp-${gmpver} gcc-${gccver}/gmp
mv mpc-${mpcver} gcc-${gccver}/mpc
mv mpfr-${mpfrver} gcc-${gccver}/mpfr

# create a build directory and change to it
mkdir objdir
pushd objdir

# configure, make, check, and install gcc:
../gcc-${gccver}/configure --prefix=${prefix} --enable-languages=${langs}
make -j 16
make install

# return to the original directory
popd

The above fails during 'make' with the error: "Bootstrap comparison failure!" I've uploaded the last few pages of output as error.txt, and also config.log from the configure stage. I've tried:

  1. running make distclean from objdir and re-running configure and make.
  2. removing -j 16 from make.
  3. using an absolute path when calling configure.
  4. using the contrib/download_prerequisites script to download mpfr-2.4.2, gmp-4.3.2, and mpc-0.8.1, instead of the newer versions above.
  5. setting the PWDCMD environment variable to an automounter-aware pwd command (pawd).
  6. bootstrapping with a different version of GCC (3.4.6).
  7. bootstrapping with ICC 12.0.0 via export CC=icc and export CXX=icpc.

I also tried posting this question to the gcc mailing list; that's where I received the suggestion (2) above.

Any idea why this build is failing?

share|improve this question
    
The last few lines of the error message, from Entering directory onwards, are because make install is called even though make failed. It'd probably be a better idea to call make && make install instead of calling them separately. –  Douglas B. Staple May 15 '13 at 17:27

3 Answers 3

Try to perform make distclean and ./configure && make again.

See similar problem here: http://stackoverflow.com/questions/8651547/error-compiling-the-compiler-gcc

share|improve this answer
    
I tried this and it didn't make a difference. I saw that advice floating around, but make distclean deletes everything in my objdir (except one of the stage files), so it's the same as starting over for me. Also, I'm not doing a ./configure because gcc doesn't support building in the source tree; I run configure and make from an objdir outside the gcc source tree. –  Douglas B. Staple May 14 '13 at 13:00

You could also try "make bootstrap" or "make bootstrap4" instead of directly "make install", to see if that makes any difference.

share|improve this answer
    
Welcome to Super User. –  Douglas B. Staple May 14 '13 at 19:57
    
It's not clear to me from the GCC build instructions what the difference is between make and make bootstrap; for me it seems that make anyway performs a 3-stage bootstrap. Also, does bootstrap4 include the same first three stages as bootstrap, in which case I should expect it to fail? I'll anyway try them both when I get home from work. –  Douglas B. Staple May 14 '13 at 19:59
    
make bootstrap and make bootstrap4 both give the same error as make. Thanks for the suggestions though. –  Douglas B. Staple May 15 '13 at 12:13

A Chuck Norris builder that's in charge of the system built GCC 4.8.0 using the following steps:

module purge
cd /tmp/repoman
tar xzf ~/src/gnu/gcc-4.8.0.tar.gz
cd gcc-4.8.0/
tar xzf ~/src/gnu/mpfr-2.4.2.tar.gz
ln -s mpfr-2.4.2 mpfr
tar xzf ~/src/gnu/gmp-4.3.2.tar.gz
ln -s gmp-4.3.2 gmp
tar xzf ~/src/gnu/mpc-0.8.1.tar.gz
ln -s mpc-0.8.1 mpc
cd ../
mkdir objdir
cd objdir/
../gcc-4.8.0/configure --prefix=/usr/local/gcc-4.8.0 CC=gcc4 CXX=g++4
make && make install

This is quite similar to what I was doing. The differences were that I didn't do a module purge, I mv'd the prerequisite sources instead of ln -s'ing them, I didn't specify CC=gcc4 CXX=g++4, and obviously my --prefix pointed to a path in my home directory. I'm not sure which of these would've made the difference; probably either CC=... CXX=... or module purge. I will test and post the result.

share|improve this answer

Your Answer

 
discard

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.