您的位置:首页 > 运维架构 > Linux

centos6 yum 安装 install c++4.8 gcc4.8

2015-09-15 13:13 851 查看
cd /etc/yum.repos.d
wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo yum --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++


[/code]
This will install it most likely into
/opt/centos/devtoolset-1.1/root/usr/bin/


Then you can tell your compile process to use the gcc 4.7 instead of 4.4 with the CC variable

export CC=/opt/centos/devtoolset-1.1/root/usr/bin/gcc
export CPP=/opt/centos/devtoolset-1.1/root/usr/bin/cpp
export CXX=/opt/centos/devtoolset-1.1/root/usr/bin/c++


For g++ 4.8.2, change
1.1
to
2
everywhere, and change
--enablerepo=testing-1.1-devtools-6
to
--enablerepo=testing-devtools-2-centos-6


[/code]
There is new version of devtoolset 2.0. Nice people from Cern working on Scientific Linux createdan open version:

If you use CentOS (not Scientific Linux), then you will have to import their GPG key from here using:

rpm --import http://www.scientificlinux.org/documentation/gpg/RPM-GPG-KEY-cern

Enjoy!

EL6 gcc-4.8 http://www.hop5.in/yum/el6/repoview/gcc.html

or this

http://puias.princeton.edu/data/puias/DevToolset/6/x86_64/ /etc/yum.repos.d/DevToolset.repo

[DevToolset-2]
name=RedHat DevToolset v2 $releasever - $basearch
baseurl=http://people.centos.org/tru/devtools-2/$basearch/
enabled=1
gpgcheck=0

Testing run

# yum install devtoolset-2-gcc-4.8.2 devtoolset-2-gcc-c++-4.8.2
# /opt/rh/devtoolset-2/root/usr/bin/gcc --version

export 做好软链接

ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/
hash -r
gcc --version
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: