如何使用 devtoolset-8-gcc 安装 gcc8
How to install gcc8 using devtoolset-8-gcc
我正在使用安装了 gcc 4.8.5 20150623 的 CentOS Linux 版本 7.3.1611。我正在寻找一种方法来安装更新版本的 gcc,特别是 8.1。我找到了以下有关如何安装 gcc v7 link 1 的站点,其中描述了如何安装 gcc v7(使用 devtoolset-7-gcc*)。我确实遵循了指南并且能够安装 gcc v7。但是,如果我遵循相同的过程,但使用 "devtoolset-8-gcc*" 而不是 return 消息状态 "No package devtoolset-8-gcc* available."。
执行了搜索并找到了一个名为 "Information for build devtoolset-8-gcc-8.1.1-4.el6" link 2 的页面,但不确定如何安装它。我相信我需要下载 rpm 源,compile/build 源,然后最后安装它。
基本上,我正在寻找一种简单的方法来安装 gcc v8,就像使用 link 1.
中描述的方法一样
提前致谢。
devtoolset-8 was only released a short while ago. The linked installation instructions may be of use. However, your question pertains to CentOS, and this does not yet appear to have been made available yet. You can see some evidence of it being build for CentOS here,但尚未针对最终版本进行更新。
您可以在 SCL 邮件列表上询问 ETA,或者等到它以最终形式出现。同时,您可以直接从 koji 下载 RPM。
要在 centos 7 上安装包括 gfortran 在内的完整工具集:
yum install centos-release-scl
yum install devtoolset-8
scl enable devtoolset-8 -- bash
启用工具:
source /opt/rh/devtoolset-8/enable
您可能希望将上面的命令放在 .bash_profile
参考:
https://unix.stackexchange.com/questions/477360/centos-7-gcc-8-installation
以下工作在 centos/rhel 7
。
- 如何安装?
# rpm -ivh http://mirror.centos.org/centos/7/extras/x86_64/Packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm
# yum install devtoolset-8
这是 http://mirror.centos.org/centos/7/extras/x86_64/Packages/ 中的 rpm
,可能需要相应地进行更新。
- 如何使用?
$ scl enable devtoolset-8 bash
$ gcc --version
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
标志 -std=c++17 -lstdc++fs
和以下行可能会有帮助。
#include <experimental/filesystem>
我正在使用安装了 gcc 4.8.5 20150623 的 CentOS Linux 版本 7.3.1611。我正在寻找一种方法来安装更新版本的 gcc,特别是 8.1。我找到了以下有关如何安装 gcc v7 link 1 的站点,其中描述了如何安装 gcc v7(使用 devtoolset-7-gcc*)。我确实遵循了指南并且能够安装 gcc v7。但是,如果我遵循相同的过程,但使用 "devtoolset-8-gcc*" 而不是 return 消息状态 "No package devtoolset-8-gcc* available."。
执行了搜索并找到了一个名为 "Information for build devtoolset-8-gcc-8.1.1-4.el6" link 2 的页面,但不确定如何安装它。我相信我需要下载 rpm 源,compile/build 源,然后最后安装它。
基本上,我正在寻找一种简单的方法来安装 gcc v8,就像使用 link 1.
中描述的方法一样提前致谢。
devtoolset-8 was only released a short while ago. The linked installation instructions may be of use. However, your question pertains to CentOS, and this does not yet appear to have been made available yet. You can see some evidence of it being build for CentOS here,但尚未针对最终版本进行更新。
您可以在 SCL 邮件列表上询问 ETA,或者等到它以最终形式出现。同时,您可以直接从 koji 下载 RPM。
要在 centos 7 上安装包括 gfortran 在内的完整工具集:
yum install centos-release-scl
yum install devtoolset-8
scl enable devtoolset-8 -- bash
启用工具:
source /opt/rh/devtoolset-8/enable
您可能希望将上面的命令放在 .bash_profile
参考: https://unix.stackexchange.com/questions/477360/centos-7-gcc-8-installation
以下工作在 centos/rhel 7
。
- 如何安装?
# rpm -ivh http://mirror.centos.org/centos/7/extras/x86_64/Packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm
# yum install devtoolset-8
这是 http://mirror.centos.org/centos/7/extras/x86_64/Packages/ 中的 rpm
,可能需要相应地进行更新。
- 如何使用?
$ scl enable devtoolset-8 bash
$ gcc --version
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
标志 -std=c++17 -lstdc++fs
和以下行可能会有帮助。
#include <experimental/filesystem>