Skip to content
Snippets Groups Projects
Unverified Commit f67a05b9 authored by Andreas Klöckner's avatar Andreas Klöckner Committed by GitHub
Browse files

Merge pull request #270 from isuruf/wheels

Wheels: Use ocl-icd and bundle license
parents 8a4ddc0a c1890578
No related branches found
No related tags found
No related merge requests found
notifications:
email: false
if: tag IS present
matrix:
include:
- sudo: required
services:
- docker
env:
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
- sudo: required
services:
- docker
env:
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
- PRE_CMD=linux32
install:
- docker pull $DOCKER_IMAGE
script:
- pwd
- ls -la
- docker run --rm -v `pwd`:/io -e TWINE_USERNAME -e TWINE_PASSWORD $DOCKER_IMAGE $PRE_CMD /io/travis/build-wheels.sh
- ls wheelhouse/
#!/bin/bash
set -e -x
cd /io
mkdir -p deps
cd deps
yum install -y git cmake yum wget
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz
tar -xvf ruby-2.1.2.tar.gz
cd ruby-2.1.2
./configure
make -j4
make install
cd ..
rm -rf ruby-2.1.2
git clone --branch v2.2.12 https://github.com/OCL-dev/ocl-icd
cd ocl-icd
wget https://raw.githubusercontent.com/conda-forge/ocl-icd-feedstock/master/recipe/install-headers.patch --no-check-certificate
git apply install-headers.patch
autoreconf -i
chmod +x configure
./configure --prefix=/usr
make -j4
make install
cd /io
# Compile wheels
for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" install numpy pybind11 mako
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
done
# Bundle external shared libraries into the wheels
for whl in wheelhouse/pyopencl*.whl; do
auditwheel repair "$whl" -w /io/wheelhouse/
done
# Bundle license files
/opt/python/cp37-cp37m/bin/pip install delocate
/opt/python/cp37-cp37m/bin/python /io/travis/fix-wheel.py /io/deps/ocl-icd/COPYING
/opt/python/cp37-cp37m/bin/pip install twine
for WHEEL in /io/wheelhouse/pyopencl*.whl; do
# dev
# /opt/python/cp37-cp37m/bin/twine upload \
# --skip-existing \
# --repository-url https://test.pypi.org/legacy/ \
# -u "${TWINE_USERNAME}" -p "${TWINE_PASSWORD}" \
# "${WHEEL}"
# prod
/opt/python/cp37-cp37m/bin/twine upload \
--skip-existing \
-u "${TWINE_USERNAME}" -p "${TWINE_PASSWORD}" \
"${WHEEL}"
done
import sys
import os.path
import shutil
from glob import glob
from delocate import wheeltools
def add_library(paths):
wheel_fnames = glob('/io/wheelhouse/pyopencl*.whl')
for fname in wheel_fnames:
print('Processing', fname)
with wheeltools.InWheel(fname, fname):
for lib_path in paths:
shutil.copy2(lib_path, os.path.join('pyopencl', '.libs'))
def main():
args = list(sys.argv)
args.pop(0)
add_library(args)
if __name__ == '__main__':
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment