#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)