ubuntu 16.04 从gcc 5.4 安装gcc 5.3.0

Wesley13
• 阅读 838

参考:

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,亲测有效。

ubuntu 16.04 从gcc 5.4 安装gcc 5.3.0

安装

#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' failed make: *** [all] Error 2

然后我检查了日志

gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files

conftest.c:10:21: fatal error: isl/val.h: No such file or directory

configure:4074: checking for gcc
configure:4090: found /usr/bin/gcc
configure:4101: result: gcc
configure:4330: checking for C compiler version
configure:4339: gcc --version >&5
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4350: $? = 0
configure:4339: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.9' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 
configure:4350: $? = 0
configure:4339: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:4350: $? = 1
configure:4339: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:4350: $? = 1
configure:4370: checking for C compiler default output file name
configure:4392: gcc    conftest.c  >&5
configure:4396: $? = 0
configure:4433: result: a.out
configure:4449: checking whether the C compiler works
configure:4458: ./a.out
configure:4462: $? = 0
configure:4477: result: yes
configure:4484: checking whether we are cross compiling
configure:4486: result: no
configure:4489: checking for suffix of executables
configure:4496: gcc -o conftest    conftest.c  >&5
configure:4500: $? = 0
configure:4522: result: 
configure:4528: checking for suffix of object files
configure:4550: gcc -c   conftest.c >&5
configure:4554: $? = 0
configure:4575: result: o
configure:4579: checking whether we are using the GNU C compiler
configure:4598: gcc -c   conftest.c >&5
configure:4598: $? = 0
configure:4607: result: yes
configure:4616: checking whether gcc accepts -g
configure:4636: gcc -c -g  conftest.c >&5
configure:4636: $? = 0
configure:4677: result: yes
configure:4694: checking for gcc option to accept ISO C89
configure:4758: gcc  -c -g -O2  conftest.c >&5
configure:4758: $? = 0
configure:4771: result: none needed
configure:4849: checking for g++
configure:4865: found /usr/bin/g++
configure:4876: result: g++
configure:4903: checking for C++ compiler version
configure:4912: g++ --version >&5
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4923: $? = 0
configure:4912: g++ -v >&5
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.9' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 
configure:4923: $? = 0
configure:4912: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:4923: $? = 1
configure:4912: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'
g++: fatal error: no input files
compilation terminated.

 对于安装到一半错了,我的办法是直接删除安装文件夹,然后看看差什么,重新开始

  • 首先,整了下路径:

    export LD_LIBRARY_PATH=/opt/gmp-5.0.1/lib:/opt/mpfr-3.1.4/lib/:/opt/mpc-1.0:$LD_LIBRARY_PATH
    
  • 然后看了下

ubuntu 16.04 从gcc 5.4 安装gcc 5.3.0

/usr/local/gcc-5.3/missing: 81: /usr/local/gcc-5.3/missing: makeinfo: not found
checking for expect... no

解决方法来自:https://stackoverflow.com/questions/338317/what-is-makeinfo-and-how-do-i-get-it

之后再次生成makefile

sudo apt-get install texinfosudo /usr/local/gcc-5.3/configure --prefix=/usr/local/gcc-5.3/objdir --enable-languages=c,c++ --enable-threads=posix --disable-multilib --disable-nls --disable-bootstrap --with-gmp=/usr/local/gcc-5.3/gmp-4.3.2 --with-mpfr=/usr/local/gcc-5.3/mpfr-2.4.2 --with-mpc=/usr/local/gcc-5.3/mpc-0.8.1

ubuntu 16.04 从gcc 5.4 安装gcc 5.3.0

然后就没了

  • 再次运行 

  •   sudo 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/gcc-5.3/objdir/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc-5.3/objdir/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc-5.3/objdir/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc-5.3/objdir/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:12662: recipe for target 'configure-target-libgcc' failed
      make[1]: *** [configure-target-libgcc] Error 1
      make[1]: Leaving directory '/usr/local/gcc-5.3.0'
      Makefile:875: recipe for target 'all' failed
      make: *** [all] Error 2
    

Round 2

export  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/gcc-5.3/mpc-0.8.1/lib:/usr/local/gcc-5.3/gmp-4.3.2/lib:/usr/local/gcc-5.3/mpfr-2.4.2/lib/

我再次更改了我路径的说法,一般情况下,找不到东西,都是应为路径问题。

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... no
checking for mawk... mawk
checking for libatomic support... yes
checking for libcilkrts support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr/mpc libraries... yes
checking for compatible ISL... no
*** This configuration is not supported in the following subdirectories:
     target-libmpx gnattools gotools target-libada target-libgfortran target-libgo target-libffi target-libbacktrace target-zlib target-libjava target-libobjc target-liboffloadmic target-boehm-gc
    (Any other directories should still work fine.)
checking for default BUILD_CONFIG... 
checking for --enable-vtable-verify... no
checking for bison... no
checking for byacc... no
checking for yacc... no
checking for bison... no
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... no
checking for lex... no
checking for flex... no
checking for makeinfo... makeinfo
checking for expect... no
checking for runtest... no
checking for ar... ar
checking for as... as
checking for dlltool... no
checking for ld... ld
checking for lipo... no
checking for nm... nm
checking for ranlib... ranlib
checking for strip... strip
checking for windres... no
checking for windmc... no
checking for objcopy... objcopy
checking for objdump... objdump
checking for readelf... readelf
checking for cc... cc
checking for c++... c++
checking for gcc... gcc
checking for gcj... no
checking for gfortran... gfortran
checking for gccgo... no
checking for ar... no
checking for ar... ar
checking for as... no
checking for as... as
checking for dlltool... no
checking for dlltool... no
checking for ld... no
checking for ld... ld
checking for lipo... no
checking for lipo... no
checking for nm... no
checking for nm... nm
checking for objcopy... no
checking for objcopy... objcopy
checking for objdump... no
checking for objdump... objdump
checking for ranlib... no
checking for ranlib... ranlib
checking for readelf... no
checking for readelf... readelf
checking for strip... no
checking for strip... strip
checking for windres... no
checking for windres... no
checking for windmc... no
checking for windmc... no
checking where to find the target ar... host tool
checking where to find the target as... host tool
checking where to find the target cc... just compiled
checking where to find the target c++... just compiled
checking where to find the target c++ for libstdc++... just compiled
checking where to find the target dlltool... host tool
checking where to find the target gcc... just compiled
checking where to find the target gcj... host tool
checking where to find the target gfortran... host tool
checking where to find the target gccgo... host tool
checking where to find the target ld... host tool
checking where to find the target lipo... host tool
checking where to find the target nm... host tool
checking where to find the target objcopy... host tool
checking where to find the target objdump... host tool
checking where to find the target ranlib... host tool
checking where to find the target readelf... host tool
checking where to find the target strip... host tool
checking where to find the target windres... host tool
checking where to find the target windmc... host tool
checking whether to enable maintainer-specific portions of Makefiles... no
configure: creating ./config.status
config.status: creating Makefile

还是出现了那个问题

我决定鸽了。应该是版本问题,以前的版本比较顽固

点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Easter79 Easter79
3年前
swap空间的增减方法
(1)增大swap空间去激活swap交换区:swapoff v /dev/vg00/lvswap扩展交换lv:lvextend L 10G /dev/vg00/lvswap重新生成swap交换区:mkswap /dev/vg00/lvswap激活新生成的交换区:swapon v /dev/vg00/lvswap
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Jacquelyn38 Jacquelyn38
3年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
Stella981 Stella981
3年前
KVM调整cpu和内存
一.修改kvm虚拟机的配置1、virsheditcentos7找到“memory”和“vcpu”标签,将<namecentos7</name<uuid2220a6d1a36a4fbb8523e078b3dfe795</uuid
Wesley13 Wesley13
3年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
3年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
3年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
10个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这