I have been working on building Mercury for Amazon Linux 2 (AL2). AL2 has GCC, but is an older version that doesn't support C++17 standards. This requires me to install GCC10 instead:
yum install gcc10 gcc10-c++
The problem that emerges is that GCC10 for AL2 (and likely other RHEL based distros) doesn't install GCC10 as /usr/bin/gcc, but rather /usr/bin/gcc10-gcc (also applies to g++) as well.
The solution for this is to override CC, CPP, and CXX during make, however there are a handful of places in checked in Makefiles which assumes uses g++ directly rather than the CXX variable.
make CC=/usr/bin/gcc10-gcc CPP=/usr/bin/gcc10-cpp CXX=/usr/bin/gcc10-c++ V=s
Solution
I have include the patch for updating Makefiles to use the build time compiler and not static paths. Also uploaded here.
Thanks layertwo for reporting the problem and providing a fix. We applied the changes and they will show up in the next update. Please let us know if there are any more issues.
Summary
I have been working on building Mercury for Amazon Linux 2 (AL2). AL2 has GCC, but is an older version that doesn't support C++17 standards. This requires me to install GCC10 instead:
The problem that emerges is that GCC10 for AL2 (and likely other RHEL based distros) doesn't install GCC10 as
/usr/bin/gcc
, but rather/usr/bin/gcc10-gcc
(also applies tog++
) as well.The solution for this is to override
CC
,CPP
, andCXX
duringmake
, however there are a handful of places in checked in Makefiles which assumes usesg++
directly rather than theCXX
variable.Solution
I have include the patch for updating Makefiles to use the build time compiler and not static paths. Also uploaded here.
Please let me know if you have any questions.