gcc5.4.0降级为5.3.0时出现的问题求解决?顺便问一下各位大神,现在ubuntu16.04下的cuda8.0支持gcc5.4吗?是否一定要降级为5.3?

时间:2022-03-03 12:47:26
本菜鸟最近想安装ubuntu16.04下的caffe进行深度学习的科研,首先进行了安装步骤,参照的是下面这个帖子。
http://blog.csdn.net/leijiezhang/article/details/53688157

走到降级gcc这一步时,因为ubuntu16.04自带的是gcc5.4.0,所以想要降级,但是搞了一天都搞不定。
已经安装了gmp-4.3.2,mpfr-2.4.2,mpc-0.8.1。并且添加了路径
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpc-0.8.1/lib:/usr/local/gmp-4.3.2/lib:/usr/local/mpfr-2.4.2/lib

但是configure通过了,make不成功,原因如下:
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 '/opt/gcc-5.3.0'
Makefile:20383: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '/opt/gcc-5.3.0'
Makefile:902: recipe for target 'all' failed
make: *** [all] Error 2

请问这是什么问题导致的?
谢谢!

4 个解决方案

#1


贴一下config文件里的内容
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by cpplib configure  , which was
generated by GNU Autoconf 2.64.  Invocation command line was

  $ /opt/gcc-5.3.0/libcpp/configure --srcdir=../.././libcpp --cache-file=./config.cache --prefix=/usr/local/gcc-5.3.0 -enable-threads=posix -disable-checking -disable-multilib -enable-languages=c,c++ --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-2.4.2 --with-mpc=/usr/local/mpc-0.8.1 --enable-languages=c,c++,lto --program-transform-name=s,y,y, --disable-option-checking --with-build-subdir=build-x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=x86_64-unknown-linux-gnu --disable-nls am_cv_func_iconv=no

## --------- ##
## Platform. ##
## --------- ##

hostname = wdd-Lenovo
uname -m = x86_64
uname -r = 4.4.0-21-generic
uname -s = Linux
uname -v = #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2482: loading cache ./config.cache
configure:2595: checking build system type
configure:2609: result: x86_64-unknown-linux-gnu
configure:2629: checking host system type
configure:2642: result: x86_64-unknown-linux-gnu
configure:2662: checking target system type
configure:2675: result: x86_64-unknown-linux-gnu
configure:2704: checking whether make sets $(MAKE)
configure:2726: result: yes
configure:2749: checking for a BSD-compatible install
configure:2817: result: /usr/bin/install -c
configure:2836: checking for x86_64-unknown-linux-gnu-gcc
configure:2863: result: gcc
configure:3132: checking for C compiler version
configure:3141: gcc --version >&5
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 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:3152: $? = 0
configure:3141: 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.4' --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.4) 
configure:3152: $? = 0
configure:3141: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3152: $? = 1
configure:3141: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3152: $? = 1
configure:3172: checking for C compiler default output file name
configure:3194: gcc -g -O2   conftest.c  >&5
configure:3198: $? = 0
configure:3235: result: a.out
configure:3251: checking whether the C compiler works
configure:3260: ./a.out
configure:3264: $? = 0
configure:3279: result: yes
configure:3286: checking whether we are cross compiling
configure:3288: result: no
configure:3291: checking for suffix of executables
configure:3298: gcc -o conftest -g -O2   conftest.c  >&5
configure:3302: $? = 0
configure:3324: result: 
configure:3330: checking for suffix of object files
configure:3377: result: o
configure:3381: checking whether we are using the GNU C compiler
configure:3409: result: yes
configure:3418: checking whether gcc accepts -g
configure:3479: result: yes
configure:3496: checking for gcc option to accept ISO C89
configure:3573: result: none needed
configure:3705: checking for C++ compiler version
configure:3714: g++ --version >&5
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 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.

#2


configure:3725: $? = 0
configure:3714: 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.4' --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.4) 
configure:3725: $? = 0
configure:3714: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:3725: $? = 1
configure:3714: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'
g++: fatal error: no input files
compilation terminated.
configure:3725: $? = 1
configure:3729: checking whether we are using the GNU C++ compiler
configure:3757: result: yes
configure:3766: checking whether g++ accepts -g
configure:3827: result: yes
configure:3853: checking for x86_64-unknown-linux-gnu-ranlib
configure:3880: result: ranlib
configure:3949: checking how to run the C preprocessor
configure:4019: result: gcc -E
configure:4039: gcc -E  conftest.c
configure:4039: $? = 0
configure:4053: gcc -E  conftest.c
conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory
compilation terminated.
configure:4053: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cpplib"
| #define PACKAGE_TARNAME "cpplib"
| #define PACKAGE_VERSION " "
| #define PACKAGE_STRING "cpplib  "
| #define PACKAGE_BUGREPORT "gcc-bugs@gcc.gnu.org"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:4082: checking for grep that handles long lines and -e
configure:4140: result: /bin/grep
configure:4145: checking for egrep
configure:4207: result: /bin/grep -E
configure:4212: checking for ANSI C header files
configure:4316: result: yes
configure:4329: checking for sys/types.h
configure:4329: result: yes
configure:4329: checking for sys/stat.h
configure:4329: result: yes
configure:4329: checking for stdlib.h
configure:4329: result: yes
configure:4329: checking for string.h
configure:4329: result: yes
configure:4329: checking for memory.h
configure:4329: result: yes
configure:4329: checking for strings.h
configure:4329: result: yes
configure:4329: checking for inttypes.h
configure:4329: result: yes
configure:4329: checking for stdint.h
configure:4329: result: yes
configure:4329: checking for unistd.h
configure:4329: result: yes
configure:4343: checking for minix/config.h
configure:4343: result: no
configure:4364: checking whether it is safe to define __EXTENSIONS__
configure:4389: result: yes
configure:4410: checking for special C compiler options needed for large files
configure:4455: result: no
configure:4461: checking for _FILE_OFFSET_BITS value needed for large files
configure:4518: result: no
configure:4607: checking for aclocal
configure:4637: result: no
configure:4650: checking for autoconf
configure:4680: result: no
configure:4693: checking for autoheader
configure:4723: result: no
configure:4748: checking whether gcc supports -W
configure:4774: result: yes
configure:4748: checking whether gcc supports -Wall
configure:4774: result: yes
configure:4748: checking whether gcc supports -Wnarrowing
configure:4774: result: yes
configure:4748: checking whether gcc supports -Wwrite-strings
configure:4774: result: yes
configure:4748: checking whether gcc supports -Wmissing-format-attribute
configure:4774: result: yes
configure:4794: checking whether gcc supports -Wstrict-prototypes
configure:4820: result: yes
configure:4794: checking whether gcc supports -Wmissing-prototypes
configure:4820: result: yes
configure:4794: checking whether gcc supports -Wold-style-definition
configure:4820: result: yes
configure:4794: checking whether gcc supports -Wc++-compat
configure:4820: result: yes
configure:4832: checking whether gcc supports -pedantic -Wlong-long
configure:4858: result: yes
configure:4879: checking whether gcc supports -fno-exceptions
configure:4905: result: yes
configure:4879: checking whether gcc supports -fno-rtti
configure:4905: result: yes
configure:4956: g++ -c -g -O2  conftest.cpp >&5
configure:4956: $? = 0
configure:4971: checking dependency style of g++
configure:5056: result: gcc3
configure:5066: checking whether time.h and sys/time.h may both be included
configure:5093: result: yes
configure:5101: checking whether string.h and strings.h may both be included
configure:5125: result: yes
configure:5138: checking for locale.h
configure:5138: result: yes
configure:5138: checking for fcntl.h
configure:5138: result: yes
configure:5138: checking for limits.h
configure:5138: result: yes
configure:5138: checking for stddef.h
configure:5138: result: yes
configure:5138: checking for stdlib.h
configure:5138: result: yes
configure:5138: checking for strings.h
configure:5138: result: yes
configure:5138: checking for string.h
configure:5138: result: yes
configure:5138: checking for sys/file.h
configure:5138: result: yes
configure:5138: checking for unistd.h
configure:5138: result: yes
configure:5151: checking whether byte ordering is bigendian
configure:5357: result: no
configure:5375: checking for an ANSI C-conforming const
configure:5447: result: yes
configure:5455: checking for inline
configure:5479: result: inline
configure:5497: checking for obstacks
configure:5526: result: yes
configure:5541: checking for off_t
configure:5541: result: yes
configure:5552: checking for size_t
configure:5552: result: yes
configure:5563: checking for ssize_t
configure:5563: result: yes
configure:5575: checking for uintptr_t
configure:5575: result: yes

#3


configure:5610: checking for ptrdiff_t
configure:5610: result: yes
configure:5621: checking for uint64_t
configure:5621: result: yes
configure:5638: checking whether struct tm is in sys/time.h or time.h
configure:5665: result: time.h
configure:5677: checking size of int
configure:5697: result: 4
configure:5711: checking size of long
configure:5731: result: 8
configure:5745: checking for clearerr_unlocked
configure:5745: result: yes
configure:5745: checking for feof_unlocked
configure:5745: result: yes
configure:5745: checking for ferror_unlocked
configure:5745: result: yes
configure:5745: checking for fflush_unlocked
configure:5745: result: yes
configure:5745: checking for fgetc_unlocked
configure:5745: result: yes
configure:5745: checking for fgets_unlocked
configure:5745: result: yes
configure:5745: checking for fileno_unlocked
configure:5745: result: yes
configure:5745: checking for fprintf_unlocked
configure:5745: result: no
configure:5745: checking for fputc_unlocked
configure:5745: result: yes
configure:5745: checking for fputs_unlocked
configure:5745: result: yes
configure:5745: checking for fread_unlocked
configure:5745: result: yes
configure:5745: checking for fwrite_unlocked
configure:5745: result: yes
configure:5745: checking for getchar_unlocked
configure:5745: result: yes
configure:5745: checking for getc_unlocked
configure:5745: result: yes
configure:5745: checking for putchar_unlocked
configure:5745: result: yes
configure:5745: checking for putc_unlocked
configure:5745: result: yes
configure:5755: checking whether abort is declared
configure:5755: result: yes
configure:5765: checking whether asprintf is declared
configure:5765: result: yes
configure:5775: checking whether basename is declared
configure:5775: result: yes
configure:5785: checking whether errno is declared
configure:5785: result: no
configure:5795: checking whether getopt is declared
configure:5795: result: yes
configure:5805: checking whether vasprintf is declared
configure:5805: result: yes
configure:5816: checking whether clearerr_unlocked is declared
configure:5816: result: yes
configure:5826: checking whether feof_unlocked is declared
configure:5826: result: yes
configure:5836: checking whether ferror_unlocked is declared
configure:5836: result: yes
configure:5846: checking whether fflush_unlocked is declared
configure:5846: result: yes
configure:5856: checking whether fgetc_unlocked is declared
configure:5856: result: yes
configure:5866: checking whether fgets_unlocked is declared
configure:5866: result: yes
configure:5876: checking whether fileno_unlocked is declared
configure:5876: result: yes
configure:5886: checking whether fprintf_unlocked is declared
configure:5886: result: no
configure:5896: checking whether fputc_unlocked is declared
configure:5896: result: yes
configure:5906: checking whether fputs_unlocked is declared
configure:5906: result: yes
configure:5916: checking whether fread_unlocked is declared
configure:5916: result: yes
configure:5926: checking whether fwrite_unlocked is declared
configure:5926: result: yes
configure:5936: checking whether getchar_unlocked is declared
configure:5936: result: yes
configure:5946: checking whether getc_unlocked is declared
configure:5946: result: yes

#4


楼主是按照那个帖子所述的gcc降级方法吗?没成功?

#1


贴一下config文件里的内容
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by cpplib configure  , which was
generated by GNU Autoconf 2.64.  Invocation command line was

  $ /opt/gcc-5.3.0/libcpp/configure --srcdir=../.././libcpp --cache-file=./config.cache --prefix=/usr/local/gcc-5.3.0 -enable-threads=posix -disable-checking -disable-multilib -enable-languages=c,c++ --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-2.4.2 --with-mpc=/usr/local/mpc-0.8.1 --enable-languages=c,c++,lto --program-transform-name=s,y,y, --disable-option-checking --with-build-subdir=build-x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=x86_64-unknown-linux-gnu --disable-nls am_cv_func_iconv=no

## --------- ##
## Platform. ##
## --------- ##

hostname = wdd-Lenovo
uname -m = x86_64
uname -r = 4.4.0-21-generic
uname -s = Linux
uname -v = #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2482: loading cache ./config.cache
configure:2595: checking build system type
configure:2609: result: x86_64-unknown-linux-gnu
configure:2629: checking host system type
configure:2642: result: x86_64-unknown-linux-gnu
configure:2662: checking target system type
configure:2675: result: x86_64-unknown-linux-gnu
configure:2704: checking whether make sets $(MAKE)
configure:2726: result: yes
configure:2749: checking for a BSD-compatible install
configure:2817: result: /usr/bin/install -c
configure:2836: checking for x86_64-unknown-linux-gnu-gcc
configure:2863: result: gcc
configure:3132: checking for C compiler version
configure:3141: gcc --version >&5
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 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:3152: $? = 0
configure:3141: 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.4' --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.4) 
configure:3152: $? = 0
configure:3141: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3152: $? = 1
configure:3141: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3152: $? = 1
configure:3172: checking for C compiler default output file name
configure:3194: gcc -g -O2   conftest.c  >&5
configure:3198: $? = 0
configure:3235: result: a.out
configure:3251: checking whether the C compiler works
configure:3260: ./a.out
configure:3264: $? = 0
configure:3279: result: yes
configure:3286: checking whether we are cross compiling
configure:3288: result: no
configure:3291: checking for suffix of executables
configure:3298: gcc -o conftest -g -O2   conftest.c  >&5
configure:3302: $? = 0
configure:3324: result: 
configure:3330: checking for suffix of object files
configure:3377: result: o
configure:3381: checking whether we are using the GNU C compiler
configure:3409: result: yes
configure:3418: checking whether gcc accepts -g
configure:3479: result: yes
configure:3496: checking for gcc option to accept ISO C89
configure:3573: result: none needed
configure:3705: checking for C++ compiler version
configure:3714: g++ --version >&5
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 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.

#2


configure:3725: $? = 0
configure:3714: 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.4' --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.4) 
configure:3725: $? = 0
configure:3714: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:3725: $? = 1
configure:3714: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'
g++: fatal error: no input files
compilation terminated.
configure:3725: $? = 1
configure:3729: checking whether we are using the GNU C++ compiler
configure:3757: result: yes
configure:3766: checking whether g++ accepts -g
configure:3827: result: yes
configure:3853: checking for x86_64-unknown-linux-gnu-ranlib
configure:3880: result: ranlib
configure:3949: checking how to run the C preprocessor
configure:4019: result: gcc -E
configure:4039: gcc -E  conftest.c
configure:4039: $? = 0
configure:4053: gcc -E  conftest.c
conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory
compilation terminated.
configure:4053: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cpplib"
| #define PACKAGE_TARNAME "cpplib"
| #define PACKAGE_VERSION " "
| #define PACKAGE_STRING "cpplib  "
| #define PACKAGE_BUGREPORT "gcc-bugs@gcc.gnu.org"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:4082: checking for grep that handles long lines and -e
configure:4140: result: /bin/grep
configure:4145: checking for egrep
configure:4207: result: /bin/grep -E
configure:4212: checking for ANSI C header files
configure:4316: result: yes
configure:4329: checking for sys/types.h
configure:4329: result: yes
configure:4329: checking for sys/stat.h
configure:4329: result: yes
configure:4329: checking for stdlib.h
configure:4329: result: yes
configure:4329: checking for string.h
configure:4329: result: yes
configure:4329: checking for memory.h
configure:4329: result: yes
configure:4329: checking for strings.h
configure:4329: result: yes
configure:4329: checking for inttypes.h
configure:4329: result: yes
configure:4329: checking for stdint.h
configure:4329: result: yes
configure:4329: checking for unistd.h
configure:4329: result: yes
configure:4343: checking for minix/config.h
configure:4343: result: no
configure:4364: checking whether it is safe to define __EXTENSIONS__
configure:4389: result: yes
configure:4410: checking for special C compiler options needed for large files
configure:4455: result: no
configure:4461: checking for _FILE_OFFSET_BITS value needed for large files
configure:4518: result: no
configure:4607: checking for aclocal
configure:4637: result: no
configure:4650: checking for autoconf
configure:4680: result: no
configure:4693: checking for autoheader
configure:4723: result: no
configure:4748: checking whether gcc supports -W
configure:4774: result: yes
configure:4748: checking whether gcc supports -Wall
configure:4774: result: yes
configure:4748: checking whether gcc supports -Wnarrowing
configure:4774: result: yes
configure:4748: checking whether gcc supports -Wwrite-strings
configure:4774: result: yes
configure:4748: checking whether gcc supports -Wmissing-format-attribute
configure:4774: result: yes
configure:4794: checking whether gcc supports -Wstrict-prototypes
configure:4820: result: yes
configure:4794: checking whether gcc supports -Wmissing-prototypes
configure:4820: result: yes
configure:4794: checking whether gcc supports -Wold-style-definition
configure:4820: result: yes
configure:4794: checking whether gcc supports -Wc++-compat
configure:4820: result: yes
configure:4832: checking whether gcc supports -pedantic -Wlong-long
configure:4858: result: yes
configure:4879: checking whether gcc supports -fno-exceptions
configure:4905: result: yes
configure:4879: checking whether gcc supports -fno-rtti
configure:4905: result: yes
configure:4956: g++ -c -g -O2  conftest.cpp >&5
configure:4956: $? = 0
configure:4971: checking dependency style of g++
configure:5056: result: gcc3
configure:5066: checking whether time.h and sys/time.h may both be included
configure:5093: result: yes
configure:5101: checking whether string.h and strings.h may both be included
configure:5125: result: yes
configure:5138: checking for locale.h
configure:5138: result: yes
configure:5138: checking for fcntl.h
configure:5138: result: yes
configure:5138: checking for limits.h
configure:5138: result: yes
configure:5138: checking for stddef.h
configure:5138: result: yes
configure:5138: checking for stdlib.h
configure:5138: result: yes
configure:5138: checking for strings.h
configure:5138: result: yes
configure:5138: checking for string.h
configure:5138: result: yes
configure:5138: checking for sys/file.h
configure:5138: result: yes
configure:5138: checking for unistd.h
configure:5138: result: yes
configure:5151: checking whether byte ordering is bigendian
configure:5357: result: no
configure:5375: checking for an ANSI C-conforming const
configure:5447: result: yes
configure:5455: checking for inline
configure:5479: result: inline
configure:5497: checking for obstacks
configure:5526: result: yes
configure:5541: checking for off_t
configure:5541: result: yes
configure:5552: checking for size_t
configure:5552: result: yes
configure:5563: checking for ssize_t
configure:5563: result: yes
configure:5575: checking for uintptr_t
configure:5575: result: yes

#3


configure:5610: checking for ptrdiff_t
configure:5610: result: yes
configure:5621: checking for uint64_t
configure:5621: result: yes
configure:5638: checking whether struct tm is in sys/time.h or time.h
configure:5665: result: time.h
configure:5677: checking size of int
configure:5697: result: 4
configure:5711: checking size of long
configure:5731: result: 8
configure:5745: checking for clearerr_unlocked
configure:5745: result: yes
configure:5745: checking for feof_unlocked
configure:5745: result: yes
configure:5745: checking for ferror_unlocked
configure:5745: result: yes
configure:5745: checking for fflush_unlocked
configure:5745: result: yes
configure:5745: checking for fgetc_unlocked
configure:5745: result: yes
configure:5745: checking for fgets_unlocked
configure:5745: result: yes
configure:5745: checking for fileno_unlocked
configure:5745: result: yes
configure:5745: checking for fprintf_unlocked
configure:5745: result: no
configure:5745: checking for fputc_unlocked
configure:5745: result: yes
configure:5745: checking for fputs_unlocked
configure:5745: result: yes
configure:5745: checking for fread_unlocked
configure:5745: result: yes
configure:5745: checking for fwrite_unlocked
configure:5745: result: yes
configure:5745: checking for getchar_unlocked
configure:5745: result: yes
configure:5745: checking for getc_unlocked
configure:5745: result: yes
configure:5745: checking for putchar_unlocked
configure:5745: result: yes
configure:5745: checking for putc_unlocked
configure:5745: result: yes
configure:5755: checking whether abort is declared
configure:5755: result: yes
configure:5765: checking whether asprintf is declared
configure:5765: result: yes
configure:5775: checking whether basename is declared
configure:5775: result: yes
configure:5785: checking whether errno is declared
configure:5785: result: no
configure:5795: checking whether getopt is declared
configure:5795: result: yes
configure:5805: checking whether vasprintf is declared
configure:5805: result: yes
configure:5816: checking whether clearerr_unlocked is declared
configure:5816: result: yes
configure:5826: checking whether feof_unlocked is declared
configure:5826: result: yes
configure:5836: checking whether ferror_unlocked is declared
configure:5836: result: yes
configure:5846: checking whether fflush_unlocked is declared
configure:5846: result: yes
configure:5856: checking whether fgetc_unlocked is declared
configure:5856: result: yes
configure:5866: checking whether fgets_unlocked is declared
configure:5866: result: yes
configure:5876: checking whether fileno_unlocked is declared
configure:5876: result: yes
configure:5886: checking whether fprintf_unlocked is declared
configure:5886: result: no
configure:5896: checking whether fputc_unlocked is declared
configure:5896: result: yes
configure:5906: checking whether fputs_unlocked is declared
configure:5906: result: yes
configure:5916: checking whether fread_unlocked is declared
configure:5916: result: yes
configure:5926: checking whether fwrite_unlocked is declared
configure:5926: result: yes
configure:5936: checking whether getchar_unlocked is declared
configure:5936: result: yes
configure:5946: checking whether getc_unlocked is declared
configure:5946: result: yes

#4


楼主是按照那个帖子所述的gcc降级方法吗?没成功?