<div dir="ltr">I had a similar problem on 14.04 and solved it by installing gcc 4.9 (other version are also available) from the ubuntu-toolchain-r PPA. <div><br></div><div>This worked for me. YMMV:</div><div><br></div><div><div><div>$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test<br></div></div></div><div><div>$ sudo apt-get update</div><div>$ sudo apt-get install gcc-4.9</div><div>$ sudo apt-get install g++-4.9</div></div><div><br></div><div>When building CMake I set the CXX and CC variables at the command line</div><div><br></div><div>$ CXX=g++-4.9 CC=gcc-4.9 ../path/to/bootstrap ...etc ..</div><div>
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">$ CXX=g++-4.9 CC=gcc-4.9</span> make install<br></div><div><br></div><div>HTH </div><div>Patrick</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 5, 2018 at 7:15 AM, Robert Maynard <span dir="ltr"><<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The official CMake binaries do the same thing as you and build with a<br>
static libstdc++ and libgcc.<br>
As far as dependencies we use static builds of those too, with most<br>
being the version provided inside CMake, and an external openssl.<br>
<br>
You can find the more information on the exact flags we are using at:<br>
<a href="https://gitlab.kitware.com/cmake/cmake/blob/master/Utilities/Release/linux64_release.cmake" rel="noreferrer" target="_blank">https://gitlab.kitware.com/<wbr>cmake/cmake/blob/master/<wbr>Utilities/Release/linux64_<wbr>release.cmake</a><br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, Apr 5, 2018 at 3:09 AM, Eric Wing <<a href="mailto:ewmailing@gmail.com">ewmailing@gmail.com</a>> wrote:<br>
> Thanks for the responses. Yes, I just need this to run on Ubuntu 12.04<br>
> (and some other old Linux's in that era). Yes, I think the probably is<br>
> the libstdc++ dependency.<br>
><br>
> As pointed out, it is really hard to get a newer compiler on Ubuntu<br>
> 12.04. I've been down this road before, and if memory serves, the gcc<br>
> bootstrapping process to get a newer compiler doesn't seem to work<br>
> with a compiler older than gcc 4.8. Same goes for clang, which also<br>
> weirdly relies on gcc 4.8 to bootstrap itself.<br>
><br>
> Anyway, CMake seems to already know how to ship binaries that work<br>
> across Linux distros. I'm pretty sure they just statically linked<br>
> libstdc++ and libgcc. In fact, I just built it with -static-libstdc++<br>
> -static-libgcc on a newer Linux and tested it on 12.04 and it seemed<br>
> to work.<br>
><br>
> But I wanted to know for sure how CMake is building their own binaries<br>
> in case there are subtle problems with what I did, and they have a<br>
> completely different way of building it, e.g. statically libmusl for C<br>
> and libc++ for C++, avoiding gcc entirely.<br>
><br>
> Also, I did not take care of the libssl, libcrypto, and libz<br>
> dependencies. I'm curious in practice how much trouble these are. (My<br>
> recollection with zlib is that it is extremely stable and they care a<br>
> great deal about not breaking backwards compatibility. I don't know<br>
> about the others.)<br>
><br>
> Thanks,<br>
> Eric<br>
> --<br>
><br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
><br>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
><br>
> CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/<wbr>listinfo/cmake</a><br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/<wbr>listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>