From 3ed81d004db99864c2cf8065a401c5967d3a60ae Mon Sep 17 00:00:00 2001 From: Dan Bonachea Date: Sat, 12 Jul 2025 10:27:22 -0700 Subject: [PATCH 1/3] CI: Add macos-15 --- .github/workflows/build.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b94223b..e061416 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,10 +10,17 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-13, macos-14, ubuntu-22.04, ubuntu-24.04] + os: [macos-13, macos-14, macos-15, ubuntu-22.04, ubuntu-24.04] compiler: [ gfortran ] version: [ 12, 13, 14 ] extra_flags: [ -ffree-line-length-0 ] + + exclude: + - os: ubuntu-22.04 + version: 13 # no package available + - os: ubuntu-22.04 + version: 14 # no package available + include: # https://hub.docker.com/r/phhargrove/llvm-flang/tags - os: ubuntu-24.04 @@ -45,12 +52,6 @@ jobs: extra_flags: -g container: intel/fortran-essentials:2025.0.0-0-devel-ubuntu22.04 - exclude: - - os: ubuntu-22.04 - version: 13 # no package available - - os: ubuntu-22.04 - version: 14 # no package available - container: image: ${{ matrix.container }} @@ -90,12 +91,14 @@ jobs: - name: Setup FPM uses: fortran-lang/setup-fpm@main - if: ${{ matrix.os != 'macos-14' }} + if: ${{ !contains(matrix.os, 'macos') || matrix.os == 'macos-13' }} with: github-token: ${{ secrets.GITHUB_TOKEN }} + fpm-version: latest - name: Build FPM - if: ${{ matrix.os == 'macos-14' }} # no arm64 fpm distro, build from source + # no macos-arm64 fpm distro, build from source + if: ${{ contains(matrix.os, 'macos') && matrix.os != 'macos-13' }} run: | set -x curl --retry 5 -LOsS https://github.com/fortran-lang/fpm/releases/download/v0.11.0/fpm-0.11.0.F90 From 699b0ac1cd3fdf2109633abdc3ac9054f51ac6d0 Mon Sep 17 00:00:00 2001 From: Dan Bonachea Date: Sat, 12 Jul 2025 21:25:10 -0700 Subject: [PATCH 2/3] CI: Better factorization of extra_flags --- .github/workflows/build.yml | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e061416..280d447 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: os: [macos-13, macos-14, macos-15, ubuntu-22.04, ubuntu-24.04] compiler: [ gfortran ] version: [ 12, 13, 14 ] - extra_flags: [ -ffree-line-length-0 ] + extra_flags: [ -g ] exclude: - os: ubuntu-22.04 @@ -26,7 +26,6 @@ jobs: - os: ubuntu-24.04 compiler: flang version: 20 - extra_flags: -g container: phhargrove/llvm-flang:20.1.0-1 - os: ubuntu-24.04 compiler: flang @@ -37,27 +36,25 @@ jobs: # compiler: flang # version: new # container: gmao/llvm-flang:latest -# extra_flags: -g - os: ubuntu-24.04 compiler: ifx version: 2025.1.0 error_stop_code: 128 - extra_flags: -g container: intel/fortran-essentials:2025.1.0-0-devel-ubuntu24.04 #container: intel/oneapi-hpckit:2025.1.0-0-devel-ubuntu24.04 - os: ubuntu-22.04 compiler: ifx version: 2025.0.0 error_stop_code: 128 - extra_flags: -g container: intel/fortran-essentials:2025.0.0-0-devel-ubuntu22.04 container: image: ${{ matrix.container }} env: - GCC_VERSION: ${{ matrix.version }} + COMPILER_VERSION: ${{ matrix.version }} FC: ${{ matrix.compiler }} + FFLAGS: ${{ matrix.extra_flags }} FPM_FLAGS: --profile release --verbose steps: @@ -69,9 +66,9 @@ jobs: run: | sudo apt-get update sudo apt list -a 'gfortran-*' - sudo apt install -y gfortran-${GCC_VERSION} build-essential - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 100 \ - --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_VERSION} + sudo apt install -y gfortran-${COMPILER_VERSION} build-essential + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${COMPILER_VERSION} 100 \ + --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${COMPILER_VERSION} - name: Setup Compilers run: | @@ -81,7 +78,8 @@ jobs: elif test "$FC" = "ifx" ; then \ echo "FPM_FC=ifx" >> "$GITHUB_ENV" ; \ else \ - echo "FPM_FC=gfortran-${GCC_VERSION}" >> "$GITHUB_ENV" ; \ + echo "FPM_FC=gfortran-${COMPILER_VERSION}" >> "$GITHUB_ENV" ; \ + echo "FFLAGS=-ffree-line-length-0 $FFLAGS" >> "$GITHUB_ENV" ; \ fi if test -n "${{ matrix.error_stop_code }}" ; then \ echo "ERROR_STOP_CODE=${{ matrix.error_stop_code }}" >> "$GITHUB_ENV" ; \ @@ -118,22 +116,22 @@ jobs: - name: Build and Test (Assertions OFF) run: | set -x - fpm test ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }}" - fpm run --example false-assertion ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }}" - fpm run --example invoke-via-macro ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }}" + fpm test ${FPM_FLAGS} --flag "$FFLAGS" + fpm run --example false-assertion ${FPM_FLAGS} --flag "$FFLAGS" + fpm run --example invoke-via-macro ${FPM_FLAGS} --flag "$FFLAGS" - name: Build and Test (Assertions ON) env: FPM_FLAGS: ${{ env.FPM_FLAGS }} --flag -DASSERTIONS run: | set -x - fpm test ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }}" - ( set +e ; fpm run --example false-assertion ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }}" ; test $? = $ERROR_STOP_CODE ) - ( set +e ; fpm run --example invoke-via-macro ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }}" ; test $? = $ERROR_STOP_CODE ) + fpm test ${FPM_FLAGS} --flag "$FFLAGS" + ( set +e ; fpm run --example false-assertion ${FPM_FLAGS} --flag "$FFLAGS" ; test $? = $ERROR_STOP_CODE ) + ( set +e ; fpm run --example invoke-via-macro ${FPM_FLAGS} --flag "$FFLAGS" ; test $? = $ERROR_STOP_CODE ) - name: Test Assertions w/ Parallel Callbacks env: FPM_FLAGS: ${{ env.FPM_FLAGS }} --flag -DASSERTIONS --flag -DASSERT_MULTI_IMAGE --flag -DASSERT_PARALLEL_CALLBACKS run: | set -x - ( set +e ; fpm run --example false-assertion ${FPM_FLAGS} --flag "${{ matrix.EXTRA_FLAGS }}" ; test $? = $ERROR_STOP_CODE ) + ( set +e ; fpm run --example false-assertion ${FPM_FLAGS} --flag "$FFLAGS" ; test $? = $ERROR_STOP_CODE ) From db1d5cb663ea17198f2237b89d5351eea54254f7 Mon Sep 17 00:00:00 2001 From: Dan Bonachea Date: Sat, 12 Jul 2025 23:02:04 -0700 Subject: [PATCH 3/3] CI: Add more flang coverage --- .github/workflows/build.yml | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 280d447..9765e2d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,28 @@ jobs: version: 14 # no package available include: + # --- LLVM flang coverage --- + + - os: macos-13 + compiler: flang + version: 20 + - os: macos-14 + compiler: flang + version: 20 + - os: macos-15 + compiler: flang + version: 20 + + # https://hub.docker.com/r/snowstep/llvm/tags + - os: ubuntu-24.04 + compiler: flang + version: latest + container: snowstep/llvm:noble + - os: ubuntu-22.04 + compiler: flang + version: latest + container: snowstep/llvm:jammy + # https://hub.docker.com/r/phhargrove/llvm-flang/tags - os: ubuntu-24.04 compiler: flang @@ -36,6 +58,9 @@ jobs: # compiler: flang # version: new # container: gmao/llvm-flang:latest + + # --- Intel coverage --- + - os: ubuntu-24.04 compiler: ifx version: 2025.1.0 @@ -70,6 +95,26 @@ jobs: sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${COMPILER_VERSION} 100 \ --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${COMPILER_VERSION} + + - name: Install Ubuntu Container Dependencies + if: ${{ contains(matrix.os, 'ubuntu') && matrix.container != '' && !contains(matrix.container, 'phhargrove') }} + run: | + set -x + apt update + apt install -y build-essential pkg-config make git curl + + - name: Install macOS Dependencies + if: contains(matrix.os, 'macos') && matrix.compiler == 'flang' + run: | + set -x + brew update + brew install llvm@${COMPILER_VERSION} flang + # workaround issue #228: clang cannot find homebrew flang's C header + for p in /opt/homebrew /usr/local $(brew --prefix) ; do find $p/Cellar/flang -name ISO_Fortran_binding.h 2>/dev/null || true ; done + echo "CFLAGS=-I$(dirname $(find $(brew --prefix)/Cellar/flang -name ISO_Fortran_binding.h | head -1)) ${CFLAGS}" >> "$GITHUB_ENV" + # Prepend homebrew clang to PATH: + echo "PATH=$(brew --prefix)/opt/llvm/bin:${PATH}" >> "$GITHUB_ENV" + - name: Setup Compilers run: | set -x