From 96f1840fe6ac592036e310bbd75edf78020c058c Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Tue, 10 May 2022 12:36:15 -0400 Subject: [PATCH 1/9] Enable cibuildwheel for arm64. --- .github/workflows/build_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 519aed975..0f0678d93 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -41,7 +41,7 @@ jobs: CIBW_SKIP: "{pp*,*-musllinux_*}" # Build only on 64-bit architectures. - CIBW_ARCHS_MACOS: x86_64 + CIBW_ARCHS_MACOS: "x86_64 arm64" CIBW_ARCHS_LINUX: auto64 CIBW_ARCHS_WINDOWS: auto64 From 16092ce5ae60322b9459435f91edc6ef088bc1a1 Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Tue, 10 May 2022 13:06:42 -0400 Subject: [PATCH 2/9] Clean the tbb build directory before building. --- .github/workflows/cibuildwheel-before-build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/cibuildwheel-before-build.sh b/.github/workflows/cibuildwheel-before-build.sh index 342e66cfd..9c2590a0c 100755 --- a/.github/workflows/cibuildwheel-before-build.sh +++ b/.github/workflows/cibuildwheel-before-build.sh @@ -19,6 +19,9 @@ TBB_ZIP="v${TBB_VERSION}.zip" curl -L -O "https://github.com/oneapi-src/oneTBB/archive/refs/tags/${TBB_ZIP}" unzip -q "${TBB_ZIP}" +# clean the build to rebuild for arm64 +rm -rf "${PACKAGE_DIR}/tbb" + # Move to a hard-coded path (defined by CIBW_ENVIRONMENT) mv "oneTBB-${TBB_VERSION}" "${PACKAGE_DIR}/tbb" cd "${PACKAGE_DIR}/tbb" From bb89baace17147f607f2dd70dd1806330f13fc62 Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Tue, 10 May 2022 13:34:13 -0400 Subject: [PATCH 3/9] Testing platform env vars. --- .github/workflows/build_wheels.yml | 2 +- .github/workflows/cibuildwheel-before-build.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 0f0678d93..a980b8ef4 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -41,7 +41,7 @@ jobs: CIBW_SKIP: "{pp*,*-musllinux_*}" # Build only on 64-bit architectures. - CIBW_ARCHS_MACOS: "x86_64 arm64" + CIBW_ARCHS_MACOS: "arm64" CIBW_ARCHS_LINUX: auto64 CIBW_ARCHS_WINDOWS: auto64 diff --git a/.github/workflows/cibuildwheel-before-build.sh b/.github/workflows/cibuildwheel-before-build.sh index 9c2590a0c..aa9f55e77 100755 --- a/.github/workflows/cibuildwheel-before-build.sh +++ b/.github/workflows/cibuildwheel-before-build.sh @@ -22,11 +22,13 @@ unzip -q "${TBB_ZIP}" # clean the build to rebuild for arm64 rm -rf "${PACKAGE_DIR}/tbb" +set + # Move to a hard-coded path (defined by CIBW_ENVIRONMENT) mv "oneTBB-${TBB_VERSION}" "${PACKAGE_DIR}/tbb" cd "${PACKAGE_DIR}/tbb" mkdir -p build cd build -cmake ../ -DTBB_TEST=OFF -DTBB_STRICT=OFF +cmake ../ -DTBB_TEST=OFF -DTBB_STRICT=OFF -DCMAKE_BUILD_TYPE=Release cmake --build . -j cmake --install . From 7a14d4ed05217445440e2a81c07a648e86c4af7e Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Tue, 10 May 2022 13:41:28 -0400 Subject: [PATCH 4/9] Limit builds to increase test throughput. --- .github/workflows/build_wheels.yml | 2 +- .github/workflows/cibuildwheel-before-build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index a980b8ef4..5f6644daf 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: os: [ubuntu-20.04, macos-10.15] #, windows-2019] - pyver: ["3.6", "3.7", "3.8", "3.9", "3.10"] + pyver: ["3.10"] # ["3.6", "3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v3.0.2 diff --git a/.github/workflows/cibuildwheel-before-build.sh b/.github/workflows/cibuildwheel-before-build.sh index aa9f55e77..c52715e61 100755 --- a/.github/workflows/cibuildwheel-before-build.sh +++ b/.github/workflows/cibuildwheel-before-build.sh @@ -29,6 +29,6 @@ mv "oneTBB-${TBB_VERSION}" "${PACKAGE_DIR}/tbb" cd "${PACKAGE_DIR}/tbb" mkdir -p build cd build -cmake ../ -DTBB_TEST=OFF -DTBB_STRICT=OFF -DCMAKE_BUILD_TYPE=Release +cmake ../ -DTBB_TEST=OFF -DTBB_STRICT=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURE=arm64 cmake --build . -j cmake --install . From 6abca4981adf5ea92ccf0aa9c443a20c4f1ea051 Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Tue, 10 May 2022 13:53:14 -0400 Subject: [PATCH 5/9] Try again. --- .github/workflows/cibuildwheel-before-build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cibuildwheel-before-build.sh b/.github/workflows/cibuildwheel-before-build.sh index c52715e61..569d8d7b0 100755 --- a/.github/workflows/cibuildwheel-before-build.sh +++ b/.github/workflows/cibuildwheel-before-build.sh @@ -29,6 +29,6 @@ mv "oneTBB-${TBB_VERSION}" "${PACKAGE_DIR}/tbb" cd "${PACKAGE_DIR}/tbb" mkdir -p build cd build -cmake ../ -DTBB_TEST=OFF -DTBB_STRICT=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURE=arm64 -cmake --build . -j +cmake ../ -DTBB_TEST=OFF -DTBB_STRICT=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 +cmake --build . -j -v cmake --install . From 0301e3c83460b3acec14a927f275f577bfd72463 Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Tue, 10 May 2022 19:51:33 -0400 Subject: [PATCH 6/9] Attempt to support both x86_64 and arm64 builds. --- .github/workflows/build_wheels.yml | 2 +- .github/workflows/cibuildwheel-before-build.sh | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 5f6644daf..bc3aed43d 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: os: [ubuntu-20.04, macos-10.15] #, windows-2019] - pyver: ["3.10"] # ["3.6", "3.7", "3.8", "3.9", "3.10"] + pyver: ["3.9"] # ["3.6", "3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v3.0.2 diff --git a/.github/workflows/cibuildwheel-before-build.sh b/.github/workflows/cibuildwheel-before-build.sh index 569d8d7b0..421f63c23 100755 --- a/.github/workflows/cibuildwheel-before-build.sh +++ b/.github/workflows/cibuildwheel-before-build.sh @@ -19,16 +19,23 @@ TBB_ZIP="v${TBB_VERSION}.zip" curl -L -O "https://github.com/oneapi-src/oneTBB/archive/refs/tags/${TBB_ZIP}" unzip -q "${TBB_ZIP}" +# +EXTRA_CMAKE_ARGS="" +if [ "${PLATFORM}" = "macos" ]; then + if [[ ${ARCHFLAGS} == *"arm64"* ]]; then + EXTRA_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES=arm64" + fi +fi +echo "EXTRA_CMAKE_ARGS=${EXTRA_CMAKE_ARGS}" + # clean the build to rebuild for arm64 rm -rf "${PACKAGE_DIR}/tbb" -set - # Move to a hard-coded path (defined by CIBW_ENVIRONMENT) mv "oneTBB-${TBB_VERSION}" "${PACKAGE_DIR}/tbb" cd "${PACKAGE_DIR}/tbb" mkdir -p build cd build -cmake ../ -DTBB_TEST=OFF -DTBB_STRICT=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 +cmake ../ -DTBB_TEST=OFF -DTBB_STRICT=OFF -DCMAKE_BUILD_TYPE=Release ${EXTRA_CMAKE_ARGS} cmake --build . -j -v cmake --install . From 6ae5902556241d5cd71755b799779921dcb07496 Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Tue, 10 May 2022 20:06:27 -0400 Subject: [PATCH 7/9] Enable full build matrix. --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index bc3aed43d..0f0678d93 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: os: [ubuntu-20.04, macos-10.15] #, windows-2019] - pyver: ["3.9"] # ["3.6", "3.7", "3.8", "3.9", "3.10"] + pyver: ["3.6", "3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v3.0.2 @@ -41,7 +41,7 @@ jobs: CIBW_SKIP: "{pp*,*-musllinux_*}" # Build only on 64-bit architectures. - CIBW_ARCHS_MACOS: "arm64" + CIBW_ARCHS_MACOS: "x86_64 arm64" CIBW_ARCHS_LINUX: auto64 CIBW_ARCHS_WINDOWS: auto64 From 658313fde8e5f684351b09084d006d4c7e1bf2b0 Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Wed, 11 May 2022 11:04:11 -0400 Subject: [PATCH 8/9] Update change log. --- ChangeLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog.md b/ChangeLog.md index 63209a658..a901d84f3 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -8,6 +8,7 @@ and this project adheres to ### Added * `include_input_points` argument to `freud.locality.PeriodicBuffer`. +* `macos-arm64` binary builds on conda-forge and PyPI. ### Changed * `freud.data.UnitCell.generate_system` now generates positions in the same order as the basis positions. From 1419230a1289246ae27d8a8dae00a8a57a42ebe8 Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Thu, 12 May 2022 14:16:18 -0400 Subject: [PATCH 9/9] Make [[ consistent. --- .github/workflows/cibuildwheel-before-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel-before-build.sh b/.github/workflows/cibuildwheel-before-build.sh index 421f63c23..0e1f49741 100755 --- a/.github/workflows/cibuildwheel-before-build.sh +++ b/.github/workflows/cibuildwheel-before-build.sh @@ -21,7 +21,7 @@ unzip -q "${TBB_ZIP}" # EXTRA_CMAKE_ARGS="" -if [ "${PLATFORM}" = "macos" ]; then +if [[ "${PLATFORM}" == "macos" ]]; then if [[ ${ARCHFLAGS} == *"arm64"* ]]; then EXTRA_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES=arm64" fi