diff --git a/packages/scipy/Dockerfile.stage1 b/packages/scipy/Dockerfile.stage1 new file mode 100644 index 0000000..fe4e111 --- /dev/null +++ b/packages/scipy/Dockerfile.stage1 @@ -0,0 +1,10 @@ +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 && \ + mkdir -p /tmp/vendor && \ + make PREFIX=/tmp/vendor TARGET=ARMV7 -j4 && \ + make PREFIX=/tmp/vendor TARGET=ARMV7 install + diff --git a/packages/scipy/Dockerfile.stage2 b/packages/scipy/Dockerfile.stage2 new file mode 100644 index 0000000..7bb33bc --- /dev/null +++ b/packages/scipy/Dockerfile.stage2 @@ -0,0 +1,25 @@ +FROM base +ARG PYTHON_VERSION +ARG VERSION +ARG OUTPUT_DIR + +ENV CFLAGS='-I/usr/local/ssl/include -I/tmp/vendor/include' +ENV LDFLAGS='-L/usr/local/ssl/lib -L/tmp/vendor/lib' +ENV LD_LIBRARY_PATH=/tmp/vendor/lib:/usr/local/ssl/lib:$LD_LIBRARY_PATH +ENV PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig:/usr/local/ssl/lib/pkgconfig + +ENV CC=/opt/rh/devtoolset-10/root/usr/bin/gcc +ENV FC=/opt/rh/devtoolset-10/root/usr/bin/gfortran5 +ENV CXX=/opt/rh/devtoolset-10/root/usr/bin/g++ +ENV LD=/opt/rh/devtoolset-10/root/usr/bin/ld + +COPY . /repo + +RUN mkdir /scipy +WORKDIR /scipy +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 mkdir -p ${OUTPUT_DIR} && \ + cp build${PYTHON_VERSION}/wheelhouse/scipy*manylinux*armv7l.whl ${OUTPUT_DIR} diff --git a/packages/scipy/armv7l_build_wheels.sh b/packages/scipy/armv7l_build_wheels.sh new file mode 100644 index 0000000..a56be10 --- /dev/null +++ b/packages/scipy/armv7l_build_wheels.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +PYTHON3_VERSION=$1 +PACKAGE_VERSION=$2 + +set -e + +build_wheel() ( + PY_VER=$1 + VER=$2 + mkdir build$PY_VER + cd build$PY_VER + pip$PY_VER wheel --no-deps scipy==$VER +) + +test_wheel() ( + PY_VER=$1 + cd build$PY_VER + pip$PY_VER install wheelhouse/scipy*manylinux*armv7l.whl + python$PY_VER -c "import scipy; print(scipy)" +) + +repair_wheel() ( + PY_VER=$1 + cd build$PY_VER + auditwheel repair scipy*armv7l.whl +) + +build_wheel $PYTHON3_VERSION $PACKAGE_VERSION +repair_wheel $PYTHON3_VERSION +test_wheel $PYTHON3_VERSION diff --git a/packages/scipy/build.yaml b/packages/scipy/build.yaml new file mode 100644 index 0000000..039a607 --- /dev/null +++ b/packages/scipy/build.yaml @@ -0,0 +1,15 @@ +strategy: dockerfile +source: +- file: ./Dockerfile.stage1 + common: true +- file: ./Dockerfile.stage2 + +python: + versions: + - "3.9" + - "3.10" + - "3.11" + - "3.12" + +package: + versions: latest