Developer Toolset uses a hybrid linkage model. Programs built using it use the system libstdc++ library as far as possible. Missing bits (those that were added in later C++ versions) are automatically supplied via static linking.

As a result, Developer Toolset can be used to build applications using newer GCC versions. But it cannot be used to run applications which have been built on other distributions, with newer GCC versions (assuming that is what you are trying to do).

Answer from Florian Weimer on Stack Overflow
🌐
GitHub
github.com › gliwka › centos7-devtoolset9-cmake3-python3-maven3-jdk17
GitHub - gliwka/centos7-devtoolset9-cmake3-python3-maven3-jdk17: Glibc 2.17 based toolchain allowing to build binaries that are compatible with all curently supported (not end of life) Linux distributions · GitHub
Glibc 2.17 based toolchain allowing to build binaries that are compatible with all curently supported (not end of life) Linux distributions - gliwka/centos7-devtoolset9-cmake3-python3-maven3-jdk17
Author   gliwka
Discussions

Devtoolset is a game changer for C++ development on Linux

what is devtoolset ?

More on reddit.com
🌐 r/cpp
31
20
March 23, 2018
linux - How to upgrade glibc from version 2.12 to 2.14 on CentOS? - Stack Overflow
mkdir ~/glibc_install; cd ...PATH=/opt/glibc-2.14/lib ... Sign up to request clarification or add additional context in comments. ... It says gcc 5.3.1 is too old, but it's actually too new. It's looking for gcc 3.4 or 4.x. For CentOS 6, just use the stock gcc 4.4 (as opposed to 5.3.1 from devtoolset-4... More on stackoverflow.com
🌐 stackoverflow.com
Can't install any packages on RHEL because of dependencies - Unix & Linux Stack Exchange
Error: Package: devtoolset-2-gcc-4.8.2-15.1.el6.x86_64 (slc6-devtoolset) requires: glibc-devel >= 2.2.90-12 (and other dependencies) More on unix.stackexchange.com
🌐 unix.stackexchange.com
October 20, 2014
c++ - Dealing With GLIBC Versions - Stack Overflow
You then also need to rebuild and ... your glibc. Linux really isn't designed for cross distribution binary applications 2018-06-09T06:46:25.43Z+00:00 ... The other option is to use a lowest common denominator distribution like centos and then install the dev toolset softwarecollections.org/en/scls/rhscl/devtoolset-7 i don't ... More on stackoverflow.com
🌐 stackoverflow.com
June 9, 2018
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 10 › html-single › user_guide › index
User Guide | Red Hat Developer Toolset | 10 | Red Hat Documentation
In Red Hat Developer Toolset, the GNU C++ compiler is provided by the devtoolset-10-gcc-c++ package and is automatically installed with the devtoolset-10-toolchain package as described in Section 1.5, “Installing Red Hat Developer Toolset”.
🌐
Abysm
blog.abysm.org › 2016 › 03 › installing-developer-toolset-rhel-based-distributions
Installing Developer Toolset on RHEL-based Distributions · Kuan-Yi Li's Blog
March 25, 2016 - Executables built with the Red Hat Developer Toolset toolchain can then also be deployed and run on multiple versions of Red Hat Enterprise Linux; on the other hand, executables built with self-compiled GCC often require another copy of runtime libraries to run due to GLIBC/GLIBCXX ABI incompatibility, leaves deployment complicated even for systems with identical OS version.
🌐
GitHub
github.com › CBICA › CaPTk › issues › 602
Persistent GLIBCXX or GLIBC Issues on Centos 7 CaPTk 1.7.2 · Issue #602 · CBICA/CaPTk
Hi, I had issues with GLIBCXX after installing the software, and the solution provided in the Documentation did not solve the problem. I ran: sudo yum install centos-release-scl sudo yum install devtoolset-6
Author   CBICA
🌐
Ahelpme
ahelpme.com › home › linux › centos 7 › how to install new gcc and development tools under centos 7
How to install new gcc and development tools under CentOS 7 | Any IT here? Help Me!
September 5, 2019 - [srv@local ~]# yum install devtoolset-7-gcc* Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.crazyfrogs.org * extras: centos.quelquesmots.fr * updates: centos.mirror.fr.planethoster.net centos-sclo-rh | 3.0 kB 00:00:00 centos-sclo-sclo | 2.9 kB 00:00:00 (1/2): centos-sclo-sclo/x86_64/primary_db | 281 kB 00:00:00 (2/2): centos-sclo-rh/x86_64/primary_db | 3.5 MB 00:00:03 Resolving Dependencies --> Running transaction check ---> Package devtoolset-7-gcc.x86_64 0:7.3.1-5.4.el7 will be installed --> Processing Dependency: glibc-devel >= 2.2.90-12 for package:
🌐
Reddit
reddit.com › r/cpp › devtoolset is a game changer for c++ development on linux
r/cpp on Reddit: Devtoolset is a game changer for C++ development on Linux
March 23, 2018 -

On Linux the dependency on system compilers have always been frustrating since it means your stuck with ancient GCC versions. But I must say I'm very impressed with devtoolset for RHEL/CentOS, it means you can use gcc-7 on old crappy RHEL6 that so many large companies insist on using. And you can ship the resulting binaries and it will run on plain vanilla RHEL installations!

Top answer
1 of 5
12

what is devtoolset ?

2 of 5
6

devtoolset-7 also provides newer versions of lots of supporting debug and performance tools like gdb.

They (RH or Centos) also provide containerised versions of the build tools and the performance tools.

There is also a tech preview of the llvm-toolset, admittedly at clang v4 but still able to build those compatible binaries.

Note that you want to build using a host that is lower or same version as your minimum target version.

e.g. toolset-7 on host centos v6.7 will create bins compatible with 6.7, 6.9 and 7.x If your host is say centos 7.2 toolset-7 builds are only guaranteed to be compatible with v7.2+ targets.

Redhat's documentation is really good (and you can even get a free developer login to access more resources).

Also note that Centos provides similar options to RHEL.

The only downside is I don't think you can use the new ABI variant of CXX LIB as the ABI isn't compatible with older compilers like the default Centos gcc 4

Not really a problem as you can still use the C++11/14/17 features, just a few items are incompatible (such as list::size() still being O(n) and not const time, or strings still being COW)

https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ (Lots of other tools/langs etc there too like Go,Rust,Python3 and lots of database updated versions etc.)

Not sure if you need to have a developer account, but an example of the documentation: https://access.redhat.com/documentation/en-us/red_hat_developer_toolset/7/html/7.0_release_notes/dts7.0_release

🌐
Red Hat
access.redhat.com › documentation › en-us › red_hat_developer_toolset › 11 › html-single › user_guide › index
User Guide | Red Hat Developer Toolset | 11 | Red Hat Documentation
July 19, 2023 - In Red Hat Developer Toolset, the GNU C++ compiler is provided by the devtoolset-11-gcc-c++ package and is automatically installed with the devtoolset-11-toolchain package as described in Section 1.5, “Installing Red Hat Developer Toolset”.
Find elsewhere
🌐
Centos
cbs.centos.org › koji › rpminfo
devtoolset-9-gcc-9.3.1-2.el7.x86_64.rpm | RPM Info | CentOS Community Build Service
August 5, 2021 - Main Site Links: · Summary · Packages · Builds · Tasks · Build Targets · Users · Hosts · Reports · Search
🌐
Google Groups
groups.google.com › g › llvm-dev › c › SfyjmDYKqp4
[llvm-dev] The clang for centos6 are need GLIBC_2.14, but we only have GLIB 2.12 by default.
That's makes clang/llvm won't depends on the newer version of glibc 2.14 · The instruction: vim /etc/yum.repos.d/llvm.repo · The content: ``` [sclo] name=SCLO · baseurl=http://mirror.centos.org/centos/6/sclo/x86_64/rh/ gpgcheck=0 · enabled=1 · ``` Installation step: ``` yum clean all · yum list · echo y | yum install devtoolset-4 ·
🌐
Red Hat
access.redhat.com › documentation › en-us › red_hat_developer_toolset › 9 › html-single › user_guide › index
User Guide | Red Hat Developer Toolset | 9 | Red Hat Documentation
August 7, 2020 - In Red Hat Developer Toolset, the GNU C++ compiler is provided by the devtoolset-9-gcc-c++ package and is automatically installed with the devtoolset-9-toolchain package as described in Section 1.5, “Installing Red Hat Developer Toolset”.
Top answer
1 of 4
91

You cannot update glibc on Centos 6 safely. However you can install 2.14 alongside 2.12 easily, then use it to compile projects etc. Here is how:

mkdir ~/glibc_install; cd ~/glibc_install
wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
tar zxvf glibc-2.14.tar.gz
cd glibc-2.14
mkdir build
cd build
../configure --prefix=/opt/glibc-2.14
make -j4
sudo make install
export LD_LIBRARY_PATH=/opt/glibc-2.14/lib
2 of 4
14

I found this source very useful and doesn't has much SEO. It lists the most common errors you might encounter while using @UnitasBrooks great answer and I'm afraid it gets lost in the future.

This is the link to the original post

I will copy, paste it here (I faced the last problem and it fixed it, however I didn't try all the problems/solutions listed and you try it on your own risk)


Glibc installation

The GNU C Library, commonly known as glibc, is the GNU Project's implementation of the C standard library. My environment required glibc (version 2.14) and it took a bit of fiddling to get it to work, so hopefully this will save you some time.

0.Glibc Installation Dependencies

Bash: sh
Binutils: ar, as, ld, ranlib, readelf
Diffutils: cmp
Fileutils: chmod, cp, install, ln, mknod, mv, mkdir, rm, touch
Gcc: cc, cc1, collect2, cpp, gcc
Grep: egrep, grep
Gzip: gzip
Make: make
Gawk: gawk
Sed: sed
Sh-utils: date, expr, hostname, pwd, uname
Texinfo: install-info, makeinfo
Textutils: cat, cut, sort, tr

1.Download installation package

http://www.gnu.org/software/libc/ for all versions.
http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz for version 2.14.

2.Compile and install

To avoid disturb current environment, compile and install this version separately by configuring prefix.

[root@localhost ~]# tar xvf glibc-2.14.tar.gz
[root@localhost ~]# cd glibc-2.14
[root@localhost glibc-2.14]# mkdir build
[root@localhost glibc-2.14]# cd ./build
[root@localhost build]# ../configure --prefix=/opt/glibc-2.14
[root@localhost build]# make -j4
[root@localhost build]# make install
[root@localhost build]# export LD_LIBRARY_PATH=/opt/glibc-2.14/lib:$LD_LIBRARY_PATH

3.To check glibc versions installed

root@localhost:~/intel64/runtime/glibc$ strings libc.so.6 | grep GLIBC
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_PRIVATE

4.Compiling errors

Error:

make[1]: *** No rule to make target /mnt/lfs/sourcenew/glibc-build/Versions.all', needed by/mnt/lfs/sourcenew/glibc-build/abi-versions.h'. Stop.

Solution:

sudo apt-get install gawk
sudo apt-get install texinfo

Error:

make[2]: *** [/mnt/lfs/sources/glibc-build/misc/syslog.o] Error 1

Solution:

make clean
make -j2 CFLAGS="-U_FORTIFY_SOURCE -O2 -fno-stack-protector"

Error:

/Downloads/glibc-2.14/build/elf/ldconfig: Can't open configuration file /opt/glibc-2.14/etc/ld.so.conf: No such file or directory

Solution:

:/opt/glibc-2.14/etc$ sudo sh -c "echo '/usr/local/lib' >> ld.so.conf" 
:/opt/glibc-2.14/etc$ sudo sh -c "echo '/opt/lib' >> ld.so.conf"
🌐
Ihub
bggit.ihub.org.cn › p65183970 › master › commit › f0d493d29049a3bb05ab9745a827dae5bc0047e7
Add devtoolset 8 (gcc 8) + glibc 2.26 + centos 7.5 rocm docker image (#19767) (f0d493d2) · Commits · zhanghh / 20 · GitLab
April 26, 2019 - Summary: xw285cornell Will add py3.6-devtoolset8-glibc2.26-rocmrpm-centos7.5 Pull Request resolved: https://github.com/pytorch/pytorch/pull/19767 Differential Revision: D15094446 Pulled By: bddppq fbshipit-source-id: 01a932d893cf4559f98612888308b3ad6900a038
🌐
Red Hat
access.redhat.com › documentation › en-us › red_hat_developer_toolset › 12 › html-single › user_guide › index
User Guide | Red Hat Developer Toolset | 12 | Red Hat Documentation
May 9, 2023 - In Red Hat Developer Toolset, the GNU C++ compiler is provided by the devtoolset-12-gcc-c++ package and is automatically installed with the devtoolset-12-toolchain package as described in Section 1.5, “Installing Red Hat Developer Toolset”.
Top answer
1 of 1
2

I had to rebuild the tensorflow pip package from source to make it work in CentOS 6 because there's some fundamental issue with the default pip package and which glibc was used to build it for CentOS6. Here's a memo I made of it. (Note I did this a month ago)

  1. download bazel-4.5-dist.zip and follow these steps to install, newer versions of bazel don't work as of 2017-09-04

    ~$ cd  
    ~$ wget https://github.com/bazelbuild/bazel/releases/download/0.4.5/bazel-0.4.5-dist.zip  
    ~$ cd /usr/src  
    ~$ mkdir bazel-0.4.5-dist.zip  
    ~$ cd bazel-0.4.5-dist  
    ~# mv ~/bazel-0.4.5-dist.zip ./  
    ~# unzip bazel-0.4.5-dist.zip  
    ~# ./compile.sh
    
  2. Modify ~/.bashrc to activate devtoolset-2 instead of devtoolset-6. Tensorflow will not build with newer gcc, only up to gcc 4

    in ~/.bashrc

    source /opt/rh/devtoolset-2/enable
    #source /opt/rh/devtoolset-6/enable
    
  3. Clone tensorflow into /usr/src

    ~$ cd /usr/src  
    ~# git clone https://github.com/tensorflow/tensorflow
    
  4. Configure tensorflow

    ~$ cd tensorflow  
    ~# ./configure
    

Select "No" for all support options except CUDA. Everything else should be default

  1. go to /usr/src/tensorflow/third_party/gpus/crosstool modify CROSSTOOL_clang.tpl and CROSSTOOL_nvcc.tpl add the following line to the section labeled "toolchain"

    linker_flag : "-B/opt/rh/devtoolset-2/root/usr/bin"
    
  2. Build tensorflow

    ~$ cd /usr/src/tensorflow  
    ~# bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
    
  3. Create pip package

    ~# bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
    
  4. Install custom pip package

    ~# sudo pip install /tmp/tensorflow_pkg/tensorflow-1.3.0-cp34-cp34m-linux_x86_64.whl
    
🌐
Itayemi
itayemi.com › blog › 2023 › 03 › 01 › upgrading-rhel-centos-v-7-x-to-glibc-version-2-20
Upgrading RHEL/CentOS v 7.x to GLIBC version 2.20 | Illumination
Install devtoolset-7 and/or devtoolset-8: [root@rhel77c ~]# yum install -y devtoolset-7 [root@rhel77c ~]# yum install -y devtoolset-8