Skip to content

Commit 89c9a9d

Browse files
committed
CI: Use Homebrew to install gfortran 15 on Ubuntu
1 parent 705f0c4 commit 89c9a9d

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: [macos-13, macos-14, macos-15, macos-15-intel, ubuntu-24.04]
16+
os: [ macos-13, macos-14, macos-15, macos-15-intel, ubuntu-24.04 ]
1717
compiler: [ gfortran ]
1818
version: [ 13, 14, 15 ]
1919
network: [ smp ]
2020
exclude:
2121
- os: macos-15 # gcc-13 broken on macos-15
2222
version: 13
23-
- os: ubuntu-24.04 # no package available for gfortran 15 (yet?)
24-
version: 15
2523
include:
2624
# --- flang coverage ---
2725
- os: macos-14
@@ -73,6 +71,10 @@ jobs:
7371
compiler: gfortran
7472
version: 14
7573
network: udp
74+
- os: ubuntu-24.04
75+
compiler: gfortran
76+
version: 15
77+
network: udp
7678
- os: ubuntu-24.04
7779
compiler: gfortran
7880
version: 14
@@ -161,7 +163,24 @@ jobs:
161163
run: |
162164
set -x
163165
sudo apt update
164-
sudo apt install -y build-essential gfortran-${COMPILER_VERSION} g++-${COMPILER_VERSION} pkg-config make
166+
sudo apt install -y build-essential pkg-config make
167+
if [[ ${COMPILER_VERSION} < 15 ]] ; then \
168+
sudo apt install -y gfortran-${COMPILER_VERSION} g++-${COMPILER_VERSION} ; \
169+
else \
170+
curl -L https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o install-homebrew.sh ; \
171+
chmod +x install-homebrew.sh ; \
172+
env CI=1 ./install-homebrew.sh ; \
173+
HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew" ; \
174+
${HOMEBREW_PREFIX}/bin/brew install -v gcc@${COMPILER_VERSION} binutils ; \
175+
ls -al ${HOMEBREW_PREFIX}/bin ; \
176+
echo "PATH=${HOMEBREW_PREFIX}/bin:${PATH}" >> "$GITHUB_ENV" ; \
177+
: Homebrew GCC@15 needs binutils 2.44+ ; \
178+
HOMEBREW_BINUTILS=$(ls -d ${HOMEBREW_PREFIX}/Cellar/binutils/2.*/bin ) ; \
179+
ls -al ${HOMEBREW_BINUTILS} ; \
180+
echo "FFLAGS=$FFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV" ; \
181+
echo "CFLAGS=$CFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV" ; \
182+
echo "CXXFLAGS=$CXXFLAGS -B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV" ; \
183+
fi
165184
166185
- name: Install Ubuntu Container Dependencies
167186
if: ${{ contains(matrix.os, 'ubuntu') && matrix.container != '' && !contains(matrix.container, 'phhargrove') }}

0 commit comments

Comments
 (0)