gcc-4.7.2 在 Rhel 6 上安装失败
gcc-4.7.2 installation fails on Rhel 6
我尝试在 RHEL 6 上安装 gcc 4.7.2。我已经从 here 下载了 tar.gz 存档,并执行了以下步骤。
tar zxvf gcc-4.7.2.tar.gz
cd gcc-4.7.2
./configure --prefix=/usr/local/gcc-4.7.2/ --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-tune=generic --with-gmp=/usr/local/gimp-4.3.2/ --with-mpfr=/usr/local/mpfr-2.4.2/ --with-mpc=/usr/local/mpc-0.8.1/ --with-ppl=/usr/local/ppl-0.11 --with-cloog=/usr/local/cloog-ppl-0.15/
make
每当我执行 make 时,它都会抛出以下错误:
cp ../.././gcc/../fixincludes/README-fixinc include-fixed/README
chmod a+r include-fixed/README
echo timestamp > stmp-int-hdrs
make[3]: Leaving directory `/temp/gcc-4.7.2/host-x86_64-redhat-linux/gcc'
Checking multilib configuration for libgcc...
Configuring stage 1 in x86_64-redhat-linux/libgcc
configure: loading cache ./config.cache
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... gawk
checking for x86_64-redhat-linux-ar... ar
checking for x86_64-redhat-linux-lipo... lipo
checking for x86_64-redhat-linux-nm... /temp/gcc-4.7.2/host-x86_64-redhat-linux/gcc/nm
checking for x86_64-redhat-linux-ranlib... ranlib
checking for x86_64-redhat-linux-strip... strip
checking whether ln -s works... yes
checking for x86_64-redhat-linux-gcc... /temp/gcc-4.7.2/host-x86_64-redhat-linux/gcc/xgcc -B/temp/gcc-4.7.2/host-x86_64-redhat-linux/gcc/ -B/usr/local/gcc-4.7.2/x86_64-redhat-linux/bin/ -B/usr/local/gcc-4.7.2/x86_64-redhat-linux/lib/ -isystem /usr/local/gcc-4.7.2/x86_64-redhat-linux/include -isystem /usr/local/gcc-4.7.2/x86_64-redhat-linux/sys-include
checking for suffix of object files... configure: error: in `/temp/gcc-4.7.2/x86_64-redhat-linux/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/temp/gcc-4.7.2'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/temp/gcc-4.7.2'
make: *** [all] Error 2
如何解决这个错误?
我的问题已经解决了。只是我已经将 gmp、mpc、mpfr、ppl 库的路径导出到环境变量 LD_LIBRARY_PATH。
我尝试在 RHEL 6 上安装 gcc 4.7.2。我已经从 here 下载了 tar.gz 存档,并执行了以下步骤。
tar zxvf gcc-4.7.2.tar.gz
cd gcc-4.7.2
./configure --prefix=/usr/local/gcc-4.7.2/ --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-tune=generic --with-gmp=/usr/local/gimp-4.3.2/ --with-mpfr=/usr/local/mpfr-2.4.2/ --with-mpc=/usr/local/mpc-0.8.1/ --with-ppl=/usr/local/ppl-0.11 --with-cloog=/usr/local/cloog-ppl-0.15/
make
每当我执行 make 时,它都会抛出以下错误:
cp ../.././gcc/../fixincludes/README-fixinc include-fixed/README
chmod a+r include-fixed/README
echo timestamp > stmp-int-hdrs
make[3]: Leaving directory `/temp/gcc-4.7.2/host-x86_64-redhat-linux/gcc'
Checking multilib configuration for libgcc...
Configuring stage 1 in x86_64-redhat-linux/libgcc
configure: loading cache ./config.cache
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... gawk
checking for x86_64-redhat-linux-ar... ar
checking for x86_64-redhat-linux-lipo... lipo
checking for x86_64-redhat-linux-nm... /temp/gcc-4.7.2/host-x86_64-redhat-linux/gcc/nm
checking for x86_64-redhat-linux-ranlib... ranlib
checking for x86_64-redhat-linux-strip... strip
checking whether ln -s works... yes
checking for x86_64-redhat-linux-gcc... /temp/gcc-4.7.2/host-x86_64-redhat-linux/gcc/xgcc -B/temp/gcc-4.7.2/host-x86_64-redhat-linux/gcc/ -B/usr/local/gcc-4.7.2/x86_64-redhat-linux/bin/ -B/usr/local/gcc-4.7.2/x86_64-redhat-linux/lib/ -isystem /usr/local/gcc-4.7.2/x86_64-redhat-linux/include -isystem /usr/local/gcc-4.7.2/x86_64-redhat-linux/sys-include
checking for suffix of object files... configure: error: in `/temp/gcc-4.7.2/x86_64-redhat-linux/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/temp/gcc-4.7.2'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/temp/gcc-4.7.2'
make: *** [all] Error 2
如何解决这个错误?
我的问题已经解决了。只是我已经将 gmp、mpc、mpfr、ppl 库的路径导出到环境变量 LD_LIBRARY_PATH。