This is not a bug, but the feature! :) RH DevToolset is not just an alternative compiler built on the side. It's libstdc++ is an LD script. The new C++11 (and above) symbols in your binary would be resolved via static library (built specially and shipped w/ DTS). However, old symbols (existed in the OS's shipped libstdc++) going to be resolved dynamically. That is why ldd shows you libstdc++ from the /usr/lib64! Also, it has Old C++ ABI by default... to make your modern C++ code compatible w/ old libstdc++ DSO.

This feature allows you to use modern C++ standards, and produce a binary which can be executed in the original OS (CentOS/RHEL) w/o any additional "redistributable" shared libraries.

JFYI, if you use strip, make sure you use it from DTS and not the "native" one (shipped in binutils from the OS)! Otherwise, really bad things can happen.

Answer from zaufi on Stack Overflow
🌐
CMake Discourse
discourse.cmake.org › usage
Can CMake automatically detect RH devtoolset-7? - Usage - CMake Discourse
June 4, 2021 - I am building on Centos 7, which natively has gcc 4.8.5, using CMake 3.16.6 and Ninja. My code requires gcc 7 so I specify RH devtoolset-7: -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/g++ My code checks the compiler version as follows: if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.4.0) message(FATAL_ERROR "g++ (GCC) version must be at least 5.4.0 (detected ${CMAKE_CXX_COMPILER_VERSION}). If on Centos 7, have you enabled Red...
🌐
GitHub
github.com › microsoft › vscode-cmake-tools › issues › 702
CMT not providing chosen compilerPath to cpptools · Issue #702 · microsoft/vscode-cmake-tools
June 25, 2019 - export CXX="/opt/rh/devtoolset-7/root/usr/bin/g++" export CC="/opt/rh/devtoolset-7/root/usr/bin/gcc" ... # Show compiler path message(STATUS "Compiler path: " ${CMAKE_CXX_COMPILER}) [cmake] Compiler path: /opt/rh/devtoolset-7/root/usr/bin/g++ [cmake] Configuring done
Author   microsoft
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360004312319-enable-scl-devtoolset
enable scl devtoolset – IDEs Support (IntelliJ Platform) | JetBrains
For your information the only thing devtoolset is doing for you is providing a newer version for C/C++ Compiler and other tools like CMake, Make, etc.
🌐
CMake
cmake.org › pipermail › cmake › 2019-June › 069646.html
[CMake] How to specify Redhat Developer Toolset compiler?
July 18, 2019 - 20 juin 2019 à 17:39, David Aldrich ... (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36) > > I have a very simple CMakeLists.txt: > > cmake_minimum_required(VERSION 3.5 FATAL_ERROR) > project(hello_world LANGUAGES CXX) > > add_executable(hello_world "") > > target_sources(hello_world > PRIVATE > main.cpp > Message.hpp > Message.cpp) > > I also have Redhat Developer Toolset 7 installed which I can enable in my > bash shell: > > $ scl enable devtoolset-7 bash > $ ...
🌐
Readthedocs
cath-tools.readthedocs.io › en › latest › build
Build - cath-tools - Read the Docs
yum install bzip2-devel cmake git yum install centos-release-scl-rh yum install devtoolset-3-gcc devtoolset-3-gcc-c++
🌐
Bits and Dragons
bitsanddragons.wordpress.com › 2017 › 07 › 06 › install-simple-2-5-therefore-cmake-3-8-and-gcc-4-9-2-on-cent-os-7
Install Simple-2.5 (therefore cmake-3.8 and gcc-4.9.2) on Cent OS 7 | Bits and Dragons
March 7, 2018 - yum install centos-release-scl-rh yum install devtoolset-3-gcc devtoolset-3-gcc-c++ yum install devtoolset-3-gcc-gfortran scl enable devtoolset-3 bash gcc --version gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6) gfortran --version GNU Fortran (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6 · We got it! Now back to “simple”! I open a new shell, load my module, load my devtoolset (note that the order is important) and try to cmake it…
Find elsewhere
🌐
The Mail Archive
mail-archive.com › cmake@cmake.org › msg60951.html
Re: [CMake] How to specify Redhat Developer Toolset compiler?
June 20, 2019 - You could set the environment variables ... > (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36) > > I have a very simple CMakeLists.txt: > > cmake_minimum_required(VERSION 3.5 FATAL_ERROR) project(hello_world > LANGUAGES CXX) > > add_executable(hello_world "") > > target_sources(hello_world > PRIVATE > main.cpp > Message.hpp > Message.cpp) > > I also have Redhat Developer Toolset 7 installed which I can enable in > my bash shell: > > $ scl enable devtoolset-7 bash > $ ...
🌐
Nasa
seadas.gsfc.nasa.gov › build_ocssw › rhel
NASA Ocean Color - SeaDAS
Install cmake 3.11 (the binaries from CMake work fine) Get a newer compiler. This gives us gcc-9.3.1 · yum install centos-release-scl yum install devtoolset-9 yum install bison flex zlib-devel.x86_64 libX11-devel.x86_64 patch scl enable devtoolset-9 bash yum install python3 pip3 install requests ·
🌐
CMake
cmake.org › pipermail › cmake › 2018-April › 067347.html
[CMake] How to build CMake so it works on an older Linux?
April 5, 2018 - Building cmake in docker: cd /root; curl -L -O https://cmake.org/files/v3.11/cmake-3.11.0.tar.gz; tar xzvf cmake-3.11.0.tar.gz; yum install -y centos-release-scl; yum install -y devtoolset-6-gcc devtoolset-6-gcc-c++ devtoolset-6-libquadmath-devel devtoolset-6-gcc-gfortran; source /opt/rh/devtoolset-6/enable; cd cmake-3.11.0; ./bootstrap --prefix=/root/cmake --parallel=4; make -j4; make install; cd /root; tar czvf cmake.tgz; Please note that cmake will silently ignore features for packages that haven't been installed into the image, (ncurses, curl).
🌐
Stack Overflow
stackoverflow.com › questions › 44447412 › how-to-use-a-new-g-compiler-to-link-to-and-old-libstdc
c++ - How to use a new G++ compiler to link to and old libstdc++ - Stack Overflow
June 9, 2017 - The devtoolset-3 that is provided by Red Hat installs the new GCC under : ... I would like to use the new compiler, GCC 4.9.2 to compile my code but the binary has to work on a "vanilla" RHEL 6.7 installation so I am trying to link the binary with the standard libraries shipped with this version of RHEL, that come from GCC 4.4.7 (libstdc++.so.6.0.13). ... set(CMAKE_C_COMPILER "/opt/rh/devtoolset-3/root/usr/bin/cc") set(CMAKE_CXX_COMPILER "/opt/rh/devtoolset-3/root/usr/bin/c++")
🌐
Stack Overflow
stackoverflow.com › questions › tagged › devtoolset
Newest 'devtoolset' Questions - Stack Overflow
/usr/bin/cmake -E cmake_link_script ... -Wall -D CMAKE_COMPILE -L /usr/... ... I'd like to use devtoolset-11 on Centos Stream 8, but can't find any information on whether the Software Collection repositories are available for Centos Stream. The usual dnf install centos-release-... ... I am using Centos 7 with kernel 3.10.0 My current gcc version is ...
🌐
Mantidproject
developer.mantidproject.org › BuildingWithCMake.html
Building with CMake — MantidProject main documentation
Please note that the executable is called cmake3 on Red Hat 7 / CentOS7. On Red Hat 7 / CentOS7 mantid uses devtoolset-7. This means that you need to wrap your initial cmake command as scl enable devtoolset-7 "cmake3 /path/to/source".
🌐
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 build]# rm -R * [srv@local build]# cmake3 ../ -- The C compiler identification is GNU 7.3.1 -- The CXX compiler identification is GNU 7.3.1 -- Check for working C compiler: /opt/rh/devtoolset-7/root/usr/bin/cc -- Check for working C compiler: /opt/rh/devtoolset-7/root/usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /opt/rh/devtoolset-7/root/usr/bin/c++ -- Check for working CXX compiler: /opt/rh/devtoolset-7/root/usr/bin/c++ -- works -
🌐
CMake
cmake.org › cmake › help › latest › variable › CMAKE_GENERATOR_TOOLSET.html
CMAKE_GENERATOR_TOOLSET — CMake 4.4.0-rc2 Documentation
Native build system toolset specification provided by user · Some CMake generators support a toolset specification to tell the native build system how to choose a compiler. If the user specifies a toolset (e.g. via the cmake -T option or via the CMAKE_GENERATOR_TOOLSET environment variable) ...
🌐
CMake
cmake.org › cmake › help › latest › manual › cmake-toolchains.7.html
cmake-toolchains(7) — CMake 4.4.0-rc2 Documentation
set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR arm) set(CMAKE_SYSROOT /home/devel/rasp-pi-rootfs) set(CMAKE_STAGING_PREFIX /home/devel/stage) set(tools /home/devel/gcc-4.7-linaro-rpi-gnueabihf) set(CMAKE_C_COMPILER ${tools}/bin/arm-linux-gnueabihf-gcc) set(CMAKE_CXX_COMPILER ${tools}/bin/arm-linux-gnueabihf-g++) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
🌐
GitHub
github.com › emmericp › MoonGen › issues › 66
CMake settings do not correctly set `g++` as the compiler for C++ files. · Issue #66 · emmericp/MoonGen
May 29, 2015 - I ran into compilation issues with MoonGen when using Scientific Linux 6 and their devtoolset-2 package for gcc, as well as pulling CMake 2.8.8 from this repo. CMake defaulted to using gcc when com...
Author   emmericp