Skip to content

Commit

Permalink
Build MacOS ARM wheels
Browse files Browse the repository at this point in the history
Note that we have to copy lots of code because it seems like toml files
do now allow to share flow any other way.
  • Loading branch information
achaikou committed Nov 1, 2023
1 parent cea67c4 commit 73ddb81
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
arch: i686
- os: macos-11
arch: x86_64
- os: macos-13-xlarge
arch: arm64

steps:
- name: Disable autocrlf
Expand Down Expand Up @@ -65,7 +67,8 @@ jobs:
CIBW_ARCHS: ${{ matrix.arch }}
# musllinux arch skip: unlikely someone wants to run dlisio on alpine on non-standard architecture
# musllinux cp37 and cp38 skip: latest available numpy doesn't provide musslinux wheels, so it is unlikely useful
CIBW_SKIP: pp* *-musllinux_i686 *-musllinux_aarch64 cp37*-musllinux* cp38*-musllinux* cp36-*
# macosx 38 skip: cibuildwheel can't test it
CIBW_SKIP: pp* *-musllinux_i686 *-musllinux_aarch64 cp37*-musllinux* cp38*-musllinux* cp38*-macosx_*:arm64 cp36-*

run: |
python -m cibuildwheel --output-dir wheelhouse python/
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ pip install dlisio
```


| | macOS Intel | Windows 64bit | Windows 32bit | manylinux x86_64 | manylinux aarch64 | manylinux i686 | musllinux x86_64
|---------------|----|-----|-----|----|----|----|----|
| CPython 3.7 || ||||| - |
| CPython 3.8 || ||||| - |
| CPython 3.9 ||||||||
| CPython 3.10 ||||||||
| CPython 3.11 ||||||||
| CPython 3.12 ||||||||
| | macOS Intel | macOS ARM | Windows 64bit | Windows 32bit | manylinux x86_64 | manylinux aarch64 | manylinux i686 | musllinux x86_64
|---------------|----|-----|-----|----|----|----|----|----|
| CPython 3.7 || - | | |||| - |
| CPython 3.8 || - | | |||| - |
| CPython 3.9 |||||||||
| CPython 3.10 |||||||||
| CPython 3.11 |||||||||
| CPython 3.12 |||||||||

See [Build dlisio](#Build-dlisio) for building dlisio from source.

Expand Down
63 changes: 63 additions & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,66 @@ before-build= [

[tool.cibuildwheel.macos]
environment = { CXXFLAGS="-L/usr/local/lib" }

before-all = [
"""curl \
-L https://github.com/fmtlib/fmt/archive/refs/tags/7.1.3.tar.gz \
-o fmt-7.1.3.tar.gz \
""",
"tar xf fmt-7.1.3.tar.gz",
"""cmake \
-S fmt-7.1.3 \
-B fmt-7.1.3/build \
-DFMT_TEST=OFF \
-DFMT_DOC=OFF \
""",
"""sudo cmake \
--build fmt-7.1.3/build \
--target install \
--config Release \
""",
"""git clone https://github.com/equinor/layered-file-protocols.git""",
"""cmake \
-S layered-file-protocols \
-B layered-file-protocols/build \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DLFP_FMT_HEADER_ONLY=ON \
-DBUILD_TESTING=OFF \
""",
"""sudo cmake \
--build layered-file-protocols/build \
--target install \
--config Release \
""",
"""curl \
-L https://github.com/mpark/variant/archive/refs/tags/v1.4.0.tar.gz \
-o variant-1.4.0.tar.gz \
""",
"tar xf variant-1.4.0.tar.gz",
"""cmake \
-S variant-1.4.0 \
-B variant-1.4.0/build \
""",
"""sudo cmake \
--build variant-1.4.0/build \
--target install \
--config Release \
""",
]

before-build = [
"""cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_TESTING=OFF \
-DBUILD_PYTHON=OFF \
""",
"""sudo cmake \
--build build \
--parallel \
--target install \
--config Release \
""",
]

0 comments on commit 73ddb81

Please sign in to comment.