Skip to content

Commit

Permalink
numpy: update OpenBLAS, add 3.13(t) builds (#39)
Browse files Browse the repository at this point in the history
* update openblas

* generalize build script

* add 3.13 builds

* remove 3.13t
  • Loading branch information
bjia56 authored Dec 22, 2024
1 parent 2f71502 commit c7e1649
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
6 changes: 3 additions & 3 deletions packages/numpy/Dockerfile.stage1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ghcr.io/bjia56/armv7l-wheel-builder:main

WORKDIR /
RUN wget -q https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.23/OpenBLAS-0.3.23.tar.gz && \
tar xf OpenBLAS-0.3.23.tar.gz && \
cd OpenBLAS-0.3.23 && \
RUN wget -q https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.28/OpenBLAS-0.3.28.tar.gz && \
tar xf OpenBLAS-0.3.28.tar.gz && \
cd OpenBLAS-0.3.28 && \
mkdir -p /tmp/vendor && \
make PREFIX=/tmp/vendor TARGET=ARMV7 -j4 && \
make PREFIX=/tmp/vendor TARGET=ARMV7 install
Expand Down
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
1 change: 1 addition & 0 deletions packages/numpy/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ python:
- "3.10"
- "3.11"
- "3.12"
- "3.13"

package:
versions: latest

0 comments on commit c7e1649

Please sign in to comment.