-
Notifications
You must be signed in to change notification settings - Fork 0
/
fix-wheels.sh
executable file
·47 lines (35 loc) · 1.38 KB
/
fix-wheels.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
set -x
# Install a system package required by our library
yum install -y wget libicu libicu-devel
CURRDIR=$(pwd)
# Build Boost staticly
mkdir -p boost_build
cd boost_build
wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz
tar xzf boost_1_65_1.tar.gz
cd boost_1_65_1
./bootstrap.sh --with-libraries=serialization,filesystem,thread,system,atomic,date_time,timer,chrono,program_options,regex
./b2 -j$(nproc) cxxflags="-fPIC" runtime-link=static variant=release link=static install
cd $CURRDIR
git clone https://github.com/ProfFan/gtsam.git -b feature/python_packaging
ORIGPATH=$PATH
PYTHON_LIBRARY=$(cd $(dirname $0); pwd)/libpython-not-needed-symbols-exported-by-interpreter
touch ${PYTHON_LIBRARY}
# FIX auditwheel
# https://github.com/pypa/auditwheel/issues/136
cd /opt/_internal/cpython-3.7.5/lib/python3.7/site-packages/auditwheel/
patch -p2 < /io/auditwheel.txt
cd $CURRDIR
mkdir -p /io/wheelhouse
# TODO: Build BOOST
# https://thomastrapp.com/blog/building-a-pypi-package-for-a-modern-cpp-project/
# Bundle external shared libraries into the wheels
for whl in /io/wheelhouse/*.whl; do
auditwheel repair "$whl" --plat $PLAT -w /io/wheelhouse/
done
# Install packages and test
# for PYBIN in /opt/python/*/bin/; do
# "${PYBIN}/pip" install python-manylinux-demo --no-index -f /io/wheelhouse
# (cd "$HOME"; "${PYBIN}/nosetests" pymanylinuxdemo)
# done