Tools to generate precompiled python wheels for pplpy and it's dependencies

Jonas Weinz c9551b558e changed gmpy default version 1 year ago
pplpy_wheel_deps 20cffaefb1 v0.2 2 years ago
.gitignore 2e387e417b Initial commit 2 years ago c9551b558e changed gmpy default version 1 year ago
gmpy.patch 20cffaefb1 v0.2 2 years ago
pplpy.patch 20cffaefb1 v0.2 2 years ago c7c21e6f6f fixed typo in variable export 1 year ago c9551b558e changed gmpy default version 1 year ago ed016f1ae7 enable python unicode support for custom build environments 1 year ago


the script generates three precompiled wheels:

  • One for pplpy
  • One containing the libraries pplpy depends on
  • One for gmpy2

Currently it only runs on debian and redhat/fedora based distributions because it's using apt and dnf to install the build dependencies (but porting this to other distros should be easy)


  • just a fresh Ubuntu or Fedora installation


  • Precompiled wheels for the amd64 architecture (linux) and the builder script itself can be found in the release section

How to use the script

  • download this script by cloning this repo
  • change to the scripts directory and run
  • The generated wheels can be found in the generated_wheels folder

installing the wheels

  • make sure cython and cysignals are installed:
  pip3 install cython cysignals --user
  • or system wide with

    sudo -H pip3 install cython cysignals 
  • run

  pip3 install *.whl --user
  • or system wide:

    sudo -H pip3 install *.whl
  • NOTE: you have to adjust your LD_LIBRARY_PATH otherwise the installed libraries are not found at runtime. To do this add the line

  export LD_LIBRARY_PATH=~/.local/lib/:$LD_LIBRARY_PATH
  • or if the packages are installed system wide:

    export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH

at the end of your ~/.bashrc (or your .zshrc or whatever fancy shell you use)

Running the script for different python versions

the script creates a virtual environment for a given python version (full version number!) in ~/envs and generates the wheels using that python environment. Usage:

  • e.g.: for python2.7.15:
  ./ 2.7.15

NOTE: virtualenv has to be installed before (using your favourite package manager)

overwritable system variables:

name default value notes
GMP_VERSION gmp-6.1.0
PPL_VERSION 1.2 ignored so far, since version tags in git repo are missing (last stable is used instead)
GMPY_VERSION gmpy2-2.1a4
WHEELS_PATH ${SCRIPTPATH}/generated_wheels} folder where the generated wheels will be stored
PYTHON_ENV python3 not available when using
PYTHON_PIP pip3 not available when using
PYTHON_MAJOR_VERSION 3 only used for searching for virtualenv binary (should only be overwritten two 2 if virtualenv binary only exists as virtualenv-2, at least not the case on ubuntu and fedora)
  • so as an example: for using pplpy in version 0.6 just run
  export PPLPY_VERSION=0.6

before running or


  • if the script respondserror : _ssl.c:510: EOF occurred in violation of protocol during the installation of GMP, then there is an unpatched Bug in the hg command of mercurial (happens on Ubuntu 14.04). A workaround is either to install a newer version manually or download GMP and then compile it manually by running the following commands inside the extracted folder:
  ./configure --prefix=`realpath ~/local` --enable-cxx --enable-fat
  make -j4
  make install

then you can run the script again and it will detect that gmp is already installed

  • older Versions of Python (e.g. Python3.4) need older Versions of the libssl-header. You can install them on ubuntu with:
  sudo apt install libssl1.0-dev