#yum安装是非常方便的,最多那么更改一下yum源。
#但是如果是redhat那就没那么容易了,选择rpm选择,而没有选择源码安装。
#以前倒腾过,想做笔记的忙着忙着就忘了,现在一边捣腾一边做笔记,方便以后查看
#安装gcc,然后一大堆依赖。一直折腾折腾,捣腾了很久
安装gcc
#安装gcc,依赖包需要下面的cloog-ppl、cpp、libgcc、libgomp [root@localhost gcc]# rpm -ivh gcc-4.4.7-18.el6.x86_64.rpm warning: gcc-4.4.7-18.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY error: Failed dependencies: cloog-ppl >= 0.15 is needed by gcc-4.4.7-18.el6.x86_64 cpp = 4.4.7-18.el6 is needed by gcc-4.4.7-18.el6.x86_64 libgcc >= 4.4.7-18.el6 is needed by gcc-4.4.7-18.el6.x86_64 libgomp = 4.4.7-18.el6 is needed by gcc-4.4.7-18.el6.x86_64 #安装cloog-ppl,依赖ppl [root@localhost gcc]# rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm warning: cloog-ppl-0.15.7-1.2.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY error: Failed dependencies: libppl.so.7()(64bit) is needed by cloog-ppl-0.15.7-1.2.el6.x86_64 libppl_c.so.2()(64bit) is needed by cloog-ppl-0.15.7-1.2.el6.x86_64 #安装cpp,依赖mpfr [root@localhost gcc]# rpm -ivh cpp-4.4.7-18.el6.x86_64.rpm warning: cpp-4.4.7-18.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY error: Failed dependencies: libmpfr.so.1()(64bit) is needed by cpp-4.4.7-18.el6.x86_64
上传包
#如果无法上传就安装一个lrzsz,用完不需要可以卸载了 #下载包的目录 http://rpm.pbone.net/index.php3/stat/4/idpl/40679993/dir/centos_6/com/lrzsz-0.12.20-27.1.el6.x86_64.rpm.html #直接下载 wget ftp://mirror.switch.ch/pool/4/mirror/centos/6.9/os/x86_64/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm
gcc相关的包
#总共10个包,centos的安装镜像能找到8个包,其余两个需要下载 1. libgcc-4.4.7-18.el6.x86_64.rpm 2. libgomp-4.4.7-18.el6.x86_64.rpm 3. libstdc++-4.4.7-18.el6.x86_64.rpm 4. libstdc++-devel-4.4.7-18.el6.x86_64.rpm 5. ppl-0.10.2-11.el6.x86_64.rpm 6. mpfr-2.4.1-6.el6.x86_64.rpm 7. cpp-4.4.7-18.el6.x86_64.rpm 8. cloog-ppl-0.15.7-1.2.el6.x86_64.rpm 9. gcc-4.4.7-18.el6.x86_64.rpm 10. gcc-c++-4.4.7-18.el6.x86_64.rpm
找啊找,终于找到了需要的包
#libppl_c.so.2、libppl_c.so.2来源于同一个包,ppl-0.10.2-11.el6.x86_64.rpm下载路径 #下载包的目录 http://rpm.pbone.net/index.php3/stat/4/idpl/40681264/dir/centos_6/com/ppl-0.10.2-11.el6.x86_64.rpm.html #直接下载文件 wget ftp://mirror.switch.ch/pool/4/mirror/centos/6.9/os/x86_64/Packages/ppl-0.10.2-11.el6.x86_64.rpm #libmpfr.so.1来源于mpfr-2.4.1-6.el6.x86_64.rpm下载路径 #下载包的目录 http://rpm.pbone.net/index.php3/stat/4/idpl/40680230/dir/centos_6/com/mpfr-2.4.1-6.el6.x86_64.rpm.html #直接下载文件 wget ftp://mirror.switch.ch/pool/4/mirror/centos/6.9/os/x86_64/Packages/mpfr-2.4.1-6.el6.x86_64.rpm
安装包存在,升级
1. [root@localhost gcc]# rpm -Uvh libgcc-4.4.7-18.el6.x86_64.rpm 2. [root@localhost gcc]# rpm -Uvh libgomp-4.4.7-18.el6.x86_64.rpm 3. [root@localhost gcc]# rpm -Uvh libstdc++-4.4.7-18.el6.x86_64.rpm 4. [root@localhost gcc]# rpm -ivh libstdc++-devel-4.4.7-18.el6.x86_64.rpm 5. [root@localhost gcc]# rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm 6. [root@localhost gcc]# rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm 7. [root@localhost gcc]# rpm -ivh cpp-4.4.7-18.el6.x86_64.rpm 8. [root@localhost gcc]# rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm 9. [root@localhost gcc]# rpm -ivh gcc-4.4.7-18.el6.x86_64.rpm 10. [root@localhost gcc]# rpm -ivh gcc-c++-4.4.7-18.el6.x86_64.rpm
安装完测试
#出来结果表示可以了,完成 [root@localhost gcc]# gcc -v Using built-in specs. Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --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-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)