Skip to content

Commit 1ac66f6

Browse files
committed
Fix for mac fortran compiler
1 parent 94d65ce commit 1ac66f6

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/test.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,17 @@ jobs:
4646
4747
# --- 4a. Build and Test (Unix: Linux / macOS) ---
4848
- name: Configure CMake (Unix)
49-
if: runner.os != 'Windows'
50-
env:
51-
FC: gfortran
49+
if: matrix.os != 'windows-latest'
5250
run: |
51+
if [ "$RUNNER_OS" == "macOS" ]; then
52+
# Dynamically find Homebrew's gfortran (handles gfortran-13, gfortran-14, etc.)
53+
export FC=$(ls $(brew --prefix)/bin/gfortran* | sort -V | tail -n 1)
54+
else
55+
export FC=gfortran
56+
fi
57+
58+
echo "Using Fortran compiler: $FC"
59+
5360
cmake -B build -S . \
5461
-G Ninja \
5562
-DCMAKE_BUILD_TYPE=Release

0 commit comments

Comments
 (0)