From 3154db80d7784f2f17f572de7754d82e9d068c8c Mon Sep 17 00:00:00 2001 From: Alena Chaikouskaya Date: Fri, 20 Oct 2023 16:21:10 +0200 Subject: [PATCH] Build MacOS ARM wheels Note that we have to copy lots of code because it seems like toml files do now allow to share flow any other way. --- .github/workflows/wheels.yaml | 2 ++ README.md | 16 ++++----- python/pyproject.toml | 63 +++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 8 deletions(-) diff --git a/.github/workflows/wheels.yaml b/.github/workflows/wheels.yaml index e1522d1fc..c7692558d 100644 --- a/.github/workflows/wheels.yaml +++ b/.github/workflows/wheels.yaml @@ -32,6 +32,8 @@ jobs: arch: i686 - os: macos-11 arch: x86_64 + - os: macos-13-xlarge + arch: arm64 steps: - name: Disable autocrlf diff --git a/README.md b/README.md index 289041abd..635529b11 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/python/pyproject.toml b/python/pyproject.toml index 2c647dbcb..2f6bc6795 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -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 \ + """, +]