diff --git a/.github/workflows/releasebuild.yml b/.github/workflows/releasebuild.yml index 6bfd7ef6..58d403ee 100644 --- a/.github/workflows/releasebuild.yml +++ b/.github/workflows/releasebuild.yml @@ -109,28 +109,24 @@ jobs: path: ./wheelhouse/*.whl build_wheels_macos: - name: Build wheel on macos-13/${{matrix.arch}}/${{matrix.python_tag}} + name: Build wheel on ${{ matrix.os }}/native/${{matrix.python_tag}} needs: [build_sdist] - runs-on: macos-13 + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - arch: [x86_64, arm64, universal2] + os: [macos-13, macos-14] python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "pp38-*", "pp39-*"] exclude: # PyPy not supported on MacOS Arm - - arch: arm64 + - os: macos-14 python_tag: "pp38-*" - - arch: arm64 - python_tag: "pp39-*" - - arch: universal2 - python_tag: "pp38-*" - - arch: universal2 + - os: macos-14 python_tag: "pp39-*" env: CIBW_BUILD: ${{matrix.python_tag}} - CIBW_ARCHS: ${{matrix.arch}} - CIBW_TEST_SKIP: "{*-macosx_{arm64,universal2},pp*-macosx_*}" + CIBW_ARCHS: native + CIBW_TEST_SKIP: "pp*-macosx_*" #CIBW_TEST_REQUIRES: pytest hypothesis pandas CIBW_TEST_REQUIRES: pytest hypothesis CIBW_TEST_COMMAND: pytest {package}/tests diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e99bbe47..1cf303db 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,13 @@ Changelog --------- +[3.9.1] - 2024-05-19 +^^^^^^^^^^^^^^^^^^^^ +Fixed +~~~~~ +* disable AVX2 on MacOS since it did lead to illegal instructions being generated + + [3.9.0] - 2024-05-02 ^^^^^^^^^^^^^^^^^^^^ Changed diff --git a/src/rapidfuzz/CMakeLists.txt b/src/rapidfuzz/CMakeLists.txt index 6ed263e6..b015100b 100644 --- a/src/rapidfuzz/CMakeLists.txt +++ b/src/rapidfuzz/CMakeLists.txt @@ -57,19 +57,22 @@ target_link_libraries(fuzz_cpp PRIVATE rapidfuzz::rapidfuzz) install(TARGETS fuzz_cpp LIBRARY DESTINATION src/rapidfuzz) if(RAPIDFUZZ_ARCH_X64 OR RAPIDFUZZ_ARCH_X86) - create_cython_target(fuzz_cpp_avx2) - rf_add_library(fuzz_cpp_avx2 ${fuzz_cpp_avx2}) - target_compile_features(fuzz_cpp_avx2 PUBLIC cxx_std_17) + # on macOs this generates illegal instructions https://github.com/rapidfuzz/RapidFuzz/issues/383 + if(NOT APPLE) + create_cython_target(fuzz_cpp_avx2) + rf_add_library(fuzz_cpp_avx2 ${fuzz_cpp_avx2}) + target_compile_features(fuzz_cpp_avx2 PUBLIC cxx_std_17) - if(MSVC) - set_target_properties(fuzz_cpp_avx2 PROPERTIES COMPILE_FLAGS "/arch:AVX2") - else() - set_target_properties(fuzz_cpp_avx2 PROPERTIES COMPILE_FLAGS "-mavx2") - endif() + if(MSVC) + set_target_properties(fuzz_cpp_avx2 PROPERTIES COMPILE_FLAGS "/arch:AVX2") + else() + set_target_properties(fuzz_cpp_avx2 PROPERTIES COMPILE_FLAGS "-mavx2") + endif() - target_include_directories(fuzz_cpp_avx2 PRIVATE ${RF_BASE_DIR}/rapidfuzz) - target_link_libraries(fuzz_cpp_avx2 PRIVATE rapidfuzz::rapidfuzz) - install(TARGETS fuzz_cpp_avx2 LIBRARY DESTINATION src/rapidfuzz) + target_include_directories(fuzz_cpp_avx2 PRIVATE ${RF_BASE_DIR}/rapidfuzz) + target_link_libraries(fuzz_cpp_avx2 PRIVATE rapidfuzz::rapidfuzz) + install(TARGETS fuzz_cpp_avx2 LIBRARY DESTINATION src/rapidfuzz) + endif() endif() if(RAPIDFUZZ_ARCH_X86) diff --git a/src/rapidfuzz/distance/CMakeLists.txt b/src/rapidfuzz/distance/CMakeLists.txt index 7deacb48..f849161c 100644 --- a/src/rapidfuzz/distance/CMakeLists.txt +++ b/src/rapidfuzz/distance/CMakeLists.txt @@ -51,22 +51,25 @@ target_link_libraries(metrics_cpp PRIVATE rapidfuzz::rapidfuzz) install(TARGETS metrics_cpp LIBRARY DESTINATION src/rapidfuzz/distance) if(RAPIDFUZZ_ARCH_X64 OR RAPIDFUZZ_ARCH_X86) - create_cython_target(metrics_cpp_avx2) - rf_add_library(metrics_cpp_avx2 ${metrics_cpp_avx2}) - target_compile_features(metrics_cpp_avx2 PUBLIC cxx_std_17) + # on macOs this generates illegal instructions https://github.com/rapidfuzz/RapidFuzz/issues/383 + if(NOT APPLE) + create_cython_target(metrics_cpp_avx2) + rf_add_library(metrics_cpp_avx2 ${metrics_cpp_avx2}) + target_compile_features(metrics_cpp_avx2 PUBLIC cxx_std_17) - if(MSVC) - set_target_properties(metrics_cpp_avx2 PROPERTIES COMPILE_FLAGS - "/arch:AVX2") - else() - set_target_properties(metrics_cpp_avx2 PROPERTIES COMPILE_FLAGS "-mavx2") - endif() + if(MSVC) + set_target_properties(metrics_cpp_avx2 PROPERTIES COMPILE_FLAGS + "/arch:AVX2") + else() + set_target_properties(metrics_cpp_avx2 PROPERTIES COMPILE_FLAGS "-mavx2") + endif() - target_include_directories( - metrics_cpp_avx2 PRIVATE ${RF_BASE_DIR}/rapidfuzz - ${RF_BASE_DIR}/rapidfuzz/distance) - target_link_libraries(metrics_cpp_avx2 PRIVATE rapidfuzz::rapidfuzz) - install(TARGETS metrics_cpp_avx2 LIBRARY DESTINATION src/rapidfuzz/distance) + target_include_directories( + metrics_cpp_avx2 PRIVATE ${RF_BASE_DIR}/rapidfuzz + ${RF_BASE_DIR}/rapidfuzz/distance) + target_link_libraries(metrics_cpp_avx2 PRIVATE rapidfuzz::rapidfuzz) + install(TARGETS metrics_cpp_avx2 LIBRARY DESTINATION src/rapidfuzz/distance) + endif() endif() if(RAPIDFUZZ_ARCH_X86)