安装gcc需要GMP、MPFR、MPC这三个库,下载地址
1)安装gmp-4.3.2
mkdir gmp-build
../gmp-4.3.2/configure --prefix=/usr/local/gmp-4.3.2
make
make check
make install
2)安装mpfr-2.4.2
mkdir mpfr-build
../mpfr-2.4.2/configure --prefix=/usr/local/mpfr-2.4.2 --with-gmp=/usr/local/gmp-4.3.2
3)安装mpc-0.8.1
mkdir mpc-build
../mpc-0.8.1/configure --prefix=/usr/local/mpc-0.8.1 --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-2.4.2
4)安装gcc-4.5.0
mkdir gcc-build
../gcc-4.5.0/configure --prefix=/usr/local/gcc-4.5.0 --enable-threads=posix --disable-checking --disable-multilib --enable-languages=c,c++ --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-2.4.2 --with-mpc=/usr/local/mpc-0.8.1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpc-0.8.1/lib:/usr/local/gmp-5.0.1/lib:/usr/local/mpfr-2.4.2/lib
make
make check
make install
cd /usr/bin
ln -s /usr/local/gcc-4.5.0/bin/gcc gcc45
ln -s /usr/local/gcc-4.5.0/bin/g++ g++45
LD_LIBRARY_PATH=:/usr/local/mpc-0.8.1/lib:/usr/local/gmp-4.3.2/lib:/usr/local/mpfr-2.4.2/lib:/usr/local/gcc-4.5.0/lib
export LD_LIBRARY_PATH
阅读(664) | 评论(0) | 转发(0) |