ubuntu 16.04 从gcc 5.4 安装gcc 5.3.0

参考:

https://www.cnblogs.com/damonxu/p/6434265.html

http://blog.csdn.net/striker_v/article/details/51920627

https://www.cnblogs.com/Norlan/p/5196920.html

tips:

如果不能科学上网,那么ftp是访问不了的,可以直接把ftp三个字母换成http,亲测有效。

 

安装

#su

#cd /opt

#wget http://ftp.gnu.org/gnu/gcc/gcc-5.3.0/gcc-5.3.0.tar.gz

 安装前置

你的编译器告诉你还需要GMP啊,等等,就是说你需要前置的三个安装包。

然后按照:

https://www.cnblogs.com/damonxu/p/6434265.html

的方法把ftp统统改成http进行安装。

每安装完一个都要用

make check

看下安装情况

5.4降到5.3的安装

../gcc-5.3.0/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-2.4.2 --with-mpc=/usr/local/mpc-0.8.1

这个前面的..请换成你的gcc解压包的路径,绝对的或者相对的都可以。

 

错误锦集:

就是之前说的,make check。安装gmp时,作者提示强烈建议运行sudo make check

  1. 检查下有没有错误。然后我就出现了如下错误。这句命令以上博客都没有提到。
1 of 58 tests failed
Please report to gmp-bugs@gmplib.org
====================================
Makefile:1004: recipe for target 'check-TESTS' failed
make[4]: *** [check-TESTS] Error 1
make[4]: Leaving directory '/usr/local/gmp-4.3.2/tests/mpz'
Makefile:1104: recipe for target 'check-am' failed
make[3]: *** [check-am] Error 2
make[3]: Leaving directory '/usr/local/gmp-4.3.2/tests/mpz'
Makefile:505: recipe for target 'check-recursive' failed
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory '/usr/local/gmp-4.3.2/tests'
Makefile:925: recipe for target 'check-recursive' failed
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory '/usr/local/gmp-4.3.2'
Makefile:1183: recipe for target 'check' failed
make: *** [check] Error 2

相关错误只有这里:

https://gmplib.org/list-archives/gmp-bugs/2013-November/003225.html

找到了,鉴于还是安装上了,所以暂时不管。

  1. 之后全部走完该安装gcc了,在make 的时候出现了如下错误:
checking for x86_64-unknown-linux-gnu-gcc... /usr/local/gcc-5.3.0/./gcc/xgcc -B/usr/local/gcc-5.3.0/./gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include   
checking for suffix of object files... configure: error: in `/usr/local/gcc-5.3.0/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
Makefile:16229: recipe for target 'configure-stage1-target-libgcc' failed
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory '/usr/local/gcc-5.3.0'
Makefile:20383: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '/usr/local/gcc-5.3.0'
Makefile:902: recipe for target 'all'
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值