Seconding @cconvey’s question on the specific version of RHEL to be
supported. In addition, is the goal to deploy onto a specific RHEL
version, or to deploy onto a specific RHEL version without access to
root? For the former, after playing around a bit in a CentOS docker
image, installing devtoolset-*
makes it straightforward to use newer
versions of g++
.
[root@f2059d87d7b8 /]# scl enable devtoolset-11 -- g++ --version
g++ (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root@f2059d87d7b8 /]#
If deploying to locations without package installation privs, it looks
like other packages require a newer version of gcc (e.g. a 2020
thread about pytorch
not supporting gcc 4.8, which is RHEL 7’s default), but may package a
compatible libstdc++.so
for these platforms. Since RHEL 7 is still
considered production support, but is limited to gcc 4.8, I’d lean
that route rather than maintaining support for a compiler from 2013.
Unfortunately, from the page on gcc’s ABI
policy and
this stackoverflow post, while
glibc is forward compatible with newer gcc versions, newer gcc
versions cannot target an older glibc version. I did some tests
looking at the specific symbols that are used (command below if
anybody wants to run a more thorough search), crossing my fingers that
we’d get lucky and just happen to use only symbols available in older
gcc versions. But, that isn’t the case for either g++ 10.3 (my local
machine, produces libtvm_runtime.so
that requires GLIBCXX
3.4.26)
or g++ 7.5.0 (current CI version, produces libtvm_runtime.so
that
requires GLIBCXX
version 3.2.22).
nm --demangle --extern-only --dynamic --undefined-only build/libtvm_runtime.so \
| grep GLIBCXX \
| sort --version-sort --field-separator=@ --key=2
Based on RHEL version
lifetime,
the oldest production-supported RHEL version is RHEL 7, which
provides gcc 4.8, which
provides GLIBCXX
version
3.4.18.
(Apologies for the link-spam in this post, but figuring out exact
versions required enough tracking down that I wanted to record them
somewhere.)