Skip to content

Commit

Permalink
install: managed to build aarch64 wheels locally
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Oct 22, 2024
1 parent af1790e commit 87e0837
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- name: Install OpenSSL
if: ${{ matrix.arch == 'aarch64' }}
run: sudo apt-get update && sudo apt-get install -y libssl-dev
run: sudo apt-get update && sudo apt-get install -y libssl-dev cmake

- name: Set OpenSSL path
run: echo "OPENSSL_ROOT_DIR=/usr" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: pypa/[email protected]
# to supply options, put them in 'env', like:
env:
CIBW_BEFORE_BUILD: git submodule init && git submodule update && pip install "cmake>=3.30.2" && pip install cython numpy scikit-build
CIBW_BEFORE_BUILD: git submodule init && git submodule update && pip install "cmake>=3.30.2" && pip install cython numpy scikit-build setuptools wheel
CPPFLAGS: -I/usr/local/opt/zlib/include
LDFLAGS: -L/usr/local/opt/zlib/lib
CIBW_ARCHS_MACOS: "x86_64"
Expand Down
53 changes: 25 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,47 +1,44 @@
FROM quay.io/pypa/manylinux2010_x86_64
MAINTAINER Manuel Castro
FROM quay.io/pypa/manylinux2014_aarch64
MAINTAINER William Silversmith

COPY . /DracoPy

WORKDIR "/DracoPy"

ENV GCC "g++"
ENV GCC "gcc"

RUN rm -rf *.so _skbuild __pycache__ dist DracoPy.egg-info

RUN /opt/python/cp36-cp36m/bin/pip3.6 install pip --upgrade
RUN /opt/python/cp37-cp37m/bin/pip3.7 install pip --upgrade
RUN yum update && yum install -y openssl-devel cmake

RUN /opt/python/cp38-cp38/bin/pip3.8 install pip --upgrade
RUN /opt/python/cp39-cp39/bin/pip3.9 install pip --upgrade
RUN /opt/python/cp310-cp310/bin/pip3.10 install pip --upgrade
RUN /opt/python/cp311-cp311/bin/pip3.11 install pip --upgrade
RUN /opt/python/cp312-cp312/bin/pip3.12 install pip --upgrade

RUN /opt/python/cp38-cp38/bin/pip3.8 install scikit-build twine numpy cython pytest -U
RUN /opt/python/cp39-cp39/bin/pip3.9 install scikit-build twine numpy cython pytest -U
RUN /opt/python/cp310-cp310/bin/pip3.10 install scikit-build twine numpy cython pytest -U
RUN /opt/python/cp311-cp311/bin/pip3.11 install scikit-build twine numpy cython pytest -U
RUN /opt/python/cp312-cp312/bin/pip3.12 install scikit-build twine numpy cython pytest -U

RUN touch src/DracoPy.pyx && /opt/python/cp38-cp38/bin/python3.8 setup.py develop
RUN touch src/DracoPy.pyx && /opt/python/cp39-cp39/bin/python3.9 setup.py develop
RUN touch src/DracoPy.pyx && /opt/python/cp310-cp310/bin/python3.10 setup.py develop
RUN touch src/DracoPy.pyx && /opt/python/cp311-cp311/bin/python3.11 setup.py develop
RUN touch src/DracoPy.pyx && /opt/python/cp312-cp312/bin/python3.12 setup.py develop

RUN /opt/python/cp36-cp36m/bin/pip3.6 install scikit-build twine oldest-supported-numpy
RUN /opt/python/cp37-cp37m/bin/pip3.7 install scikit-build twine oldest-supported-numpy
RUN /opt/python/cp38-cp38/bin/pip3.8 install scikit-build twine oldest-supported-numpy
RUN /opt/python/cp39-cp39/bin/pip3.9 install scikit-build twine oldest-supported-numpy
RUN /opt/python/cp310-cp310/bin/pip3.10 install scikit-build twine oldest-supported-numpy
RUN /opt/python/cp311-cp311/bin/pip3.11 install scikit-build twine oldest-supported-numpy

RUN /opt/python/cp36-cp36m/bin/python3.6 setup.py develop
RUN /opt/python/cp37-cp37m/bin/python3.7 setup.py develop
RUN /opt/python/cp38-cp38/bin/python3.8 setup.py develop
RUN /opt/python/cp39-cp39/bin/python3.9 setup.py develop
RUN /opt/python/cp310-cp310/bin/python3.10 setup.py develop
RUN /opt/python/cp311-cp311/bin/python3.11 setup.py develop

RUN /opt/python/cp36-cp36m/bin/python3.6 -m pytest -v -x tests.py
RUN /opt/python/cp37-cp37m/bin/python3.7 -m pytest -v -x tests.py
RUN /opt/python/cp38-cp38/bin/python3.8 -m pytest -v -x tests.py
RUN /opt/python/cp39-cp39/bin/python3.9 -m pytest -v -x tests.py
RUN /opt/python/cp310-cp310/bin/python3.10 -m pytest -v -x tests.py
RUN /opt/python/cp311-cp311/bin/python3.11 -m pytest -v -x tests.py
RUN /opt/python/cp312-cp312/bin/python3.12 -m pytest -v -x tests.py

RUN /opt/python/cp36-cp36m/bin/python3.6 setup.py sdist bdist_wheel
RUN /opt/python/cp37-cp37m/bin/python3.7 setup.py sdist bdist_wheel
RUN /opt/python/cp38-cp38/bin/python3.8 setup.py sdist bdist_wheel
RUN /opt/python/cp39-cp39/bin/python3.9 setup.py sdist bdist_wheel
RUN /opt/python/cp310-cp310/bin/python3.10 setup.py sdist bdist_wheel
RUN /opt/python/cp311-cp311/bin/python3.11 setup.py sdist bdist_wheel
RUN touch src/DracoPy.pyx && /opt/python/cp38-cp38/bin/python3.8 setup.py bdist_wheel
RUN touch src/DracoPy.pyx && /opt/python/cp39-cp39/bin/python3.9 setup.py bdist_wheel
RUN touch src/DracoPy.pyx && /opt/python/cp310-cp310/bin/python3.10 setup.py bdist_wheel
RUN touch src/DracoPy.pyx && /opt/python/cp311-cp311/bin/python3.11 setup.py bdist_wheel
RUN touch src/DracoPy.pyx && /opt/python/cp312-cp312/bin/python3.12 setup.py bdist_wheel

RUN for whl in `ls dist/*.whl`; do auditwheel repair --plat manylinux2010_x86_64 $whl; done
RUN for whl in `ls dist/*.whl`; do auditwheel repair --plat manylinux2014_aarch64 $whl; done
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def read(fname):

# Add CMake as a build requirement if cmake is not installed or is too low a version
setup_requires = ['cython']
setup_requires.append('cmake<3.15')
setup_requires.append('cmake')

# If you want to re-build the cython cpp file (DracoPy.cpp), run:
# cython --cplus -3 -I./_skbuild/linux-x86_64-3.6/cmake-install/include/draco/ ./src/DracoPy.pyx
Expand Down

0 comments on commit 87e0837

Please sign in to comment.