[Wheel-builders] Wheel files for PPC64le

Leonardo Bianconi leonardo.bianconi at eldorado.org.br
Fri Mar 10 14:45:40 EST 2017


So this is my proposal.
I kept the tag name the same as the one used for x86_64/i686 and the base OS as
CentOS 7. If we are thinking to converge the versions to the same on both
architectures in the future, the best way is keeping the same name.

Many parts of the PEP 513 were mentioned here, avoiding copying it, if be
necessary to duplicate the information here, please, let me know.

This is already on the draft format, but I have removed some parts that is not
important for now, and I will add it when submitting the draft (the preamble,
for example).

###############################################################################


Abstract
========

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 ``manylinux0_{ppc64le}``.


Rationale
=========

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
architectures.


The ``manylinux0`` 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 0 (``manylinux0_``). This
version will be considered a beta version, as currently it is not able to apply
the same version number used to x86_64/i686. That occurs because of the base
O.S. system, which for x86_64/i686 is CentOS 5.11 [5]_, while for ppc64le is
CentOS 7 [4]_. This beta version will be kept until both architectures be based
on the same O.S. system, i.e., CentOS 7 [4]_, when the ppc64le tag version may
be changed to converge to the manylinux baseline.


Compilation of Compliant Wheels
===============================

As compiling wheel files that meet the ``manylinux0`` 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.


Auditwheel
----------

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)``.


References
==========

.. [1] PEP 513 -- A Platform Tag for Portable Linux Built Distributions
   (https://www.python.org/dev/peps/pep-0513/)
.. [2] OpenBLAS -- An optimized BLAS library
   (http://www.openblas.net/)
.. [3] BLAS -- Basic Linear Algebra Subprograms
   (http://www.netlib.org/blas/)
.. [4] CentOS 7 Release Notes
   (https://wiki.centos.org/Manuals/ReleaseNotes/CentOS7)
.. [5] CentOS 5.11 Release Notes
   (https://wiki.centos.org/Manuals/ReleaseNotes/CentOS5.11)


###############################################################################


More information about the Wheel-builders mailing list