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

Juan E. Sanchez juan.e.sanchez at gmail.com
Thu Apr 5 10:57:18 EDT 2018


Hello,

SHORT VERSION:

BTW, Ubuntu 12 is officially End of Life on April 28, 2017

http://releases.ubuntu.com/12.04/

So unless you are paying them for support, you should really upgrade to 
Ubuntu 14.

LONG VERSION:

I recommend starting a docker image of centos 6 in a newer version of 
Ubuntu.  This would be a virtual machine environment you can build a 
version with a newer compiler, g++, but with an older glibc.  The 
libstdc++ you link against would then be compatible with most modern 
distributions.

This is by getting the devtoolset-6 or devtoolset-7 tools provided by 
redhat.  You can communicate with me offline on how to do this, but in 
principle the installation of the compiler is this:

yum install -y centos-release-scl
yum install -y devtoolset-6-gcc devtoolset-6-gcc-c++ 
devtoolset-6-libquadmath-devel devtoolset-6-gcc-gfortran

Docker is freely available and used across the open source community to 
build for multiple linux versions.  It can be installed directly from 
ubuntu as a standard package.

You can then package the application, and it would more than likely run 
on your system.

Regards,

Juan

On 4/4/18 10:23 PM, Eric Wing 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
> 



More information about the CMake mailing list