From 2623b4081a1b299f0593ecf1c437f9577672f06a Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Wed, 18 Sep 2024 15:00:37 +0200 Subject: [PATCH 1/3] [INFRA] Use macos-14 macos-14 uses ARM processors (M1) --- .github/workflows/ci_macos.yml | 2 +- .github/workflows/ci_sanitizer.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_macos.yml b/.github/workflows/ci_macos.yml index cf582456..c9ac3a07 100644 --- a/.github/workflows/ci_macos.yml +++ b/.github/workflows/ci_macos.yml @@ -27,7 +27,7 @@ defaults: jobs: build: name: ${{ matrix.compiler }} - runs-on: macos-12 + runs-on: macos-14 if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint' strategy: fail-fast: false diff --git a/.github/workflows/ci_sanitizer.yml b/.github/workflows/ci_sanitizer.yml index 190ef61f..ac8d7085 100644 --- a/.github/workflows/ci_sanitizer.yml +++ b/.github/workflows/ci_sanitizer.yml @@ -32,11 +32,11 @@ jobs: fail-fast: false matrix: name: [ASan, TSan, UBSan] - os: [ubuntu-latest, macos-12] + os: [ubuntu-latest, macos-14] build_type: [Release, RelWithDebInfo, Debug] exclude: - name: "TSan" - os: macos-12 + os: macos-14 include: - name: "ASan" @@ -46,14 +46,14 @@ jobs: cxx_flags: "-fno-omit-frame-pointer -fsanitize=thread" - name: "UBSan" - os: macos-12 + os: macos-14 cxx_flags: "-fno-omit-frame-pointer -fsanitize=undefined,float-divide-by-zero,implicit-conversion,local-bounds,nullability -Wno-pass-failed" - name: "UBSan" os: ubuntu-latest cxx_flags: "-fno-omit-frame-pointer -fsanitize=undefined,float-divide-by-zero" - - os: macos-12 + - os: macos-14 compiler: clang-18 - os: ubuntu-latest From e409f0bbf8cfe0069f70154f3269f53943b5df87 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Wed, 18 Sep 2024 16:22:39 +0200 Subject: [PATCH 2/3] [INFRA] Do not use native on M1 with gcc < 14 --- cmake/configuration.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmake/configuration.cmake b/cmake/configuration.cmake index a04a565e..19a62da3 100644 --- a/cmake/configuration.cmake +++ b/cmake/configuration.cmake @@ -228,8 +228,19 @@ else () set (HIBF_IS_DEBUG FALSE) endif () +# Apple M1 with GCC sets `march=apple-m1` when using `-march=native`. This option is only available with GCC >= 14. +if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm64" + AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14) + set (HIBF_M1_NO_NATIVE TRUE) +else () + set (HIBF_M1_NO_NATIVE FALSE) +endif () + option (HIBF_NATIVE_BUILD "Optimize build for current architecture." ON) -if (HIBF_IS_DEBUG) +if (HIBF_M1_NO_NATIVE) + hibf_config_print ("Optimize build: disabled (Apple M1 with GCC < 14)") +elseif (HIBF_IS_DEBUG) hibf_config_print ("Optimize build: disabled") elseif (HIBF_NATIVE_BUILD) set (HIBF_CXX_FLAGS "${HIBF_CXX_FLAGS} -march=native") From 7bc188b324d71fc7f10543dc25146b8d6a88b1a5 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Wed, 18 Sep 2024 19:01:40 +0200 Subject: [PATCH 3/3] [INFRA] Patch M1 GCC --- .github/workflows/ci_macos.yml | 7 ++++--- .github/workflows/ci_sanitizer.yml | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_macos.yml b/.github/workflows/ci_macos.yml index c9ac3a07..51a801ec 100644 --- a/.github/workflows/ci_macos.yml +++ b/.github/workflows/ci_macos.yml @@ -43,10 +43,11 @@ jobs: compiler: ${{ matrix.compiler }} ccache_size: 75M - - name: Install CMake - uses: seqan/actions/setup-cmake@main + - name: Patch M1 GCC + if: contains(matrix.compiler, 'gcc') && matrix.compiler != 'gcc-14' + uses: seqan/actions/patch-m1-gcc@main with: - cmake: 3.28.5 + compiler: ${{ matrix.compiler }} - name: Configure tests run: | diff --git a/.github/workflows/ci_sanitizer.yml b/.github/workflows/ci_sanitizer.yml index ac8d7085..a5e5bfcb 100644 --- a/.github/workflows/ci_sanitizer.yml +++ b/.github/workflows/ci_sanitizer.yml @@ -78,6 +78,12 @@ jobs: with: compiler: ${{ matrix.compiler }} + - name: Patch M1 GCC + if: contains(matrix.os, 'macos') && contains(matrix.compiler, 'gcc') && matrix.compiler != 'gcc-14' + uses: seqan/actions/patch-m1-gcc@main + with: + compiler: ${{ matrix.compiler }} + - name: Configure tests run: | mkdir build && cd build