From 1a2375f222e35e6b4a17d3812069ff2fbc589534 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Fri, 17 Jan 2025 14:18:05 +1300 Subject: [PATCH 1/4] CMake: support macOS 13 and later. --- .github/workflows/buildThirdPartyLibrary.yml | 7 ++++--- .github/workflows/cd.yml | 12 ++++++++---- .github/workflows/ci.yml | 8 +++++--- CMakeLists.txt | 11 +++++++++-- cmake/packages.cmake | 6 ++++++ 5 files changed, 32 insertions(+), 12 deletions(-) diff --git a/.github/workflows/buildThirdPartyLibrary.yml b/.github/workflows/buildThirdPartyLibrary.yml index 974b1902b..d39e67a18 100644 --- a/.github/workflows/buildThirdPartyLibrary.yml +++ b/.github/workflows/buildThirdPartyLibrary.yml @@ -44,8 +44,9 @@ jobs: context: CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ build_type: Release - name: 'macOS (Intel)' - os: macos-13 + os: macos-14 build_type: Release + target_arch: " -DTARGET_ARCHITECTURE=Intel" - name: 'macOS (ARM)' os: macos-14 build_type: Release @@ -91,13 +92,13 @@ jobs: run: | mkdir build cd build - ${{ matrix.context }} cmake -G Ninja -DBUILD_TYPE=${{ matrix.build_type }} -DONLY_BUILD_THIRD_PARTY_LIBRARIES=ON -DPREBUILT_LLVMCLANG=OFF ${{ env.DLLVMCLANG_LLVM_TABLEGEN }} ${{ env.DLLVMCLANG_CLANG_TABLEGEN }} .. + ${{ matrix.context }} cmake -G Ninja ${{ matrix.target_arch }} -DBUILD_TYPE=${{ matrix.build_type }} -DONLY_BUILD_THIRD_PARTY_LIBRARIES=ON -DPREBUILT_LLVMCLANG=OFF ${{ env.DLLVMCLANG_LLVM_TABLEGEN }} ${{ env.DLLVMCLANG_CLANG_TABLEGEN }} .. - name: Configure libOpenCOR (only when NOT building LLVM+Clang) if: ${{ inputs.third_party_library_name != 'LLVMClang' }} run: | mkdir build cd build - ${{ matrix.context }} cmake -G Ninja -DBUILD_TYPE=${{ matrix.build_type }} -DONLY_BUILD_THIRD_PARTY_LIBRARIES=ON -DPREBUILT_${{ inputs.third_party_library_name }}=OFF .. + ${{ matrix.context }} cmake -G Ninja ${{ matrix.target_arch }} -DBUILD_TYPE=${{ matrix.build_type }} -DONLY_BUILD_THIRD_PARTY_LIBRARIES=ON -DPREBUILT_${{ inputs.third_party_library_name }}=OFF .. - name: Upload library artifact if: ${{ !startsWith(github.ref, 'refs/tags/v') }} uses: actions/upload-artifact@v4 diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 12479804d..26cf44b83 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -48,11 +48,13 @@ jobs: shared_libs: ON context: CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ - name: 'macOS static library (Intel)' - os: macos-13 + os: macos-14 shared_libs: OFF + target_arch: " -DTARGET_ARCHITECTURE=Intel" - name: 'macOS shared library (Intel)' - os: macos-13 + os: macos-14 shared_libs: ON + target_arch: " -DTARGET_ARCHITECTURE=Intel" - name: 'macOS static library (ARM)' os: macos-14 shared_libs: OFF @@ -87,7 +89,7 @@ jobs: run: | mkdir build cd build - ${{ matrix.context }} cmake -G Ninja -DBUILD_TYPE=Release -DCODE_ANALYSIS=OFF -DCODE_COVERAGE=OFF -DDOCUMENTATION=OFF -DJAVASCRIPT_BINDINGS=OFF -DMEMORY_CHECKS=OFF -DPYTHON_BINDINGS=OFF -DPYTHON_UNIT_TESTING=OFF -DSHARED_LIBS=${{ matrix.shared_libs }} -DUNIT_TESTING=OFF .. + ${{ matrix.context }} cmake -G Ninja ${{ matrix.target_arch }} -DBUILD_TYPE=Release -DCODE_ANALYSIS=OFF -DCODE_COVERAGE=OFF -DDOCUMENTATION=OFF -DJAVASCRIPT_BINDINGS=OFF -DMEMORY_CHECKS=OFF -DPYTHON_BINDINGS=OFF -DPYTHON_UNIT_TESTING=OFF -DSHARED_LIBS=${{ matrix.shared_libs }} -DUNIT_TESTING=OFF .. - name: Build libOpenCOR run: | cd build @@ -133,7 +135,9 @@ jobs: env: CIBW_ARCHS: auto64 CIBW_BUILD: 'cp*' - CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=13.0 + CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=13 + # Note: the value of CIBW_ENVIRONMENT_MACOS must be in sync with that of MACOS_DEPLOYMENT_TARGET in + # CMakelists.txt. CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_34 CIBW_SKIP: 'cp36* cp37* cp38* *musllinux*' - name: Upload Python wheel artifacts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 559c85ec0..5386172b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -142,7 +142,7 @@ jobs: install_uninstall_and_package: ON context: CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ - name: 'macOS static library (Intel)' - os: macos-13 + os: macos-14 build_type: Release code_analysis: OFF code_coverage: OFF @@ -155,9 +155,10 @@ jobs: shared_libs: OFF unit_testing: ON target: unit_testing + target_arch: " -DTARGET_ARCHITECTURE=Intel" install_uninstall_and_package: ON - name: 'macOS shared library (Intel)' - os: macos-13 + os: macos-14 build_type: Release code_analysis: OFF code_coverage: OFF @@ -170,6 +171,7 @@ jobs: shared_libs: ON unit_testing: ON target: unit_testing + target_arch: " -DTARGET_ARCHITECTURE=Intel" install_uninstall_and_package: ON - name: 'macOS static library (ARM)' os: macos-14 @@ -460,7 +462,7 @@ jobs: run: | mkdir build cd build - ${{ matrix.context }} cmake -G Ninja -DBUILD_TYPE=${{ matrix.build_type }} -DCODE_ANALYSIS=${{ matrix.code_analysis }} -DCODE_COVERAGE=${{ matrix.code_coverage }} -DDOCUMENTATION=${{ matrix.documentation }} -DINSTALL_PREFIX=${{ github.workspace }}/install -DJAVASCRIPT_BINDINGS=${{ matrix.javascript_bindings }} -DJAVASCRIPT_UNIT_TESTING=${{ matrix.javascript_unit_testing }} -DMEMORY_CHECKS=${{ matrix.memory_checks }} -DPYTHON_BINDINGS=${{ matrix.python_bindings }} -DPYTHON_UNIT_TESTING=${{ matrix.python_unit_testing }} -DSHARED_LIBS=${{ matrix.shared_libs }} -DUNIT_TESTING=${{ matrix.unit_testing }} .. + ${{ matrix.context }} cmake -G Ninja ${{ matrix.target_arch }} -DBUILD_TYPE=${{ matrix.build_type }} -DCODE_ANALYSIS=${{ matrix.code_analysis }} -DCODE_COVERAGE=${{ matrix.code_coverage }} -DDOCUMENTATION=${{ matrix.documentation }} -DINSTALL_PREFIX=${{ github.workspace }}/install -DJAVASCRIPT_BINDINGS=${{ matrix.javascript_bindings }} -DJAVASCRIPT_UNIT_TESTING=${{ matrix.javascript_unit_testing }} -DMEMORY_CHECKS=${{ matrix.memory_checks }} -DPYTHON_BINDINGS=${{ matrix.python_bindings }} -DPYTHON_UNIT_TESTING=${{ matrix.python_unit_testing }} -DSHARED_LIBS=${{ matrix.shared_libs }} -DUNIT_TESTING=${{ matrix.unit_testing }} .. - name: Build libOpenCOR if: ${{ (matrix.unit_testing == 'ON') || (matrix.javascript_unit_testing == 'ON') || (matrix.code_analysis == 'ON') || (matrix.code_coverage == 'ON') || (matrix.memory_checks == 'ON') }} run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 0076657a2..667aa3b44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,10 +48,17 @@ if(EMSCRIPTEN) add_subdirectory(src) else() - # On macOS, deploy on macOS 11 and later. + # On macOS, deploy on macOS 13 and later. + # Note #1: for some reasons, this gets ignored when building LLVM+Clang on GitHub Actions with macos-13 (Intel) + # (even when setting the MACOSX_DEPLOYMENT_TARGET environment variable), which is why we now always use + # macos-14 (ARM) and pass -DTARGET_ARCHITECTURE=Intel to CMake if we want to build for Intel (!!) on GHA. + # That is, unless we want to build our Python wheels, in which case we leave cibuildwheel do its thing on + # either macos-13 (Intel) or macos-14 (ARM). + # Note #2: the value of MACOS_DEPLOYMENT_TARGET must be in sync with that of CIBW_ENVIRONMENT_MACOS in + # .github/workflows/cd.yml. if(APPLE) - set(MACOS_DEPLOYMENT_TARGET 11) + set(MACOS_DEPLOYMENT_TARGET 13) if("${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "") set(CMAKE_OSX_DEPLOYMENT_TARGET ${MACOS_DEPLOYMENT_TARGET}) diff --git a/cmake/packages.cmake b/cmake/packages.cmake index 3cb096e4a..8fc501822 100644 --- a/cmake/packages.cmake +++ b/cmake/packages.cmake @@ -309,6 +309,12 @@ set(CMAKE_ARGS ${CMAKE_CXX_FLAGS_ARGS} ) +if(APPLE) + list(APPEND CMAKE_ARGS + -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} + ) +endif() + if(CMAKE_C_COMPILER_LAUNCHER AND CMAKE_CXX_COMPILER_LAUNCHER) escape_path(${CMAKE_C_COMPILER_LAUNCHER} EP_CMAKE_C_COMPILER_LAUNCHER) escape_path(${CMAKE_CXX_COMPILER_LAUNCHER} EP_CMAKE_CXX_COMPILER_LAUNCHER) From 832f49395e4d4fe8043f9f6f64c2adcefe71e029 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Fri, 17 Jan 2025 14:34:02 +1300 Subject: [PATCH 2/4] Third-party libraries: new macOS binaries. --- src/3rdparty/LLVMClang/CMakeLists.txt | 4 ++-- src/3rdparty/OpenSSL/CMakeLists.txt | 4 ++-- src/3rdparty/SUNDIALS/CMakeLists.txt | 4 ++-- src/3rdparty/libCOMBINE/CMakeLists.txt | 4 ++-- src/3rdparty/libCellML/CMakeLists.txt | 4 ++-- src/3rdparty/libNuML/CMakeLists.txt | 4 ++-- src/3rdparty/libSBML/CMakeLists.txt | 4 ++-- src/3rdparty/libSEDML/CMakeLists.txt | 4 ++-- src/3rdparty/libcurl/CMakeLists.txt | 4 ++-- src/3rdparty/libssh2/CMakeLists.txt | 4 ++-- src/3rdparty/libxml2/CMakeLists.txt | 4 ++-- src/3rdparty/zipper/CMakeLists.txt | 4 ++-- src/3rdparty/zlib/CMakeLists.txt | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/3rdparty/LLVMClang/CMakeLists.txt b/src/3rdparty/LLVMClang/CMakeLists.txt index a2f63ab30..b0882791c 100644 --- a/src/3rdparty/LLVMClang/CMakeLists.txt +++ b/src/3rdparty/LLVMClang/CMakeLists.txt @@ -47,11 +47,11 @@ if(LIBOPENCOR_PREBUILT_LLVMCLANG) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - d75ac2c3e920f055a9215d9727df6db9fb45cc47) + d0738ed7481fcae143c1f8b52a1ea82ad765d09e) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 9b7bd8151cc47e4b8dbcc0bf60b4aef50cfd95e7) + 868de8ec69bb19f2bc229a8a256d5ba3bdd59f54) endif() else() if(INTEL_MODE) diff --git a/src/3rdparty/OpenSSL/CMakeLists.txt b/src/3rdparty/OpenSSL/CMakeLists.txt index 5e776aec9..54be925e8 100644 --- a/src/3rdparty/OpenSSL/CMakeLists.txt +++ b/src/3rdparty/OpenSSL/CMakeLists.txt @@ -47,11 +47,11 @@ if(LIBOPENCOR_PREBUILT_OPENSSL) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 7660430004c42f49aa94905a4fd1fe22d51a10c8) + 61e6dfe3d85f4ce899e07d7c8f998221190f4fb9) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - c3b59ffbbb56ce818b249a94f6efd72228e1aa40) + 71f49e49ce8e2612ca0ee1792be3863807f47e86) endif() else() if(INTEL_MODE) diff --git a/src/3rdparty/SUNDIALS/CMakeLists.txt b/src/3rdparty/SUNDIALS/CMakeLists.txt index 87d7d6411..002e63a3d 100644 --- a/src/3rdparty/SUNDIALS/CMakeLists.txt +++ b/src/3rdparty/SUNDIALS/CMakeLists.txt @@ -52,11 +52,11 @@ if(LIBOPENCOR_PREBUILT_SUNDIALS) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 00de19609d78353ad590b6560071dec699edcc34) + 6523ab1ab7c8c53b7ae79221e433175db37b24ae) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - be0f52b5aeeb7e938896ae3934bd16d5adfbf5fb) + ecf881d34c3358997dd0fbb11b67bcb69e5b5a70) endif() else() if(INTEL_MODE) diff --git a/src/3rdparty/libCOMBINE/CMakeLists.txt b/src/3rdparty/libCOMBINE/CMakeLists.txt index 411bade27..1fe23145a 100644 --- a/src/3rdparty/libCOMBINE/CMakeLists.txt +++ b/src/3rdparty/libCOMBINE/CMakeLists.txt @@ -56,11 +56,11 @@ if(LIBOPENCOR_PREBUILT_LIBCOMBINE) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 1e71439b3b4dadd54b74f35446e2436a79bf6334) + 182deb702b4f43f897fd9697d262d6bffdd12596) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 741679e4167de3410bc6aeaeeebea59da76768db) + 933d48fc63b1b8d306c0cff819f823ea0ab3493b) endif() else() if(INTEL_MODE) diff --git a/src/3rdparty/libCellML/CMakeLists.txt b/src/3rdparty/libCellML/CMakeLists.txt index 8ba9202f8..b8f445c12 100644 --- a/src/3rdparty/libCellML/CMakeLists.txt +++ b/src/3rdparty/libCellML/CMakeLists.txt @@ -62,11 +62,11 @@ if(LIBOPENCOR_PREBUILT_LIBCELLML) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - d94dbd51fdc4904144b50d039f509635efae6c5f) + f6efb2be7f39b59d10ac0094a0fb7af901aced24) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - d33f0b95475084cb728493a3e9c452b96b43d14c) + 4f3d127518a3c856a61f68b117c89c1b127a652d) endif() else() if(INTEL_MODE) diff --git a/src/3rdparty/libNuML/CMakeLists.txt b/src/3rdparty/libNuML/CMakeLists.txt index 0a53f34a3..53ac7ece8 100644 --- a/src/3rdparty/libNuML/CMakeLists.txt +++ b/src/3rdparty/libNuML/CMakeLists.txt @@ -56,11 +56,11 @@ if(LIBOPENCOR_PREBUILT_LIBNUML) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - f6bdfef08fb2918527e3fc2330c136594dbb66f4) + 119bb9ae6a3801c95879df0f68d6723f366296cd) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - bd2bb0b0b1c41c316b80a33ee348713bdaf6e5fe) + 5221b52057eaf73d6fdb4196b68b2f1867e0fd9d) endif() else() if(INTEL_MODE) diff --git a/src/3rdparty/libSBML/CMakeLists.txt b/src/3rdparty/libSBML/CMakeLists.txt index 82580f973..716bc2231 100644 --- a/src/3rdparty/libSBML/CMakeLists.txt +++ b/src/3rdparty/libSBML/CMakeLists.txt @@ -56,11 +56,11 @@ if(LIBOPENCOR_PREBUILT_LIBSBML) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - abc0193d862fc3205f48d7b1aadd96c8f6ff4b8e) + a9237452fda3f5a3edc94baa2da8ca6b8e6ecc0a) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 5b0670ffd48d394bed0840614446625bef597691) + 582ee27a38e0fd8864f2fc41f30afd37d4d3db3d) endif() else() if(INTEL_MODE) diff --git a/src/3rdparty/libSEDML/CMakeLists.txt b/src/3rdparty/libSEDML/CMakeLists.txt index 74bf1e811..929f63ef6 100644 --- a/src/3rdparty/libSEDML/CMakeLists.txt +++ b/src/3rdparty/libSEDML/CMakeLists.txt @@ -56,11 +56,11 @@ if(LIBOPENCOR_PREBUILT_LIBSEDML) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - a06039f8a66e2878889028d437016520a1b75a2f) + 2ae5855a74d5fc4ebb3bc4de0e882a4edda1c192) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 2a9db5b4b4c725c1ed3b87c5a6c5cb0782070eda) + 49decb55fa4716f0fa7e77a1340bf235c015bfbb) endif() else() if(INTEL_MODE) diff --git a/src/3rdparty/libcurl/CMakeLists.txt b/src/3rdparty/libcurl/CMakeLists.txt index 6847c9310..26a453d4c 100644 --- a/src/3rdparty/libcurl/CMakeLists.txt +++ b/src/3rdparty/libcurl/CMakeLists.txt @@ -51,11 +51,11 @@ if(LIBOPENCOR_PREBUILT_LIBCURL) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 8e2e31f33d4100aa7d3144becfc7ca4c42eb6651) + 22ed824df4e4c2d726ca5a26cae6fad856f3a17a) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 7ad906ec19f0a2390ee53454b968d793b851975e) + 57fb241e372c9ec0fba1a0609a9b66fb1dba9263) endif() else() if(INTEL_MODE) diff --git a/src/3rdparty/libssh2/CMakeLists.txt b/src/3rdparty/libssh2/CMakeLists.txt index 22666a100..ffdaaca2c 100644 --- a/src/3rdparty/libssh2/CMakeLists.txt +++ b/src/3rdparty/libssh2/CMakeLists.txt @@ -47,11 +47,11 @@ if(LIBOPENCOR_PREBUILT_LIBSSH2) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - a929aa63b53bb84313efcb018cfa9477e2f1044b) + 48f7ce906760b7b84e8687aae93f8cd38522737d) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - f5cae05d61c19d6649d30692bd9e9642473c5f26) + c405224fe0f754765286ceeabb2e237bcee010e3) endif() else() if(INTEL_MODE) diff --git a/src/3rdparty/libxml2/CMakeLists.txt b/src/3rdparty/libxml2/CMakeLists.txt index a4f13dc83..26d2d1a36 100644 --- a/src/3rdparty/libxml2/CMakeLists.txt +++ b/src/3rdparty/libxml2/CMakeLists.txt @@ -52,11 +52,11 @@ if(LIBOPENCOR_PREBUILT_LIBXML2) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 8fe7f1506c8f8b97dafbf362c6cce76015d44414) + c3d1140afb1e737f2774b1f0e7efd8029bf89a44) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 77ad06e36d08f38d155c1336d514149cf01dd59c) + 1004d818b0d771d04625ed0f18f07cfc3290d609) endif() else() if(INTEL_MODE) diff --git a/src/3rdparty/zipper/CMakeLists.txt b/src/3rdparty/zipper/CMakeLists.txt index 4687c72aa..4241080fc 100644 --- a/src/3rdparty/zipper/CMakeLists.txt +++ b/src/3rdparty/zipper/CMakeLists.txt @@ -52,11 +52,11 @@ if(LIBOPENCOR_PREBUILT_ZIPPER) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 5286a5dc4f7b39ce0de4d5a4281895f26a2bf1a7) + 3975ba9ad6eb073fdb086779d78043bc3b207535) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 7e5f68b711642fc485002eeebc81421c23ae4013) + 24c4e46cf73e353968fa33e3f1a0cc845c8d8625) endif() else() if(INTEL_MODE) diff --git a/src/3rdparty/zlib/CMakeLists.txt b/src/3rdparty/zlib/CMakeLists.txt index ffcfe28ce..824b27949 100644 --- a/src/3rdparty/zlib/CMakeLists.txt +++ b/src/3rdparty/zlib/CMakeLists.txt @@ -52,11 +52,11 @@ if(LIBOPENCOR_PREBUILT_ZLIB) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - ea7937a62c9a9fb92362ca8ef2a40088f30a9499) + cd7e33ccbfcae378c6fc4be1372a77ebb645e80a) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - d6ebf32cdd8ec89b4c15223116e8c8b2a6fd3d68) + 637818076b3144913bdf8ba35fd425ff616bdd2e) endif() else() if(INTEL_MODE) From 89573df4e362b717a07b0e22a3bf908e0f79adf9 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Sat, 18 Jan 2025 14:25:20 +1300 Subject: [PATCH 3/4] CI: don't test our Python bindings on macOS Intel, just on macOS ARM. We just want to stop using macos-13 and only use macos-14. And, while we can do that to build libOpenCOR per se and its Python wheels, we can't (?) when `pip install`ing libOpenCOR. --- .github/workflows/ci.yml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5386172b5..f2e87c3fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -248,24 +248,7 @@ jobs: unit_testing: OFF target: python_unit_testing pip_install_test_and_uninstall: ON - - name: 'macOS Python bindings (Intel)' - os: macos-13 - build_type: Release - code_analysis: OFF - code_coverage: OFF - documentation: OFF - javascript_bindings: OFF - javascript_unit_testing: OFF - memory_checks: OFF - python_bindings: ON - python_unit_testing: ON - shared_libs: OFF - unit_testing: OFF - context: PATH=/Library/Frameworks/Python.framework/Versions/Current/bin:$PATH - target: python_unit_testing - pip_install_prerequisites: sudo pip3 install cmake scikit-build - pip_install_test_and_uninstall: ON - - name: 'macOS Python bindings (ARM)' + - name: 'macOS Python bindings' os: macos-14 build_type: Release code_analysis: OFF From 62cb45198fc982c596d01e8c0089a1baa0fa286b Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Sat, 18 Jan 2025 14:27:59 +1300 Subject: [PATCH 4/4] CD: build our Python wheels for Windows Intel/ARM, Linux Intel, and /macOS Intel/ARM. --- .github/workflows/cd.yml | 22 ++++++++++++++++++---- CMakeLists.txt | 9 ++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 26cf44b83..5ed1061fb 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -116,10 +116,21 @@ jobs: fail-fast: false matrix: include: - - name: 'Windows Python wheels' + - name: 'Windows Python wheels (Intel)' os: windows-2022 + arch: amd64 + - name: 'Windows Python wheels (ARM)' + os: windows-2022 + arch: amd64_arm64 - name: 'Linux Python wheels' os: ubuntu-22.04 + # Note: ideally, we would be able to build our Python wheels for both Intel and ARM, but although there + # is a manylinux_2_34 image for ARM (see + # https://quay.io/repository/pypa/manylinux_2_34_aarch64?tab=tags), it is not supported by + # cibuildwheel. The only way to build Python wheels for ARM is currently through emulation (see + # https://cibuildwheel.pypa.io/en/stable/faq/#emulation), but this doesn't work for us because it + # relies on an old version of Linux while we want one with at least glibc version 2.34. So, for now, + # we are only building our Python wheels for Intel. - name: 'macOS Python wheels (Intel)' os: macos-13 - name: 'macOS Python wheels (ARM)' @@ -130,14 +141,17 @@ jobs: - name: Configure MSVC if: ${{ runner.os == 'Windows' }} uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} - name: Build Python wheels uses: pypa/cibuildwheel@9c75ea15c2f31a77e6043b80b1b7081372319d85 env: CIBW_ARCHS: auto64 CIBW_BUILD: 'cp*' - CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=13 - # Note: the value of CIBW_ENVIRONMENT_MACOS must be in sync with that of MACOS_DEPLOYMENT_TARGET in - # CMakelists.txt. + CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=13.0 + # Note #1: the value of CIBW_ENVIRONMENT_MACOS must be in sync with that of MACOS_DEPLOYMENT_TARGET in + # CMakelists.txt. + # Note #2: for some reasons, we need to specify the minor version, hence using 13.0 instead of 13. CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_34 CIBW_SKIP: 'cp36* cp37* cp38* *musllinux*' - name: Upload Python wheel artifacts diff --git a/CMakeLists.txt b/CMakeLists.txt index 667aa3b44..1e551f8b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,11 +49,10 @@ if(EMSCRIPTEN) add_subdirectory(src) else() # On macOS, deploy on macOS 13 and later. - # Note #1: for some reasons, this gets ignored when building LLVM+Clang on GitHub Actions with macos-13 (Intel) - # (even when setting the MACOSX_DEPLOYMENT_TARGET environment variable), which is why we now always use - # macos-14 (ARM) and pass -DTARGET_ARCHITECTURE=Intel to CMake if we want to build for Intel (!!) on GHA. - # That is, unless we want to build our Python wheels, in which case we leave cibuildwheel do its thing on - # either macos-13 (Intel) or macos-14 (ARM). + # Note #1: for some reasons, this gets ignored by LLVM+Clang when we try to build it on GitHub Actions using + # macos-13 (Intel) (even when setting the MACOSX_DEPLOYMENT_TARGET environment variable), which is why we + # now always use macos-14 (ARM) (not to mention that it is faster!) and pass -DTARGET_ARCHITECTURE=Intel to + # CMake if we want to build for macOS Intel on GHA. # Note #2: the value of MACOS_DEPLOYMENT_TARGET must be in sync with that of CIBW_ENVIRONMENT_MACOS in # .github/workflows/cd.yml.