gcc 4.6.0 源码安装
安装环境
[root@vm11 ~]# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64 :graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:prin ting-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 5.6 (Final)
Release: 5.6
Codename: Final
[root@vm11 ~]#
切换到浏览器.
在官方网站上选择gcc 4.6.0下载的ftp站点http://gcc.gnu.org/mirrors.html
我选择的是 http://mirrors-us.seosue.com/gcc/
NameLast modifiedSizeDescription
Parent Directory | - | |||
README | 25-Apr-2003 01:09 | 765 | ||
infrastructure/ | 01-Apr-2011 04:43 | - | ||
libstdc++/ | 17-Dec-2007 16:00 | - | ||
md5.sum | 09-Mar-2010 16:00 | 41 | ||
old-releases/ | 16-Jun-2001 17:00 | - | ||
releases/ | 29-Jun-2011 04:34 | - | ||
snapshots/ | 29-Jun-2011 04:34 | - | ||
summit/ | 29-Jun-2011 04:34 | - |
进入ftp的目录,选择releases->gcc-4.6.0
gcc-4.6.0.tar.bz2 | 25-Mar-2011 11:03 | 68M | ||
gcc-4.6.0.tar.gz | 25-Mar-2011 11:04 | 89M |
|
选择其中一个复制下载链接
wget http://mirrors-us.seosue.com/gcc/releases/gcc-4.6.0/gcc-4.6.0.tar.bz2
bunzip2 gcc-4.6.0.tar.bz2
tar xf gcc-4.6.0.tar
编译源码安装gcc 4.6.0还需要一些依赖库
进入上面的ftp目录infrastructure/
分别 gmp mpc mpfr ppl cloog 安装包
wget http://mirrors-us.seosue.com/gcc/infrastructure/gmp-4.3.2.tar.bz2
wget http://mirrors-us.seosue.com/gcc/infrastructure/mpc-0.8.1.tar.gz
wget http://mirrors-us.seosue.com/gcc/infrastructure/mpfr-2.4.2.tar.bz2
wget http://mirrors-us.seosue.com/gcc/infrastructure/ppl-0.11.tar.gz
wget http://mirrors-us.seosue.com/gcc/infrastructure/cloog-0.16.2.tar.gz
如果cloog编译有问题可以在这里下载最新的http://gcc.gnu.org/wiki/Graphite_Build
bunzip2 gmp-4.3.2.tar.bz2
tar xf gmp-4.3.2.tar
gunzip mpc-0.8.1.tar.gz
tar xf mpc-0.8.1.tar
bunzip2 mpfr-2.4.2.tar.bz2
tar xf mpfr-2.4.2.tar
gunzip ppl-0.11.tar.gz
tar xf ppl-0.11.tar
gunzip cloog-0.16.2.tar.gz
tar xf cloog-0.16.2.tar
cd gmp-4.3.2
./configure --prefix=/usr
make && make install
最好指定安装目录,如果是默认是/usr/local/,有时候安装在local 时候,有可能出现在编译时候没有找到对应库
还有可以编辑/etc/ld.so.conf 文件添加/usr/local/目录,再次ldconfig
cd mpfr-2.4.2
./configure --prefix=/usr --with-gmp=/usr/
make && make install
cd mpc-0.8.1
./configure --prefix=/usr/ --with-gmp=/usr/ --with-mpfr=/usr/
make && make install
cd ppl-0.11
./configure --prefix=/usr/ --with-gmp=/usr/
make && make install
cd cloog-0.16.2
./configure --prefix=/usr/ --with-gmp=/usr/ --with-ppl=/usr/
make && make install
cd gcc.4.6.0
./configure --with-gmp=/usr/ --with-mpfr=/usr/ --with-mpc=/usr/ --with-cloog=/usr/ --enable-languages=c,c++ --enable-threads=posix --enable-__cxa_atexit --with-cpu=generic --disable-multilib --with-ppl=/usr/
make && make install