Install scl-utils if you want the scl command. But, you will not find devtoolset-7. The most you will find scl wise is gcc-toolset-* packages, which are all newer than the provided gcc in Rocky Linux 8 and 9. If you are trying to install gcc 7 and its components, you will not be able to. It’s not s… Answer from label on forums.rockylinux.org
🌐
Softwarecollections
softwarecollections.org › en › scls › rhscl › llvm-toolset-7
Clang and LLVM Toolset 7 — Software Collections
Start using software collections: $ scl enable llvm-toolset-7 bash · At this point you should be able to use clang and other tools just as a normal application. See examples bellow: ... In order to view the individual components included in this collection, including additional development tools, you can run: ... For more on the docker images follow the link to public source repository: https://github.com/sclorg/llvm-container
🌐
Centos
buildlogs.centos.org › c7-llvm-toolset-7.0.aarch64 › llvm-toolset-7.0-clang › 20191017103542 › 7.0.1-1.el7.aarch64 › build.log
Centos
Patch #4 (0001-Driver-Add-gcc-... enable llvm-toolset-7.0 ++ _scl_source_help='Usage: source scl_source ... ...] Don'\''t use this script outside of SCL scriptlets! Options: -h, --help display this help and exit' ++ '[' 2 -eq 0 -o enable = -h -o enable = --help ']' ++ '[' -z '' ']' ++ _recursion=false ++ '[' -z '' ']' ++ _scl_scriptlet_name=enable ++ shift 1 ++ '[' -z '' ']' ++ _scl_dir=/etc/scl/conf ++ ...
Discussions

Scl enable devtoolset-7 bash on Rocky 9
I didn’t find scl or devtoolset-7 to install. How should I do? Thank you very much. More on forums.rockylinux.org
🌐 forums.rockylinux.org
16
0
March 9, 2023
How to install Clang and LLVM 3.9 on CentOS 7 - Stack Overflow
For more information about SCL, see this page. ... Sign up to request clarification or add additional context in comments. ... At this point in time Installing llvm-toolset-7 provides clang version 5.0.1 2019-02-26T00:16:08.797Z+00:00 More on stackoverflow.com
🌐 stackoverflow.com
python 2.7 - How to use scl command as a script shebang? - Stack Overflow
If I want to run a specific command (with arguments) under Software Collections, I can use this command: scl enable python27 "ls /tmp" However, if I try to make a shell script that has a similar c... More on stackoverflow.com
🌐 stackoverflow.com
linux - Can not find required gcc version after devtoolset installation - Stack Overflow
I am using Centos 7 with kernel 3.10.0 My current gcc version is 4.8.5 and I am trying to install gcc 7 or later versions. I have followed instructions from How to install GCC/G++ 8 on CentOS When ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Stack Overflow
stackoverflow.com › questions › 68203238 › enable-scl-toolset-by-default
docker - Enable scl toolset by default - Stack Overflow
July 1, 2021 - FROM rustembedded/cross:x86_64-unknown-linux-gnu RUN yum update -y && \ yum install centos-release-scl -y && \ yum install llvm-toolset-7 -y && \ yum install scl-utils -y && \ echo "source scl_source enable llvm-toolset-7" >> ~/.bash_profile
Top answer
1 of 3
3

You should try using -- instead of surrounding your command with quotes.

scl enable python27 -- ls /tmp

I was able to make a python script that uses the rh-python35 collection with this shebang:

#!/usr/bin/scl enable rh-python35 -- python

import sys
print(sys.version)
2 of 3
1

The parsing of arguments in the she-bang command is not really defined. From man execve:

The semantics of the optional-arg argument of an interpreter script vary across implementations. On Linux, the entire string following the interpreter name is passed as a single argument to the interpreter, and this string can include white space. However, behavior differs on some other systems. Some systems use the first white space to terminate optional-arg. On some systems, an interpreter script can have multiple arguments, and white spaces in optional-arg are used to delimit the arguments.

No matter what, argument splitting based on quote sis not supported. So when you write:

#!/usr/bin/scl enable python27 "ls /tmp"

It's very possible that what gets invoked is (using bash notation):

'/usr/bin/scl' 'enable' 'python27' '"ls' '/tmp"'

This is probably why it tries to open the "ls file at /etc/scl/prefixes/"ls

But it is just as likely that the shebang evaluates to:

'/usr/bin/scl' 'enable python27 "ls /tmp"'

And that would fail since it wont be able to find a command named enable python27 "ls /tmp" for scl to execute.

There's a few workarounds you can use.

You can call your script via scl:

$ cat myscript
#!/bin/bash
echo hello

$ scl enable python27 ./myscript
hello

You can also use the heredoc notation, but it might lead to subtle issues. I personally avoid this:

$ cat ./myscript
#!/bin/bash
scl enable python27 -- <<EOF
echo hi
echo \$X_SCLS
EOF

$ bash -x myscript 
+ scl enable python27 --
hi
python27

You can see one of the gotcha's already: I had to write \$X_SCLS to access the environment variable instead of just $X_SCL.

Edit: Another option is two have two scripts. One that has the actual code, and the second that simply does scl enable python27 $FIRST_SCRIPT. Then you wont have to remember to enter scl ... manually.

Find elsewhere
🌐
Softwarecollections
softwarecollections.org › en › scls › rhscl › llvm-toolset-7.0
Clang and LLVM Toolset 7.0 — Software Collections
Start using software collections: $ scl enable llvm-toolset-7.0 bash · At this point you should be able to use clang and other tools just as a normal application. See examples bellow: ... In order to view the individual components included in this collection, including additional development tools, you can run: ... For more on the docker images follow the link to public source repository: https://github.com/sclorg...
🌐
Red Hat
access.redhat.com › solutions › 3090181
Why `scl enable` command shows error "Unable to open /etc/scl/prefixes/gcc!" ? - Red Hat Customer Portal
July 21, 2017 - On installation of devtoolset-4-gcc-c++ the scl enable gcc bash gives the following error. # scl enable gcc bash Unable to open /etc/scl/prefixes/gcc!
🌐
University of Edinburgh
computing.help.inf.ed.ac.uk › scl
Software Collections | Documentation
As with the devtoolset the llvm-toolset packages are installed in an alternate location so that they can exist on a system alongside the standard versions. This means they are not in the standard path. To activate this collection you need to do something like this: ... One way would be to alias the software, but 'scl enable' uses the shell positional parameters in such a way that an alias confuses things - it looks in the "wrong" place for the name of the software collection.
🌐
GitHub
github.com › opensocsysarch › CoreGen › blob › master › README.md
CoreGen/README.md at master · opensocsysarch/CoreGen
Enable the SCL LLVM environment (this will create a fresh bash shell with the correct paths) scl enable llvm-toolset-7 devtoolset-8 bash
Author   opensocsysarch
🌐
GitHub
github.com › rust-embedded › cross › issues › 566
Permanently enable scl in centos extending from x86_64-unknown-linux-gnu · Issue #566 · cross-rs/cross
July 1, 2021 - FROM rustembedded/cross:x86_64-unknown-linux-gnu RUN yum update -y && \ yum install centos-release-scl -y && \ yum install llvm-toolset-7 -y && \ yum install scl-utils -y && \ echo "source scl_source enable llvm-toolset-7" >> ~/.bash_profile
Author   cross-rs
🌐
Red Hat
developers.redhat.com › blog › 2017 › 11 › 01 › getting-started-llvm-toolset
Getting started with llvm-toolset | Red Hat Developer
March 23, 2023 - Note that clang will use the standard libraries and linker distributed with devtoolset-7. These dependencies are automatically installed when you install llvm-toolset-7. $ scl enable llvm-toolset-7 'lldb -v' lldb version 4.0.1
🌐
GitHub
github.com › fedora-ruby › fermig › issues › 3
"Unable to open /etc/scl/prefixes/" error after running f19.rb · Issue #3 · fedora-ruby/fermig
November 26, 2014 - Fixes this error: + scl enable ruby200 ' mkdir -p ./opt/rh/ruby200/root/usr/share/gems CONFIGURE_ARGS=--with-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' ' gem install -V --local --install-dir ./opt/rh/ruby200/root ' Unable to open /etc/scl/prefixes/ mkdir -p ./opt/rh/ruby200/root/usr/share/gems
Author   fedora-ruby
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_tools › 2019.1 › html-single › using_clang_and_llvm_toolset › index
Using Clang and LLVM Toolset | Red Hat Developer Tools | 2019.1 | Red Hat Documentation
To use Clang and LLVM Toolset on Red Hat Enterprise Linux 7 without a need to use scl enable with every command, run a shell session with: ... The lldb tool is provided by the llvm-toolset-7.0-lldb package and is automatically installed with the llvm-toolset-7.0 package. See Section 1.4, “Installing Clang and LLVM Toolset”. To compile a C or C++ program with debugging information that lldb can read, make sure the compiler you use is instructed to create debug information. For instructions on suitably configuring clang, see the section Controlling Debug Information in Clang Compiler User’s Manual.
🌐
Calvin
borg.calvin.edu › resources-softwarecollections.html
Resources - Software Collections - Borg
April 18, 2024 - Replace the "devtoolset-7" with your desired software collection. In addition, multiple toolsets can be chained together in that command, for example: echo "source scl_source enable devtoolset-7 llvm-toolset-7 rh-python36" >> ~/.bashrc
🌐
Red Hat
developers.redhat.com › blog › 2018 › 07 › 07 › yum-install-gcc7-clang
How to install Clang/LLVM 5 and GCC 7 on RHEL | Red Hat Developer
November 1, 2023 - Under your normal user ID, run scl enable to add devtoolset-7 and llvm-toolset-7 to your path(s) Optional: Permanently enable GCC 7 and Clang 5 by adding scl_source to your .bashrc · $ su - # subscription-manager repos --enable rhel-7-serv...