通过安装scl软件集,使用高版本gcc的方法-一只菜鸡-51CTO博客
source link: http://blog.51cto.com/lee90/2066799
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
通过安装scl软件集,使用高版本gcc的方法
SCL软件集(Software Collections)是为了给 RHEL/CentOS 用户提供一种以方便、安全地安装和使用应用程序和运行时环境的多个(而且可能是更新的)版本的方式,同时避免把系统搞乱。
有时候,我们需要在某些机器上编译软件(如在centos6上编译alisql),官方文档会告诉我们先安装scl软件集,然后切换到高版本的gcc下面执行编译操作。
这里,我们以centos7上编译某些版的mysql5.6为例,根据官方文档,需要先按照高版本的gcc(centos7默认的4.8版本的gcc太低了)。
安装scl源:
yum install centos-release-SCL scl-utils-build
查看从 SCL 中安装的包的列表:
scl –list
列出scl源有哪些包可以用:
yum list all --enablerepo='centos-sclo-rh'
查看从 SCL 中安装的包的列表:
scl –list
安装5.3版本的gcc、gcc-c++
yum install devtoolset-4-gcc.x86_64 devtoolset-4-gcc-c++.x86_64
切换前,我们先看下当前gcc的版本:
gcc –-version
切换到devtoolset-4环境:
scl enable devtoolset-4 bash
gcc –-version
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK