GCC安装

1.下载GCC安装包,下载地址如下,选择需要的安装版本:

https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/

2.解压配置

  进入解压目录执行:./configure

可能会遇到下面的问题:

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

需要安装 :GMP >=4.2+, MPFR >=2.4.0+ and MPC >=0.8.0+

2.1 GMP安装教程:安装gmp-6.1.2库 - 云+社区 - 腾讯云 (tencent.com)

GMP下载:https://gmplib.org/download/gmp/gmp-6.1.2.tar.xz

如果GMP ./configure 配置失败,报错如下:

                   configure: error: gmp.h cannot be found

还需要安装:yum install gmp-devel

下载地址如下:

http://mirror.centos.org/centos/7/os/x86_64/Packages/gmp-devel-6.0.0-15.el7.x86_64.rpm

2.2 MPFR下载安装:

wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-2.4.2.tar.bz2
bunzip2 mpfr-2.4.2.tar.bz2
tar xvf mpfr-2.4.2.tar
cd mpfr-2.4.2
./configure --disable-shared --enable-static --prefix=/tmp/gcc --with-gmp=/tmp/gcc
make && make check && make install

2.3 MPC下载地址:Index of /gnu/mpcicon-default.png?t=M276https://ftp.gnu.org/gnu/mpc/

Download — multiprecision.org

3. 配置并安装gcc

gcc安装参考教程:(56条消息) Centos下gcc的安装、gcc的更新、gcc安装过程中报错:make[1]: *** [stage1-bubble] 错误 2_点亮~黑夜的博客-CSDN博客_gcc make报错

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值