[Distutils] PEP425 - Wheel Binary Package Compatibility

M.-A. Lemburg mal at egenix.com
Tue Oct 28 16:47:25 CET 2014


On 28.10.2014 11:13, Matthias Hafner wrote:
> Hi there,
> 
> Following up on
> https://bitbucket.org/pypa/wheel/issue/124/glibc-incompatibility.
> 
> How should we deal with incompatibility of dynamically linked libraries?
> Doing "pip wheel numpy" on a Linux 64bit machine results in , which is
> linked dynamically against the GLIBC version installed on the build
> machine.
> 
> So should the wheel be shipped with GLIBC, or the GLIBC version be
> specified in the wheel name (means to build a new wheel for each GLIBC
> version?). Also, maybe this is not the only library it is dynamically
> linked against?
> 
> Why does that work on MacOS, btw? Are all library versions fixed there for
> one version of OSX?
> 
> Thanks for putting some light into this issue.

Since OSes typically ship with older libc versions, your best bet
is to build the package on a OS release that's a few years older
than the latest version, e.g. for Ubuntu you'd use 12.04 or even 10.04
instead of 14.04.

On Linux, you can check the min required GLIBC version by looking
at the nm output of the binaries. They will have a "@@GLIBC_x.x.x"
modifier attached to the symbols loaded from the GLIBC. The
platform module has a helper function which does this for you:
https://docs.python.org/2.7/library/platform.html#platform.libc_ver

That way you can avoid many incompatibilities with libc versions.

This works on Mac OS X and other Unix-based systems as well.

You may run into library version info problems, though:
http://stackoverflow.com/questions/137773/what-does-the-no-version-information-available-error-from-linux-dynamic-linker/156387#156387
A way around this is to build on systems that don't yet include
this version information.

The alternative is static linking, but this is often not possible
or desired.

On Windows you have to use the libc versions that were used to
compile Python itself, so things are easier.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Oct 28 2014)
>>> Python Projects, Consulting and Support ...   http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ...       http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2014-10-24: Released eGenix pyOpenSSL 0.13.5 ...  http://egenix.com/go63

::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the Distutils-SIG mailing list