gcc-10.1.0 编译安装

安装GCC-10.1.0

    • 工具
  • 依赖
    • 安装

工具

#工具
yum install vim
yum install wget
yum install gcc
yum install gcc-c++
#基础编译软件 
yum install m4
yum install texinfo
#编译gcc时候用到的
yum install zip

依赖

#automake 1.15
#gmp-4.3.2
#mpfr-3.1.4
#mpc-1.0.3
#下载地址
#gcc
https://ftp.gnu.org/gnu/gcc/gcc-10.1.0/gcc-10.1.0.tar.gz
#automake-1.15
wget ftp://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz
#gmp
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2
#mpfr
wget https://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2
#mpc-1.0.3
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz

#解压下载好的四个压缩包, 此处命令自行解决, 有图形化的图形化操作也可


#install automake
cd automake-1.15
./configure --prefix=/usr/local/automake-1.15
make
make install 
#rpm -e --nodeps automake
#如果有卸载老版本,没有删除/usr/bin/automake
rm -rf automake
ln -s /usr/local/automake-1.15/bin/automake /usr/bin/automake
#edit export path
echo export PATH=$PATH:/usr/local/automake-1.15/bin >> /etc/profile
echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpc-1.0.3/lib:/usr/local/gmp-4.3.2/lib:/usr/local/mpfr-3.1.4/lib >> /etc/profile

source /etc/profile

#install gmp
cd ../gmp-4.3.2
./configure  --prefix=/usr/local/gmp-4.3.2/
#install mpfr
cd  ../mpfr-3.1.4
 ./configure --prefix=/usr/local/mpfr-3.1.4/ --with-gmp=/usr/local/gmp-4.3.2/
 make 
 make install 
 
 #install mpc
cd ../mpc-1.0.3
 ./configure --prefix=/usr/local/mpc-1.0.3 --with-gmp=/usr/local/gmp-4.3.2/ --with-mpfr=/usr/local/mpfr-3.1.4/

安装

#install gcc10.1.0
 ./configure --prefix=/usr/local/gcc-6.1.0/ --enable-threads=posix --disable-checking --enable--long-long --disable-multilib --enable-languages=c,c++ --with-gmp=/usr/local/gmp-4.3.2/ --with-mpfr=/usr/local/mpfr-3.1.4/ --with-mpc=/usr/local/mpc-1.0.3/
make
make install

#add to /usr/bin

ln -s /usr/local/gcc-10.1.0/bin/gcc /usr/bin/gcc10
ln -s /usr/local/gcc-10.1.0/bin/g++ /usr/bin/g++10
#键入gcc10 --version 查看版本

你可能感兴趣的:(linux运维,基础)