debian9 安装gcc8.2.0 出现问题

求助

(超重低音炮) #1

root@wzdyjn:/home/wzdyjn/wzdyjn/gcc-8.2.0# ./configure
checking build system type… x86_64-pc-linux-gnu
checking host system type… x86_64-pc-linux-gnu
checking target system type… x86_64-pc-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… gawk
checking for libatomic support… yes
checking for libitm support… yes
checking for libsanitizer support… yes
checking for libvtv support… yes
checking for libmpx support… yes
checking for libhsail-rt 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… no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
http://gcc.gnu.org/install/prerequisites.html for additional info. If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files. They may be located in separate packages.
root@wzdyjn:/home/wzdyjn/wzdyjn/gcc-8.2.0# make
make: *** 没有指明目标并且找不到 makefile。 停止。


#2

首先,完全不建议你自己编译 gcc,尤其不建议你用 root 用户自己编译。其次,你可以考虑临时添加 debian testing 的源把 gcc-8 安装上然后把 testing 的源删掉,这样的操作虽然不靠谱但比你自己编译 gcc 靠谱多了。最后,你真的有什么不装 gcc 8 就无法完成的需求吗?如果这样,建议将系统升级到 Debian Testing。


(超重低音炮) #3

非感谢,,