gcc 10.2.0 源码编译安装

系统装有gcc 4.8.5 在此基础上升级至新版gcc

同时解决了7zip linux版不能使用问题,下面这是报错
./7zz: /lib64/libstdc++.so.6: version `CXXABI_1.3.8’ not found (required by 7zip/7zz)
./7zz: /lib64/libstdc++.so.6: version `CXXABI_1.3.9’ not found (required by 7zip/7zz)

这里使用阿里源
gcc gmp mpfr mpc链接如下 下载所需源码包
https://mirrors.aliyun.com/gnu/gcc
https://mirrors.aliyun.com/gnu/automake
https://mirrors.aliyun.com/gnu/gmp
https://mirrors.aliyun.com/gnu/mpfr
https://mirrors.aliyun.com/gnu/mpc

安装编译所需的依赖包

yum -y install gcc gcc-c++ m4 texinfo zip help2man libmpc-devel
yum -y install libgo-devel libffi-devel libobjc liboffloadmic libgfortran4 libgfortran
yum groupinstall "Development Tools"

先解压依次安装automake mpc mpfr gmp库

tar xf automake-1.16.3.tar.gz
cd automake-1.16.3
./configure --prefix=/usr
make -j4&& make install

tar xf gmp-6.2.1.tar.bz2
cd gmp-6.2.1/
./configure --prefix=/usr
make -j4&& make install

tar xf mpfr-4.1.0.tar.gz
cd mpfr-4.1.0/
./configure --prefix=/usr --with-gmp=/usr
make -j4&& make install

tar xf mpc-1.2.1.tar.gz
cd mpc-1.2.1/
./configure --prefix=/usr --with-gmp=/usr --with-mpfr=/usr
make -j4&& make install

tar xf isl-0.18.tar.bz2
cd isl-0.18/
./configure --prefix=/usr --with-gmp=/usr
make -j4 && make install

最后编译安装gcc 带上所需的基本参数

tar xf gcc-10.2.0.tar.gz
cd gcc-10.2.0/
./configure --prefix=/usr --enable-threads=posix --with-system-zlib --enable-languages=c,c++ --with-gmp=/usr --with-mpfr=/usr --with-mpc=/usr --disable-multilib
make -j8	#调用cpu核心数,越多速度越快
make install

查看版本信息

gcc -v

在这里插入图片描述

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值