1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > CentOS6安装devtoolset(使用高版本gcc)GCC 4.8 GCC 4.9 GCC 5.2

CentOS6安装devtoolset(使用高版本gcc)GCC 4.8 GCC 4.9 GCC 5.2

时间:2021-06-02 11:49:42

相关推荐

CentOS6安装devtoolset(使用高版本gcc)GCC 4.8 GCC 4.9 GCC 5.2

CentOS6安装devtoolset(使用高版本gcc)GCC 4.8 GCC 4.9 GCC 5.2

Aria2要求gcc 4.8以上的版本才能编译,然而CentOS6源里的gcc版本才4.4

GCC 4.8

wget /tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo

yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++ -y

临时编译前使用

export CC=/opt/rh/devtoolset-2/root/usr/bin/gcc

export CPP=/opt/rh/devtoolset-2/root/usr/bin/cpp

export CXX=/opt/rh/devtoolset-2/root/usr/bin/c++

以下为替换系统GCC,不建议这样操作

ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/

hash -r

gcc --version

GCC 4.9

wget /coprs/rhscl/devtoolset-3/repo/epel-6/rhscl-devtoolset-3-epel-6.repo -O /etc/yum.repos.d/devtools-3.repo

yum install devtoolset-3-gcc devtoolset-3-binutils devtoolset-3-gcc-c++ -y

临时编译前使用

export CC=/opt/rh/devtoolset-3/root/usr/bin/gcc

export CPP=/opt/rh/devtoolset-3/root/usr/bin/cpp

export CXX=/opt/rh/devtoolset-3/root/usr/bin/c++

GCC 5.2

wget /coprs/hhorak/devtoolset-4-rebuild-bootstrap/repo/epel-6/hhorak-devtoolset-4-rebuild-bootstrap-epel-6.repo -O /etc/yum.repos.d/devtools-4.repo

yum install devtoolset-4-gcc devtoolset-4-binutils devtoolset-4-gcc-c++ -y

临时编译前使用

export CC=/opt/rh/devtoolset-4/root/usr/bin/gcc

export CPP=/opt/rh/devtoolset-4/root/usr/bin/cpp

export CXX=/opt/rh/devtoolset-4/root/usr/bin/c++

===============================================================================

另一种方法

配置yum源

# vim /etc/yum.repos.d/devtools-2.repo[testing-devtools-2-centos-$releasever]name=testing 2 devtools for CentOS $releasever# baseurl=http://puias.princeton.edu/data/puias/DevToolset/$releasever/$basearch/baseurl=/tru/devtools-2/$releasever/$basearch/RPMSgpgcheck=0

安装

# yum install devtoolset-2-gcc-4.8.1 devtoolset-2-gcc-c++-4.8.1

切换到高版本GCC

gcc -vgcc version 4.4.7 0313 (Red Hat 4.4.7-23) (GCC) scl enable devtoolset-2 bashgcc -vgcc version 4.8.1 0715 (Red Hat 4.8.1-4) (GCC)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。