Skip to content

Commit

Permalink
Allow for (local) building of manylinux2014 wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfletch committed Jan 6, 2021
1 parent e70d506 commit 721a00b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
32 changes: 32 additions & 0 deletions accelerate/_build-manylinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
set -e -u -x
# Build manylinux compatible wheel files using docker...

DIRECTORY=/io/accelerate
DIST=${DIRECTORY}/manylinux-dist

function repair_wheel {
wheel="$1"
if ! auditwheel show "$wheel"; then
echo "Skipping non-platform wheel $wheel"
else
auditwheel repair "$wheel" --plat "$PLAT" -w ${DIST}
fi
}


# Install a system package required by our library
# yum install -y atlas-devel

# Compile wheels
cd ${DIRECTORY}

for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" install -r ${DIRECTORY}/dev-requirements.txt
PIP_PLATFORM=${PLAT} "${PYBIN}/pip" wheel ${DIRECTORY} --no-deps -w ${DIST}
done

# Bundle external shared libraries into the wheels
for whl in ${DIST}/*.whl; do
repair_wheel "$whl"
done
10 changes: 10 additions & 0 deletions build-manylinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/bash

docker run \
-it \
-v`pwd`:/io \
-ephemeral \
-ePLAT=manylinux2014_x86_64 \
--rm \
quay.io/pypa/manylinux2014_x86_64 \
/io/accelerate/_build-manylinux.sh

0 comments on commit 721a00b

Please sign in to comment.