gcc
在 CentOS 6.2+ 的系统上安装4.7.x/4.8.x的最简单方法是什么?默认的 RPM 包包含旧版本的gcc
.
ck_*_*ck_ 68
centos.org 的 Tru Huynh为 centos构建了redhat 开发者工具集 1.1,其中包含 gcc 4.7.2
所以你可以简单地使用他的 repo 并立即安装 gcc。
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++
Run Code Online (Sandbox Code Playgroud)
这将很可能将其安装到 /opt/centos/devtoolset-1.1/root/usr/bin/
然后你可以告诉你的编译过程使用 gcc 4.7 而不是 4.4 和 CC 变量
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++
Run Code Online (Sandbox Code Playgroud)
Mar*_*ata 43
以下是如何获取 devtoolset-2(包括 gcc 4.8.1)
这是摘自http://people.centos.org/tru/devtools-2/readme
wget http://people.centos.org/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++
Run Code Online (Sandbox Code Playgroud)
已知的问题:
devtools-1.1 的主要变化:
/opt/centos
不再使用/opt/rh
现在用作上游(作为 SL 版本)小智 29
有新版本的 devtoolset 2.0。来自 Cern 从事 Scientific Linux 工作的好人创建了一个开放版本:
如果您使用 CentOS(而不是 Scientific Linux),那么您必须使用以下命令从这里导入他们的 GPG 密钥:
rpm --import http://www.scientificlinux.org/documentation/gpg/RPM-GPG-KEY-cern
Run Code Online (Sandbox Code Playgroud)
享受!
Den*_*sov 21
# 1. Install a package with repository for your system:
# RHEL 6: `yum-config-manager --enable rhel-server-rhscl-6-rpmss`
# RHEL 7: `yum-config-manager --enable rhel-server-rhscl-7-rpms`
$ sudo yum install centos-release-scl # On CentOS 6/7+, install package centos-release-scl available in CentOS repository
# 2. Install the collection:
$ sudo yum install devtoolset-3
# 3. Start using software collections:
$ scl enable devtoolset-3 bash
$ sudo yum list devtoolset-3\*
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
210216 次 |
最近记录: |