中科院超级计算青岛分中心gcc4.5.3安装手册

软件名称: 
gcc4.5.3
安装目录: 
/public/soft/gcc453
软件介绍: 

GNU编译器套件(GNU Compiler Collection)包括C、C++、Objective-C、Fortran、Java、Ada和Go语言的前端,也包括了这些语言的库(如libstdc++、libgcj等等)。GCC的初衷是为GNU操作系统专门编写的一款编译器。GNU系统是彻底的自由软件。此处,“自由”的含义是它尊重用户的自由。[

安装步骤: 

1.要安装gcc需要GMP、MPFR、MPC这三个库,可从网上下载相应的压缩包。
由于MPFR依赖GMP,而MPC依赖GMP和MPFR,所以要先安装GMP,其次MPFR,最后才是MPC。这里三个库我用的版本分别是gMP4.2,mpfr2.3.1和mpc0.8.0。
 先开始安装GMP:

tar -jxf gmp-5.0.2.tar.bz2

cd gmp-5.0.2/

./configure --prefix=/public/home/zhaozengfang/software/gcc/gmp

make
make check
make install

vi ~/.bashrc

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/public/home/zhaozengfang/software/gcc/gmp/lib
保存退出

source ~/.bashrc

tar -jxf mpfr-2.4.2.tar.bz2
cd mpfr-2.4.2/
./configure --prefix=/public/home/zhaozengfang/software/gcc/mpfr --with-gmp=/public/home/zhaozengfang/software/gcc/gmp
make
make check
make install

vi ~/.bashrc

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/public/home/zhaozengfang/software/gcc/gmp/lib:/public/home/zhaozengfang/software/gcc/mpfr/lib
保存退出

source ~/.bashrc

tar -zxvf mpc-0.8.2.tar.gz

cd mpc-0.8.2/
./configure --prefix=/public/home/zhaozengfang/software/gcc/mpc --with-gmp=/public/home/zhaozengfang/software/gcc/gmp --with-mpfr=/public/home/zhaozengfang/software/gcc/mpfr
make
make check
make install

vi ~/.bashrc

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/public/home/zhaozengfang/software/gcc/gmp/lib:/public/home/zhaozengfang/software/gcc/mpfr/lib:/public/home/zhaozengfang/software/gcc/mpc/lib
保存退出

source ~/.bashrc

tar -jxf gcc-4.5.3.tar.bz2
cd  gcc-4.5.3/
./configure --prefix=/public/home/zhaozengfang/software/gcc/gcc --enable-languages=c,c++,fortran --with-gmp=/public/home/zhaozengfang/software/gcc/gmp --with-mpfr=/public/home/zhaozengfang/software/gcc/mpfr --with-mpc=/public/home/zhaozengfang/software/gcc/mpc
make