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 OverflowDevtoolset is a game changer for C++ development on Linux
what is devtoolset ?
More on reddit.comlinux - How to upgrade glibc from version 2.12 to 2.14 on CentOS? - Stack Overflow
Can't install any packages on RHEL because of dependencies - Unix & Linux Stack Exchange
c++ - Dealing With GLIBC Versions - Stack Overflow
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!
what is devtoolset ?
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
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
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"
You should be installing the gcc package from
slc6-os.repo or slc6-updates.repo
Then the dependancies will be provided from there too rather than using the devtoolset version.
Yum Repositories Entries
/etc/yum.repos.d/slc6-os.repo
/etc/yum.repos.d/slc6-updates.repo
/etc/yum.repos.d/slc6-extras.repo
Installation instructions
Location:
slc6-os.repo
slc6-updates.repo
slc6-extras.repo
Import the GPG key:
rpm --import http://linuxsoft.cern.ch/cern/slc6X/x86_64/RPM-GPG-KEY-cern
glibc-devel should be part of the base repo, you may have a some conflicts with your repos.
try disabling all the extra repos you added and try again.
You should also check yum Priorities plug-in which can prevent a 3rd party repository from replacing base packages, or prevent base/updates from replacing a 3rd party package.