[Distutils] Wheel files for PPC64le

Leonardo Bianconi leonardo.bianconi at eldorado.org.br
Thu Mar 23 15:00:53 EDT 2017

Hi all!

I have been discussed the creation of a PEP, that describes how to create wheel
files for the PPC64le architecture on wheel-builders
(https://mail.python.org/pipermail/wheel-builders/) since January

As all discussion from that list are done, the next step is it be reviewed
here, and then create a draft on github, see it bellow:


This PEP proposes the extension of PEP 513 [1]_, which means extending the work
done for platform tag ``manylinux1_``, initially created for x86_64 and i686
systems, to work on PowerPC 64 little endian (ppc64le), making wheel files
available for this architecture. The platform tag, of this architecture for
Python package built distributions, is called ``manylinux3_{ppc64le}``.


Currently on PowerPC 64 little endian, the ``pip install`` process downloads
the module source code and builds it on the fly, to after that, install it.
This process may cause a divergence on the presence of optional libraries it
uses. One example of that is numpy, which optionally can use the OpenBlas [2]_;
or BLAS [3]_; or neither of them. For each situation the performance of the
module is affected and, badly enough, an end user is not able to know what is
causing that.

Building wheel files for the new architecture considers all work done on
PEP 513 [1]_ with some changes proposed to handle the parameters for another

The ``manylinux3`` policy

Based on PEP 513 [1]_, the policy follows the same rules and library
dependencies, but with the following versions for backward compatibility
and base Operational System:

* Backward compatibility versions:
    GLIBC <= 2.17
    CXXABI <= 1.3.7
    GLIBCXX <= 3.4.9
    GCC <= 4.8.5

* Base Operational System:
  The stock O.S. release need to be the CentOS 7 [4]_, as it is the first
  CentOS release available for PowerPC64 little endian.

The tag version for ppc64le architecture starts with 3 (``manylinux3_``), as it
is supposed to be the version to match the CentOS 7 [4]_ in the future of the
tag for x86_64/i686 architecture. There is the possibility of both tags diverge
until it reaches the version 3, then a new PEP may be create to converge
both to the manylinux baseline.

Compilation of Compliant Wheels

As compiling wheel files that meet the ``manylinux3`` standard for PowerPC64
little endian requires a specific Linux distro and version, the following tool
is provided:

Docker Image (Will be implemented when CentOS be available on Docker)

The Docker Image is based on CentOS 7 [4]_, which is the first PowerPC 64
little endian CentOS release. The Image contains all necessary tools in the
requested version to build wheel files (gcc, g++ and gfortran 4.8.5).

Machine Image

A full machine image containing all necessary software is provided for
developers until CentOS be available on Docker for ppc64le.

Cloud Service

There are Cloud Services that provide ppc64le virtual machines for development.
These machines can be used for the development of the wheel files, as
CentOS 7 [4]_ an option for O.S.. All steps to obtain a machine on it is
available for developers.


This tool is an already provided item from PEP 513 [1]_, but needs to support
the new architecture, so we propose the following changes:

1. Change the JSON file to handle more than one architecture, adding the
   compatible libraries and versions list for it.
2. Add a new filed in the JSON object to handle a list of architecture that the
   object is compatible.
3. When reading the JSON file, only consider the objects with the correspondent
   machine architecture.

Platform detection for Installers 

The platform detection is almost the same as described in PEP 513 [1]_, but
with the following proposed change:

1. Add the platform ppc64le in the platform list as a compatible one:
   [``linux-x86_64``, ``linux-i686``, ``linux-ppc64le``]
2. Add an if to switch architecture and consider the correct version of the
   GLIBC on ``return have_compatible_glibc(2, 5)``.


.. [1] PEP 513 -- A Platform Tag for Portable Linux Built Distributions
.. [2] OpenBLAS -- An optimized BLAS library
.. [3] BLAS -- Basic Linear Algebra Subprograms
.. [4] CentOS 7 Release Notes
.. [5] CentOS 5.11 Release Notes

Leonardo Bianconi.

More information about the Distutils-SIG mailing list