[CMake] How to build CMake so it works on an older Linux?

suzuki toshiya mpsuzuki at hiroshima-u.ac.jp
Thu Apr 5 00:22:26 EDT 2018


Dear Bo Zhou,

Thank you for the info! Now I'm checking Ubuntu 12.04 in LXC.
So, gcc-4.8.5 or later would be needed for C++11, it seems that the last version
of gcc officially provided for Ubuntu-12 was 4.7. oh.
According to https://clang.llvm.org/cxx_status.html , clang-3.3 supports C++11,
and the last version of clang officially provided for Ubuntu-12 was 3.4. ooh.
I will check if clang-3.4 for Ubuntu-12.04 can compile cmake (or any other
dependency problems would arise).

> Usually the ABI is not the problem but the libstdc++, you can use a old Ubuntu with old libstdc++ but build CMake with new compiler and make sure it links with old libstdc++. This is the trick.

Indeed.

Regards,
mpsuzuki

Bo Zhou wrote:
> The latest CMake requires C++11 compiler, so what you need is just a newer GCC which supports C++11 at your platform, that's it.
> 
> Usually the ABI is not the problem but the libstdc++, you can use a old Ubuntu with old libstdc++ but build CMake with new compiler and make sure it links with old libstdc++. This is the trick.
> 
> I don't know how to do this on Ubuntu, but on CentOS, it's possible to build CMake in that way, so the CMake would be portable at older CentOS platform with old libstdc++ .
> 
> Good luck.
> 
> On Thu, Apr 5, 2018 at 12:23 PM, Eric Wing <ewmailing at gmail.com<mailto:ewmailing at gmail.com>> wrote:
> I just discovered that CMake no longer builds on my Ubuntu 12.04. I
> need to build binaries that are compatible with that ABI.
> 
> I see that your binary distribution of CMake 3.11 still works on
> Ubuntu 12.04. Can you tell me what you do to achieve this? What are
> you doing for your official builds?
> 
> Are you just using -static-libstdc++ -static-libgcc for
> CMAKE_CXX_FLAGS, or is there more?
> 
> (I just noticed that ldd shows that you don't have dependencies on
> libssl, libcrypto, and libz, whereas I do.)
> 
> Thanks,
> Eric
> --
> 
> Powered by www.kitware.com<http://www.kitware.com>
> 
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
> 
> 
> 



More information about the CMake mailing list