scalableminds / webknossos-wrap

Efficient 3D volume storage format for webKnossos and analyses
MIT License
8 stars 3 forks source link

Add universal2 wheels for the mac platform #69

Closed normanrz closed 2 years ago

normanrz commented 2 years ago

This PR adds Apple silicon support to the pre-compiled wheels by providing a universal2 (x86_64 + arm64) dylib. The universal2 dylib is assembled by compiling both libraries individually and combining them with lipo (a standard xcode tool). The new wheel will be distributed through pypi, as regular.

Testing

First, install the rust toolchains:

rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin

Testing the x86_64 version was easy with a conda env (and is also performed by the CI). For the arm64 version, I used the homebrew-shipped python:

/opt/homebrew/bin/python3.9 -c "import distutils.util; print(distutils.util.get_platform())" # verify we are running a arm64-version
/opt/homebrew/bin/python3.9 -m pip install -r requirements.txt
/opt/homebrew/bin/python3.9 setup.py install
/opt/homebrew/bin/python3.9 -c "import wkw"
/opt/homebrew/bin/python3.9 -m pip install pytest
/opt/homebrew/bin/python3.9 -m pytest tests
normanrz commented 2 years ago

updated PR description^