linux下如何编译安装gcc-8.3.0

Posted Jello

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux下如何编译安装gcc-8.3.0相关的知识,希望对你有一定的参考价值。

1. 获取源码

  wget https://mirrors.ustc.edu.cn/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.xz -P ~

  tar xvf gcc-8.3.0.tar.xz -C ~

  cd ~/gcc-8.3.0

2. 运行 download_prerequisites 脚本

  ./contrib/download_prerequisites

3. 创建编译目录

  mkdir build-gcc-8.3.0

  cd build-gcc-8.3.0

4. 配置

  ../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib --prefix=/home/jello/gcc  (注意替换一下红色的用户名噢)

5. 编译

  make -j4

6. 安装

  make install

以上是关于linux下如何编译安装gcc-8.3.0的主要内容,如果未能解决你的问题,请参考以下文章