forked from philippkraft/cmf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a bash script to build manylinux wheels
- Loading branch information
philippkraft
committed
Jan 21, 2022
1 parent
c1ef0f0
commit c2ece32
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Explain usage if no /io directory exists (which mounts on proper docker usage the current directory) | ||
[[ -d "/io" ]] || echo "Run in manylinux container:\ndocker run -ti -v $(pwd):/io quay.io/pypa/manylinux2014_x86_64 /bin/bash /io/cmf2/tools/docker-build.sh" | ||
|
||
# This file should be used in a manylinux container to build several binaries | ||
set -e -u -x | ||
|
||
function repair_wheel { | ||
wheel="$1" | ||
if ! auditwheel show "$wheel"; then | ||
echo "Skipping non-platform wheel $wheel" | ||
else | ||
auditwheel repair "$wheel" -w /io/wheelhouse/ | ||
fi | ||
} | ||
|
||
|
||
export CFLAGS="-fPIC" | ||
export CXXFLAGS="-fPIC" | ||
export MAKEFLAGS="-j$(nproc)" | ||
|
||
CMFDIR=/io/cmf1.6 | ||
cd $CMFDIR | ||
TOOLDIR=$CMFDIR/tools | ||
|
||
# Compile wheels | ||
for PYBIN in /opt/python/cp*/bin; do | ||
"${PYBIN}/pip" install numpy | ||
"${PYBIN}/python" setup.py bdist_wheel | ||
done | ||
|
||
# Bundle external shared libraries into the wheels | ||
for whl in dist/*.whl; do | ||
repair_wheel "$whl" | ||
done |