🌐
GitHub
github.com › NVIDIA › apex › issues › 1656
Help me, I'm dying soon,error: command '/opt/rh/devtoolset-7/root/usr/bin/gcc' failed with exit code 1 error: subprocess-exited-with-error · Issue #1656 · NVIDIA/apex
May 5, 2023 - git clone https://github.com/NVIDIA/apex cd apex pip install --global-option="--cpp_ext" --global-option="--cuda_ext" --no-cache -v --disable-pip-version-check . 2>&1 | tee build.log ... nvidia-smi:CUDA Version: 10.2 /usr/local/cuda/bin/nvcc -V :Cuda compilation tools, release 10.2, V10.2.89 · pip --default-timeout=10000 install torch==1.12.0+cu102 torchvision==0.13.0+cu102 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu102 · I also upgraded gcc: yum install centos-release-scl yum install devtoolset-7* #激活对应的devtoolset,所以你可以一次安装多个版本的devtoolset,需要的时候用下面这条命令切换到对应的版本 scl enable devtoolset-8 bash
Author   NVIDIA
🌐
GitHub
github.com › sclorg › devtoolset-container › blob › master › 7-toolchain › Dockerfile.rhel7
devtoolset-container/7-toolchain/Dockerfile.rhel7 at master · sclorg/devtoolset-container
INSTALL_PKGS="devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-gcc-gfortran devtoolset-7-gdb" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ ... PATH=/opt/app-root/src/bin:/opt/app-root/bin:/opt/rh/devtoolset-7/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Author   sclorg
🌐
GitHub
github.com › open-webrtc-toolkit › owt-server › issues › 1310
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: cannot find -lwebrtc · Issue #1310 · open-webrtc-toolkit/owt-server
February 23, 2023 - make: Entering directory /usr/owt-server-master/source/agent/webrtc/rtcFrame/build' SOLINK(target) Release/obj.target/rtcadapter.so /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux...
Author   open-webrtc-toolkit
🌐
GitHub
github.com › sclorg › devtoolset-container › blob › master › 7-toolchain › Dockerfile
devtoolset-container/7-toolchain/Dockerfile at master · sclorg/devtoolset-container
INSTALL_PKGS="devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-gcc-gfortran devtoolset-7-gdb make" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ ... PATH=/opt/app-root/src/bin:/opt/app-root/bin:/opt/rh/devtoolset-7/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Author   sclorg
🌐
GitHub
github.com › openssl › openssl › issues › 7982
Build fails on centos7 with devtoolset-7 · Issue #7982 · openssl/openssl
April 1, 2019 - $ yum install -y centos-release-scl \ $ yum-config-manager --enable rhel-server-rhscl-7-rpms $ yum install -y devtoolset-7 $ source /opt/rh/devtoolset-7/enable
Author   openssl
🌐
GitHub
github.com › sclorg › devtoolset-container › blob › master › 4-toolchain › Dockerfile.rhel7
devtoolset-container/4-toolchain/Dockerfile.rhel7 at master · sclorg/devtoolset-container
May 7, 2025 - usage="docker run -ti -v /src/app:/opt/app-root/src:z rhscl/devtoolset-4-toolchain-rhel7 bash" · RUN yum install -y yum-utils && \ yum-config-manager --disable \* &> /dev/null && \ yum-config-manager --enable rhel-server-rhscl-7-rpms && \ yum-config-manager --enable rhel-7-server-rpms && \ yum-config-manager --enable rhel-7-server-optional-rpms && \ INSTALL_PKGS="devtoolset-4-gcc devtoolset-4-gcc-c++ devtoolset-4-gcc-gfortran devtoolset-4-gdb" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ yum -y clean all --enablerepo='*' ·
Author   sclorg
🌐
GitHub
github.com › ceph › ceph › pull › 27183
rpm: s/devtoolset-7/devtoolset-8/ by tchaikov · Pull Request #27183 · ceph/ceph
+ . /opt/rh/devtoolset-7/enable /var/tmp/rpm-tmp.xvVVHw: line 30: /opt/rh/devtoolset-7/enable: No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.xvVVHw (%build) Copy link · Contributor · Warning: end of file not at end of a line; newline inserted ·
Author   ceph
🌐
GitHub
github.com › lel99999 › dev_RRH7
GitHub - lel99999/dev_RRH7: Out of band R dev for RHEL7
$scl enable devtoolset-8 bash ** NOTE ** edit ~/.R/Makevars and add the following: CXX14FLAGS=-O3 -march=native -mtune=native -fPIC CXX14=/opt/rh/devtoolset-8/root/usr/bin/g++ ** NOTE ** or run within R: dotR <- file.path(Sys.getenv("HOME"), ".R") if (!file.exists(dotR)) dir.create(dotR) M <- file.path(dotR, "Makevars") if (!file.exists(M)) file.create(M) cat("\nCXX14FLAGS=-O3 -march=native -mtune=native -fPIC", "CXX14=/opt/rh/devtoolset-8/root/usr/bin/g++", # or clang++ but you may need a version postfix file = M, sep = "\n", append = TRUE) ** NOTE ** these R commands are copied from https://
Author   lel99999
🌐
Softwarecollections
softwarecollections.org › en › scls › rhscl › devtoolset-8
Developer Toolset 8 — Software Collections
On CentOS 7 and RHEL 7 you can pull the images with the following commands: $ docker pull registry.access.redhat.com/rhscl/devtoolset-8-perftools-rhel7 $ docker pull registry.access.redhat.com/rhscl/devtoolset-8-toolchain-rhel7 $ docker pull centos/devtoolset-8-perftools-centos7 $ docker pull centos/devtoolset-8-toolchain-centos7 · For more on the docker images follow the link to public source repository: https://github.com/sclorg/devtoolset-container
🌐
Red Hat
bugzilla.redhat.com › show_bug.cgi
1873882 – Should /opt/rh/devtoolset-9/enable add both 32 ...
Red Hat Bugzilla – Full Text Bug Listing · This site requires JavaScript to be enabled to function correctly, please enable it · Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla · Bug 1873882 · Privacy Contact FAQ Legal
Find elsewhere
🌐
GitHub
gist.github.com › giwa › b1fb1e44dc0a7d270881
Install g++/gcc 4.8.2 in CentOS 6.6 ref: http://qiita.com/giwa/items/28c754d8fc2936c0f6d2 · GitHub
to make native gcc use exports: 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++ i used this way to compile swoole-4.2.1 on centos 6.9 php 7.1
🌐
GitHub
gist.github.com › superzscy › ea619f881c92b8cdae8faaf782d0f031
Installing-GCC-9-on-CentOS-7.md · GitHub
yum install -y centos-release-scl yum install -y devtoolset-9 scl enable devtoolset-9 bash · If you restart the shell, it will revert to GCC 4.8.5. You can add "source /opt/rh/devtoolset-9/enable" into you bashrc file to set GCC 9 as the default.
Top answer
1 of 5
93

In your ~/.bashrc or ~/.bash_profile Simply source the "enable" script provided with the devtoolset. For example, with the Devtoolset 2, the command is:

source /opt/rh/devtoolset-2/enable

or

source scl_source enable devtoolset-2

Lot more efficient: no forkbomb, no tricky shell

2 of 5
17

An alternative of source /opt/rh/devtoolset-4/enable is

source scl_source enable devtoolset-4

The above shell script scl_source is more elegant than using a hard coded path (may be different on another machine). However scl_source does less because /opt/rh/devtoolset-4/enable uses scl_source and other stuff.

To use scl_source you may have to upgrade package scl-utils

yum update scl-utils  # old scl-utils versions miss scl_source

Quick copy-paste

echo 'source scl_source enable devtoolset-4' >> ~/.bashrc
    # Do not forget to change the version ↑

Source code for curious people

An example of scl_source source code:
https://gist.github.com/bkabrda/6435016

The scl_source installed on my Red Hat 7.1

#!/bin/bash

_scl_source_help="Usage: source scl_source <action> [<collection> ...]

Don't use this script outside of SCL scriptlets!

Options:
    -h, --help    display this help and exit"

if [ $# -eq 0 -o $1 = "-h" -o $1 = "--help" ]; then
    echo "$_scl_source_help"
    return 0
fi


if [ -z "$_recursion" ]; then
    _recursion="false"
fi
if [ -z "$_scl_scriptlet_name" ]; then
    # The only allowed action in the case of recursion is the same
    # as was the original
    _scl_scriptlet_name=$1
fi
shift 1

if [ -z "$_scl_dir" ]; then
    # No need to re-define the directory twice
    _scl_dir=/etc/scl/conf
    if [ ! -e $_scl_dir ]; then
        _scl_dir=/etc/scl/prefixes
    fi
fi

for arg in "$@"; do
    _scl_prefix_file=$_scl_dir/$arg
    _scl_prefix=`cat $_scl_prefix_file 2> /dev/null`
    if [ $? -ne 0 ]; then
        echo "Can't read $_scl_prefix_file, $arg is probably not installed."
        return 1
    fi

    # First check if the collection is already in the list
    # of collections to be enabled
    for scl in ${_scls[@]}; do
        if [ $arg == $scl ]; then
            continue 2
        fi
    done

    # Now check if the collection isn't already enabled
    /usr/bin/scl_enabled $arg > /dev/null 2> /dev/null
    if [ $? -ne 0 ]; then
        _scls+=($arg)
        _scl_prefixes+=($_scl_prefix)
    fi;
done

if [ $_recursion == "false" ]; then
    _i=0
    _recursion="true"
    while [ $_i -lt ${#_scls[@]} ]; do
        _scl_scriptlet_path="${_scl_prefixes[$_i]}/${_scls[$_i]}/${_scl_scriptlet_name}"
        source "$_scl_scriptlet_path"
        if [ $? -ne 0 ]; then
            echo "Can't source $_scl_scriptlet_name, skipping."
        else
            export X_SCLS="${_scls[$_i]} $X_SCLS"
        fi;
        _i=$(($_i+1))
    done
    _scls=()
    _scl_prefixes=()
    _scl_scriptlet_name=""
    _recursion="false"
fi
Top answer
1 of 1
1

This issue in this case is RedHat subscription channels. Though the subscription and software are free (provided you have an active subscription already), for some reason you have to make a 'special request' to RedHat as per:

https://access.redhat.com/solutions/472793

You can automate this by visiting:

https://www.redhat.com/wapps/try/RHSCL

(when logged into the support portal). This should automatically be approved after which you can attach a new subscription. Identify the pool id using:

subscription-manager list --available --all

To find the pool id:

 Subscription Name:   Software Collections and Developer Toolset
 Provides:            Red Hat Developer Tools (for RHEL Server)
                      Red Hat Developer Tools Beta (for RHEL Workstation)
                      Red Hat Software Collections Beta (for RHEL Server)
                      Red Hat Software Collections Beta (for RHEL Workstation)
                      Red Hat Software Collections (for RHEL Server)
                      Red Hat Developer Tools Beta (for RHEL Server)
                      Red Hat Developer Toolset (for RHEL Workstation)
                      Red Hat Software Collections Beta (for RHEL Client)
                      Red Hat Software Collections (for RHEL Workstation)
                      Red Hat Developer Toolset (for RHEL Server)
                      Red Hat Developer Tools (for RHEL Workstation)
                      Red Hat Software Collections (for RHEL Client) 
SKU:                 foobar 
Contract:            1234 Pool ID: XXXXXXXXXX

Then attach this and enable the newly available repos:

>subscription-manager attach --pool=XXXXXXXXXXXXXXXXXXXX
Successfully attached a subscription for: Software Collections and Developer Toolset
>subscription-manager repos --enable rhel-workstation-rhscl-7-rpms
Repository 'rhel-workstation-rhscl-7-rpms' is enabled for this system.
>subscription-manager repos --enable rhel-7-workstation-devtools-rpms
Repository 'rhel-7-workstation-devtools-rpms' is enabled for this system.

You can now install freely:

>yum update -y 
>yum install -y devtoolset-7-gcc-c++

Quite why they make you jump through so many hoops is explained by RedHat as follows:

-If you have a 2013 RHEL SKU with Standard or Premium service level, there should be no action on your part, and your subscription should have full access to RHSCL.

-If you have a 2010 or older RHEL SKU with Standard or Premium service level, you should contact Red Hat Customer Service to request the RHSCL SKU (and all related content) added to your account.

NOTE: Developer Toolset is now included as part of Red Hat Software Collections. This change was made on May 29, 2014.

As you had Red Hat Enterprise Linux Workstation, Standard subscription which is older RHEL SKU with Standard service level, you had to initiate a special request for it

🌐
PeerTube
docs.joinpeertube.org › support › doc › dependencies
Dependencies | PeerTube documentation
You need to use a more up to date version of G++ in order to run the npm run install-node-dependencies command, hence the installation of devtoolset-7. ... Later when you invoke any node command, please prefix them with CC=/opt/rh/devtoolset-7/root/usr/bin/gcc CXX=/opt/rh/devtoolset-7/root...