Linux development environment-SCL software collection

Linux development environment-SCL software collection

1. Introduction to SCL

1. Introduction to SCL

SCL (Software Collections) is a software multi-version coexistence solution for CentOS/RHEL Linux platform. It provides RHEL/CentOS Linux users with a convenient and safe way to install and use multiple versions of applications and runtime environments. Avoid messing up the system.
The CentOS/RHEL Linux distribution is known for its stability. All software must be as stable as possible, resulting in a very low version of the basic software. For example, the gcc version of CentOS 6.7 (released in 2015) is 4.4.7 (version 2012). However, in engineering development, a higher version of GCC support is usually required, so it is necessary to deploy a higher version of GCC on the CentOS/RHEL Linux development server.
SCL project homepage: https://www.softwarecollections.org

2. CentOS source support

Download the source warehouse file Centos-7.repo to /etc/yum.repos.d:
http://mirrors.aliyun.com/repo/Centos-7.repo
Replace all $releasever in the CentOS-7.repo file with Version number 7
update warehouse:

yum clean all
yum makecache
sudo yum update

3. SCL source installation

yum install centos-release-scl scl-utils-build
CentOS6/7 install SCL source
yum-config-manager --enable rhel-server-rhscl-6-rpms
RHEL6 install SCL source
yum-config-manager --enable rhel-server-rhscl-7-rpms
RHEL7 install SCL source

4. SCL software collection view

yum list all --enablerepo='centos-sclo-rh'
Query the software collection supported by
SCL The SCL software collection contains a large number of software packages. You can choose to install the specified RPM packages or install them all.

Two, SCL use

1. View the installed SCL software collection

scl --list
Query the installed SCL software set
scl --list SCL_NAME
Query the installed RPM packages of the specified SCL software set

2. SCL software set installation

yum install SCL_NAME
Install the specified SCL software set

yum install devtoolset-7-gcc.x86_64  
devtoolset-7-gcc-c++.x86_64 devtoolset-7-gcc-gdb-plugin.x86_64

Install the specified RPM package of the SCL software set.
yum list SCL_NAME\*
Query RPM packages in the specified software set

3. Uninstall the specified SCL software set

yum remove SCL_NAME\*
Uninstall the specified SCL software set

4. Execute the application

scl enable SCL_NAME_1 SCL_NAME_2 command
Activate the SCL software set, directly execute commands without parameters

scl enable SCL_NAME_1 SCL_NAME_2 'command --argument'
scl enable SCL_NAME_1 SCL_NAME_2 "command --argument"
scl enable SCL_NAME_1 SCL_NAME_2 -- command --argument

Activate SCL software set, execute command with parameters

scl enable devtoolset-7 "gcc --version"
scl enable devtoolset-7 -- gcc --version

Activate the devtoolset-7 software set, check the gcc version

5. Create SCL software collection Shell environment

scl enable SCL_NAME_1 SCL_NAME_2 bash
Create a new shell in the current shell environment and activate one or more SCLs.
echo $X_SCLS
View the activated SCL in the SCL shell environment.
exit
Exit the SCL software set. Shell environment.
scl enable devtoolset-7 bash
Create a bash environment for the devtoolset-7 software set.

6. Batch execute commands in files

cat cmd_file | scl enable SCL_NAME_1 SCL_NAME_2 -
Execute commands in file

7. Activate the SCL software set

source /opt/rh/SCL_NAME/enable
Activate the specified SCL software set in the current Shell

Three, SCL commonly used software collection

1、Developer Toolset

Developer Toolset is a set of development tools designed for developers of CentOS and REHL Linux platforms. It provides different versions of GCC toolset, GNU Debugger and other development, debugging, and performance testing tools.
Developer Toolset 3, Developer Toolset 4, and Developer Toolset 6 are obsolete.
Developer Toolset 7 corresponds to GCC 7 version
yum install devtoolset-7
Developer Toolset 8 corresponds to GCC 8 version
yum install devtoolset-8
CentOS7/RHEL7 The Docker container support of Developer Toolset 7 in the system is as follows:

docker pull 
registry.access.redhat.com/rhscl/devtoolset-7-perftools-rhel7
docker pull 
registry.access.redhat.com/rhscl/devtoolset-7-toolchain-rhel7
docker pull centos/devtoolset-7-perftools-centos7
docker pull centos/devtoolset-7-toolchain-centos7

2、Clang and LLVM Toolset

Clang and LLVM Toolset is a set of development tools designed for CentOS and REHL Linux platform developers, providing LLVM compiler infrastructure, C/C++ language Clang compiler, LLDB debugger, and code analysis related tools.
yum install llvm-toolset-7.0
Install Clang and LLVM Toolset to
scl enable llvm-toolset-7.0 bash
activate Clang and LLVM Toolset and create a shell

docker pull 
registry.access.redhat.com/devtools/llvm-toolset-7.0-rhel7

Docker image download of Clang and LLVM Toolset in RHEL7

3、Go Toolset

Go Toolset is a set of development tools designed for developers of CentOS and REHL Linux platforms, providing Golang programming language libraries and tools.
yum install go-toolset-7
Install Go Toolset to
scl enable go-toolset-7 bash
activate Go Toolset and create a shell environment

docker pull 
registry.access.redhat.com/devtools/go-toolset-7-rhel7

Docker image download of Go Toolset in RHEL7

4. Python software set

In SCL, the Python software set includes five versions: Python27, Python33, Python34, Python35, and Python36. The corresponding SCL software set names are python27, python33, rh-python34, rh-python35, and rh-python36.
rh-python36 includes Python3.6 interpreter, Web programming extension library, mod_wsgi, PostgreSQL database interface library, numpy, scipy.
yum install rh-python36
Install rh-python36 to
scl enable rh-python36 bash
activate rh-python36 and create a Shell environment

5. Redis software set

The Redis software set has two versions, Redis3.2 and Redis5.0, and the SCL names are rh-redis32 and rh-redis5 respectively.
yum install rh-redis5
Install rh-redis5 to
scl enable rh-redis5 bash
activate rh-redis5 and create a Shell environment to
service rh-redis5-redis start
start rh-redis5 service

6、MySQL

The MySQL software set has four versions: MySQL5.5, MySQL5.6, MySQL5.7, and MySQL8.0. The SCL names are rh-mysql55, rh-mysql56, rh-mysql57, and rh-mysql80.
yum install rh-mysql80
Install rh-mysql80 to
scl enable rh-mysql80 bash
activate rh-mysql80 and create a Shell environment to
systemctl start rh-mysql80-mysqld
start the MySQL database service

Four, multi-version GCC deployment

1. GCC 7.3 deployment

yum install devtoolset-7
Install Developer ToolSet 7 software set to
scl enable devtoolset-7 bash
activate Developer Toolset 7 software set, and create a Shell

2. GCC 8.3 deployment

yum install devtoolset-8
Install the Developer Toolset 8 software set to
scl enable devtoolset-8 bash
activate the Developer Toolset 8 software set and create a Shell environment

Five, multi-version Python deployment

1. Python2.7 deployment

sudo yum install python27
Install the SCL Python3 software package to
scl enable python27 bash
open the Python2.7 Shell session environment
python --version
Python version view

2. Python 3.6 deployment

sudo yum install rh-python36
Install the SCL Python3 software package to
scl enable rh-python36 bash
open the Python3 Shell session environment
python --version
Python version view

Guess you like

Origin blog.51cto.com/9291927/2543592