[CMake] Forcing linking compatability to old libc / libstdc++ (Linux)

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Thu Feb 2 20:07:29 EST 2017


Hi Gonzalo,

Using the dockcross/manylinux-x64 docker image should allow to build you
project out-of-the-box.
It is based on Centos5, include recent gcc, CMake, Git, etc ...

See https://github.com/dockcross/dockcross

In a nutshell,

# Pull image
docker pull dockcross/manylinux-x64

# Generate helper script
docker run --rm dockcross/manylinux-x64 > dockcross-manylinux-x64
chmod +x ./dockcross-manylinux-x64
mv ./dockcross-manylinux-x64 ~/bin/

# Build your project
cd /path/to/src
dockcross cmake -Bbuild -H. -GNinja


The directory build will then contain the build tree of your project
compiled using gcc provided by the Centos5 image and link against an old
glibc.

To learn more about the glibc version used in the image, see
https://www.python.org/dev/peps/pep-0513/

Hth
Jc






On Sun, Jan 29, 2017 at 4:36 PM, Alexander Neundorf <a.neundorf-work at gmx.net
> wrote:

> On 2017 M01 26, Thu 18:23:05 CET Gonzalo Garramuño wrote:
> > I currently own an Ubuntu Xenial 14.04.1 LTS box in which I do all my
> > work.    I distribute a binary image viewer.   However, recently one of
> > my users tried to run the viewer on a CentOS 7 distro and found out that
> > that distro libc and libstdc++ are older and incompatible.
> >
> > I would like to compile my program targeting the older libc and
> > libstdc++.  Those files come with symbol version and visibility. Is
> > there an easy way to do that other than copying the old libraries?
>
> you may consider using docker to provide a build environment for an "old"
> distribution (CentOS 7 is actually quite bleeding edge... ;-) )
> There are some CentOS5 images on dockerhub.
>
> Alex
>
> --
>
> Powered by 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:
> http://public.kitware.com/mailman/listinfo/cmake
>



-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170202/d9acecf7/attachment.html>


More information about the CMake mailing list