Skip to content

Commit

Permalink
generalize build script
Browse files Browse the repository at this point in the history
  • Loading branch information
bjia56 authored Dec 21, 2024
1 parent ea98b86 commit c1b3bdf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/numpy/Dockerfile.stage2
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN mkdir /numpy
WORKDIR /numpy
RUN select_python ${PYTHON_VERSION}
RUN pip3 install setuptools==49.2.0
RUN export OPENBLAS=/tmp/vendor && /repo/armv7l_build_wheels.sh ${PYTHON_VERSION} ${VERSION}
RUN export OPENBLAS=/tmp/vendor && /repo/armv7l_build_wheels.sh numpy ${PYTHON_VERSION} ${VERSION}

RUN mkdir -p ${OUTPUT_DIR} && \
cp build${PYTHON_VERSION}/wheelhouse/numpy*manylinux*armv7l.whl ${OUTPUT_DIR}
35 changes: 19 additions & 16 deletions packages/numpy/armv7l_build_wheels.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
#!/bin/bash

PYTHON3_VERSION=$1
PACKAGE_VERSION=$2
PACKAGE=$1
PYTHON3_VERSION=$2
PACKAGE_VERSION=$3

set -e

WORKDIR=$(pwd)
select_python $PYTHON3_VERSION
mkdir build${PYTHON3_VERSION}

build_wheel() (
PY_VER=$1
VER=$2
mkdir build$PY_VER
cd build$PY_VER
pip$PY_VER wheel --no-deps numpy==$VER
cd ${WORKDIR}
cd build${PYTHON3_VERSION}
pip3 wheel --no-deps ${PACKAGE}==${PACKAGE_VERSION}
)

test_wheel() (
PY_VER=$1
cd build$PY_VER
pip$PY_VER install wheelhouse/numpy*manylinux*armv7l.whl
python$PY_VER -c "import numpy; print(numpy)"
cd ${WORKDIR}
cd build${PYTHON3_VERSION}
pip3 install wheelhouse/${PACKAGE}*manylinux*armv7l.whl
python3 -c "import ${PACKAGE}; print(${PACKAGE})"
)

repair_wheel() (
PY_VER=$1
cd build$PY_VER
cd ${WORKDIR}
cd build${PYTHON3_VERSION}
auditwheel repair numpy*armv7l.whl
)

build_wheel $PYTHON3_VERSION $PACKAGE_VERSION
repair_wheel $PYTHON3_VERSION
test_wheel $PYTHON3_VERSION
build_wheel
repair_wheel
test_wheel

0 comments on commit c1b3bdf

Please sign in to comment.