|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# This shall be run on manylinux2014_x86_64 to create test data for gepetto_example_adder |
| 4 | + |
| 5 | +# Stop at any error, show all commands |
| 6 | +set -exuo pipefail |
| 7 | + |
| 8 | +OUTPUT_DIR=$(dirname $0) |
| 9 | + |
| 10 | +#mkdir /root/maketest |
| 11 | +cd /root/maketest |
| 12 | + |
| 13 | +# Install ninja |
| 14 | +PY38_BIN=/opt/python/cp38-cp38/bin |
| 15 | +$PY38_BIN/pip install ninja |
| 16 | +ln -sf $PY38_BIN/ninja /usr/local/bin/ |
| 17 | +ln -sf $PY38_BIN/wheel /usr/local/bin/ |
| 18 | + |
| 19 | +# build boost |
| 20 | +curl -fsSLO https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2 |
| 21 | +tar -xf boost_1_72_0.tar.bz2 |
| 22 | +pushd boost_1_72_0 |
| 23 | +./bootstrap.sh --prefix=/usr/local |
| 24 | +sed -i 's/using python.*/python_config/g' project-config.jam |
| 25 | +sed -i 's&python_config&python_config\n using python : 3.9 : /opt/python/cp39-cp39/bin/python : /opt/python/cp39-cp39/include/python3.9 : /opt/python/cp39-cp39/lib ;&g' project-config.jam |
| 26 | +sed -i 's&python_config&python_config\n using python : 3.8 : /opt/python/cp38-cp38/bin/python : /opt/python/cp38-cp38/include/python3.8 : /opt/python/cp38-cp38/lib ;&g' project-config.jam |
| 27 | +sed -i 's&python_config&python_config\n using python : 3.7 : /opt/python/cp37-cp37m/bin/python : /opt/python/cp37-cp37m/include/python3.7m : /opt/python/cp37-cp37m/lib ;&g' project-config.jam |
| 28 | +sed -i 's&python_config&python_config\n using python : 3.6 : /opt/python/cp36-cp36m/bin/python : /opt/python/cp36-cp36m/include/python3.6m : /opt/python/cp36-cp36m/lib ;&g' project-config.jam |
| 29 | +sed -i 's/python_config//g' project-config.jam |
| 30 | + |
| 31 | +./b2 install link=shared python=3.6,3.7,3.8,3.9 --with-python --with-test -j"$(nproc)" |
| 32 | +popd |
| 33 | + |
| 34 | +# build example-adder |
| 35 | +git clone --recursive https://github.com/Ozon2/example-adder.git |
| 36 | +pushd example-adder |
| 37 | +git checkout d319dae3849b9dc3161b2b6cbafa9e45204dcc14 |
| 38 | + |
| 39 | +for PYBIN in /opt/python/{cp36*,cp37*,cp38*,cp39*}/bin; do |
| 40 | + rm -rf _skbuild/ |
| 41 | + "$PYBIN"/pip install --upgrade pip |
| 42 | + "$PYBIN"/pip install scikit-build |
| 43 | + "$PYBIN"/python setup.py bdist_wheel |
| 44 | +done |
| 45 | +popd |
| 46 | + |
| 47 | +# strip/compress dependencies |
| 48 | +for PYVER in 36 37 38 39; do |
| 49 | + strip --strip-unneeded /usr/local/lib/libboost_python${PYVER}.so.1.72.0 |
| 50 | + xz -z -c -e /usr/local/lib/libboost_python${PYVER}.so.1.72.0 > ${OUTPUT_DIR}/libboost_python${PYVER}.so.1.72.0.xz |
| 51 | +done |
| 52 | +strip --strip-unneeded example-adder/_skbuild/linux-x86_64-3.9/cmake-build/libexample-adder.so.3.0.2-6-gd319 |
| 53 | +xz -z -c -e example-adder/_skbuild/linux-x86_64-3.9/cmake-build/libexample-adder.so.3.0.2-6-gd319 > ${OUTPUT_DIR}/libexample-adder.so.3.0.2-6-gd319.xz |
| 54 | + |
| 55 | +# copy wheels |
| 56 | +cp example-adder/dist/* ${OUTPUT_DIR}/ |
0 commit comments