Skip to content

Commit 66c9f5b

Browse files
authored
Merge branch 'main' into install-info
2 parents 152d2a1 + cc127ca commit 66c9f5b

5 files changed

Lines changed: 144 additions & 105 deletions

File tree

.github/workflows/build.yml

Lines changed: 130 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -7,101 +7,102 @@ defaults:
77
shell: bash
88

99
jobs:
10+
setup: # establish default configuration values, independent of repo/org
11+
name: Setup
12+
runs-on: ubuntu-latest
13+
outputs:
14+
# The LLVM Flang version on Homebrew : https://formulae.brew.sh/formula/flang
15+
BREW_FLANG_VERSION: ${{ steps.vars.outputs.BREW_FLANG_VERSION }}
16+
steps:
17+
- name: Set default configuration variables
18+
id: vars
19+
run: echo "BREW_FLANG_VERSION=22" >> $GITHUB_OUTPUT
20+
1021
build:
11-
name: ${{ matrix.compiler }}-${{ matrix.version }} ${{ matrix.network }} (${{ matrix.os }}) ${{ matrix.label }}
22+
name: ${{ matrix.compiler }}-${{ matrix.version || needs.setup.outputs.BREW_FLANG_VERSION }} ${{ matrix.network || '' }} (${{ matrix.os }}) ${{ matrix.label }}
23+
needs: setup
1224
runs-on: ${{ matrix.os }}
1325
strategy:
1426
fail-fast: false
1527
matrix:
1628
os: [ macos-14, macos-15, macos-15-intel, macos-26, macos-26-intel, ubuntu-24.04 ]
1729
compiler: [ gfortran ]
1830
version: [ 13, 14, 15 ]
19-
network: [ smp ]
2031
include:
2132

2233
# --- flang coverage ---
2334
- os: macos-14
2435
compiler: flang
25-
version: 22
26-
network: smp
27-
native_multi_image: 1
2836
brew_via_install: 1
29-
FFLAGS: -fcoarray
3037
- os: macos-15
3138
compiler: flang
32-
version: 22
33-
network: smp
3439
brew_via_install: 1
35-
native_multi_image: 1
36-
FFLAGS: -fcoarray
3740
- os: macos-15-intel
3841
compiler: flang
39-
version: 22
40-
network: smp
4142
brew_via_install: 1
42-
native_multi_image: 1
43-
FFLAGS: -fcoarray
4443
- os: macos-26
4544
compiler: flang
46-
version: 22
47-
network: smp
4845
brew_via_install: 1
49-
native_multi_image: 1
50-
FFLAGS: -fcoarray
5146
- os: macos-26-intel
5247
compiler: flang
53-
version: 22
54-
network: smp
5548
brew_via_install: 1
56-
native_multi_image: 1
57-
FFLAGS: -fcoarray
49+
50+
- os: ubuntu-24.04
51+
compiler: flang
52+
label: Homebrew
53+
brew_via_install: 1
5854

5955
# https://hub.docker.com/r/snowstep/llvm/tags
6056
- os: ubuntu-24.04
6157
compiler: flang
6258
version: latest
63-
network: smp
64-
native_multi_image: 1
65-
FFLAGS: -fcoarray
6659
container: snowstep/llvm:ubuntu-24.04-latest
6760

6861
# https://hub.docker.com/r/phhargrove/llvm-flang/tags
6962
- os: ubuntu-24.04
7063
compiler: flang
7164
version: 22
72-
network: smp
73-
native_multi_image: 1
74-
FFLAGS: -fcoarray
7565
container: phhargrove/llvm-flang:22.1.3-latest
7666
- os: ubuntu-24.04
7767
compiler: flang
7868
version: 21
79-
network: smp
8069
container: phhargrove/llvm-flang:21.1.0-latest
8170
- os: ubuntu-24.04
8271
compiler: flang
8372
version: 20
84-
network: smp
8573
container: phhargrove/llvm-flang:20.1.0-latest
8674
- os: ubuntu-24.04
8775
compiler: flang
8876
version: 19
89-
network: smp
9077
FFLAGS: -mmlir -allow-assumed-rank
9178
container: phhargrove/llvm-flang:19.1.1-latest
9279

80+
# --- lfortran coverage ---
81+
82+
# https://github.com/lfortran/lfortran/pkgs/container/lfortran
83+
- os: ubuntu-22.04
84+
compiler: lfortran
85+
version: latest
86+
container: ghcr.io/lfortran/lfortran:latest
87+
88+
# https://hub.docker.com/r/phhargrove/lfortran/tags
89+
- os: ubuntu-24.04
90+
compiler: lfortran
91+
version: 0.62
92+
container: phhargrove/lfortran:0.62.0-1
93+
# workaround LFortran issue #11079
94+
iso_fortran_header: https://raw.githubusercontent.com/lfortran/lfortran/refs/tags/v0.62.0/src/libasr/runtime/ISO_Fortran_binding.h
95+
9396
# --- PRIF-old coverage ---
9497
- os: ubuntu-24.04
9598
compiler: flang
9699
version: 21
97-
network: smp
98100
label: PRIF-0.5
99101
FFLAGS: -DFORCE_PRIF_0_5
100102
container: phhargrove/llvm-flang:21.1.0-latest
101103
- os: ubuntu-24.04
102104
compiler: flang
103105
version: 21
104-
network: smp
105106
label: PRIF-0.6
106107
FFLAGS: -DFORCE_PRIF_0_6
107108
container: phhargrove/llvm-flang:21.1.0-latest
@@ -123,28 +124,16 @@ jobs:
123124

124125
- os: macos-15-intel
125126
compiler: flang
126-
version: 22
127127
network: udp
128-
native_multi_image: 1
129-
FFLAGS: -fcoarray
130128
- os: macos-15
131129
compiler: flang
132-
version: 22
133130
network: udp
134-
native_multi_image: 1
135-
FFLAGS: -fcoarray
136131
- os: macos-26-intel
137132
compiler: flang
138-
version: 22
139133
network: udp
140-
native_multi_image: 1
141-
FFLAGS: -fcoarray
142134
- os: macos-26
143135
compiler: flang
144-
version: 22
145136
network: udp
146-
native_multi_image: 1
147-
FFLAGS: -fcoarray
148137

149138
- os: ubuntu-24.04
150139
compiler: flang
@@ -160,82 +149,55 @@ jobs:
160149
compiler: flang
161150
version: 22
162151
network: udp
163-
native_multi_image: 1
164-
FFLAGS: -fcoarray
165152
container: phhargrove/llvm-flang:22.1.0-latest
166153
- os: ubuntu-24.04
167154
compiler: flang
168155
version: latest
169156
network: udp
170-
native_multi_image: 1
171-
FFLAGS: -fcoarray
172157
container: snowstep/llvm:ubuntu-24.04-latest
173158

174159
container:
175160
image: ${{ matrix.container }}
176161

177162
env:
178-
COMPILER_VERSION: ${{ matrix.version }}
163+
COMPILER_VERSION: ${{ matrix.version || needs.setup.outputs.BREW_FLANG_VERSION }}
164+
NATIVE_MULTI_IMAGE: ${{ matrix.native_multi_image ||
165+
( matrix.compiler == 'flang' && ( ! matrix.version || matrix.version >= 22 || matrix.version == 'latest' ) )
166+
}}
179167
FFLAGS: ${{ matrix.FFLAGS }}
180168
PREFIX: install
169+
NETWORK_ARG: ${{ matrix.network && format('--network={0}',matrix.network) || '' }}
170+
CURL_OPTIONS: -L --retry 10 --retry-all-errors --fail
181171
GASNET_CONFIGURE_ARGS: --enable-rpath --enable-debug
182172
GASNET_SPAWN_VERBOSE: 1
183173
GASNET_SPAWNFN: L
184174
GASNET_MASTERIP: 127.0.0.1
185175
CAF_IMAGES: 8
186176

187177
steps:
188-
- name: Set gfortran variables
189-
if: matrix.compiler == 'gfortran'
190-
run: |
191-
set -x
192-
echo "FC=gfortran-${COMPILER_VERSION}" >> "$GITHUB_ENV"
193-
echo "CC=gcc-${COMPILER_VERSION}" >> "$GITHUB_ENV"
194-
echo "CXX=g++-${COMPILER_VERSION}" >> "$GITHUB_ENV"
195-
# XCode 26 / gfortran bug workaround
196-
if [[ ${{ matrix.os }} =~ macos-26 ]] ; then \
197-
echo "GASNET_CONFIGURE_ARGS=$GASNET_CONFIGURE_ARGS --enable-force-posix-realtime" >> "$GITHUB_ENV" ; \
198-
fi
178+
- name: Checkout code
179+
uses: actions/checkout@v1
199180

200-
- name: Set flang variables
201-
if: ${{ matrix.compiler == 'flang' && !matrix.brew_via_install }}
202-
run: |
203-
set -x
204-
echo "FC=flang-new" >> "$GITHUB_ENV"
205-
echo "CC=clang" >> "$GITHUB_ENV"
206-
echo "CXX=clang++" >> "$GITHUB_ENV"
181+
##########################################################################
182+
# Establish Dependencies
207183

208-
- name: Set Caffeine variables
184+
- name: Install Ubuntu Container Dependencies
185+
if: ${{ contains(matrix.os, 'ubuntu') && matrix.container != '' && !contains(matrix.container, 'phhargrove') }}
209186
run: |
210187
set -x
211-
# docker instances cannot handle high levels of subjob parallelism
212-
if test -n "${{ matrix.container }}"; then \
213-
echo "SUBJOB_PREFIX=CAF_IMAGES=2" >> "$GITHUB_ENV" ; \
214-
fi
215-
# disable shared-memory bypass with network=udp to simulate multi-node runs
216-
if test "${{ matrix.network }}" = "udp"; then \
217-
echo "GASNET_SUPERNODE_MAXSIZE=1" >> "$GITHUB_ENV" ; \
218-
fi
219-
# Turn some knobs for a compiler that natively uses PRIF for multi-image features:
220-
# HAVE_MULTI_IMAGE : controls app/native-multi-image and prif_init testing
221-
# HAVE_MULTI_IMAGE_SUPPORT : force-enable Julienne's multi-image support
222-
if (( ${{ matrix.native_multi_image }} )); then \
223-
echo "FFLAGS=$FFLAGS -DHAVE_MULTI_IMAGE -DHAVE_MULTI_IMAGE_SUPPORT" >> "$GITHUB_ENV" ; \
224-
fi
225-
226-
- name: Checkout code
227-
uses: actions/checkout@v1
188+
apt update
189+
apt install -y build-essential pkg-config make git curl
228190
229191
- name: Install Ubuntu Native Dependencies
230-
if: ${{ contains(matrix.os, 'ubuntu') && matrix.container == '' }}
192+
if: ${{ contains(matrix.os, 'ubuntu') && matrix.container == '' && !matrix.brew_via_install }}
231193
run: |
232194
set -x
233195
sudo apt update
234196
sudo apt install -y build-essential pkg-config make
235197
if [[ ${COMPILER_VERSION} < 15 ]] ; then \
236198
sudo apt install -y gfortran-${COMPILER_VERSION} g++-${COMPILER_VERSION} ; \
237199
else \
238-
curl -L https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o install-homebrew.sh ; \
200+
curl $CURL_OPTIONS https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o install-homebrew.sh ; \
239201
chmod +x install-homebrew.sh ; \
240202
env CI=1 ./install-homebrew.sh ; \
241203
HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew" ; \
@@ -251,13 +213,6 @@ jobs:
251213
echo "LDFLAGS=${LDFLAGS:+"$LDFLAGS" }-B ${HOMEBREW_BINUTILS}" >> "$GITHUB_ENV" ; \
252214
fi
253215
254-
- name: Install Ubuntu Container Dependencies
255-
if: ${{ contains(matrix.os, 'ubuntu') && matrix.container != '' && !contains(matrix.container, 'phhargrove') }}
256-
run: |
257-
set -x
258-
apt update
259-
apt install -y build-essential pkg-config make git curl
260-
261216
- name: Install macOS Dependencies
262217
if: ${{ contains(matrix.os, 'macos') && !matrix.brew_via_install }}
263218
run: |
@@ -291,6 +246,80 @@ jobs:
291246
gfortran-14 -o fpm-temp/fpm fpm-$FPM_VERSION.F90
292247
echo "PATH=${PWD}/fpm-temp:${PATH}" >> "$GITHUB_ENV"
293248
249+
##########################################################################
250+
# Set Install Variables
251+
252+
- name: Set gfortran variables
253+
if: matrix.compiler == 'gfortran'
254+
run: |
255+
set -x
256+
echo "FC=gfortran-${COMPILER_VERSION}" >> "$GITHUB_ENV"
257+
echo "CC=gcc-${COMPILER_VERSION}" >> "$GITHUB_ENV"
258+
echo "CXX=g++-${COMPILER_VERSION}" >> "$GITHUB_ENV"
259+
# XCode 26 / gfortran bug workaround
260+
if [[ ${{ matrix.os }} =~ macos-26 ]] ; then \
261+
echo "GASNET_CONFIGURE_ARGS=$GASNET_CONFIGURE_ARGS --enable-force-posix-realtime" >> "$GITHUB_ENV" ; \
262+
fi
263+
264+
- name: Set flang variables
265+
if: ${{ matrix.compiler == 'flang' }}
266+
run: |
267+
set -x
268+
if [ -z "${{ matrix.brew_via_install }}" ] ; then
269+
echo "FC=flang-new" >> "$GITHUB_ENV"
270+
echo "CC=clang" >> "$GITHUB_ENV"
271+
echo "CXX=clang++" >> "$GITHUB_ENV"
272+
fi
273+
if [ "${NATIVE_MULTI_IMAGE}" == true ] ; then
274+
echo "FFLAGS=$FFLAGS -fcoarray" >> "$GITHUB_ENV"
275+
fi
276+
277+
- name: Setup lfortran dependencies and variables
278+
if: ${{ matrix.compiler == 'lfortran' }}
279+
run: |
280+
set -x
281+
apt update
282+
apt install -y llvm clang
283+
if [ ${{ contains(matrix.container, 'ghcr.io/lfortran') }} = true ]; then
284+
ls -alR /app
285+
# Add container lfortran to PATH:
286+
PATH="/app/bin:$PATH"
287+
echo "/app/bin" >> "$GITHUB_PATH"
288+
fi
289+
echo "FC=lfortran" >> "$GITHUB_ENV"
290+
echo "CC=clang" >> "$GITHUB_ENV"
291+
echo "CXX=clang++" >> "$GITHUB_ENV"
292+
HEADER_NAME=ISO_Fortran_binding.h
293+
HEADER_TARGET=include/$HEADER_NAME
294+
if [ -n "${{ matrix.iso_fortran_header }}" ]; then
295+
curl $CURL_OPTIONS "${{ matrix.iso_fortran_header }}" -o $HEADER_TARGET
296+
else
297+
HEADER_SOURCE=$(lfortran --print-c-include-dir)/$HEADER_NAME
298+
echo "#include <$HEADER_SOURCE>" > $HEADER_TARGET
299+
fi
300+
find / -name $HEADER_NAME -exec ls -al {} \; -exec md5sum {} \; -exec head {} \; -exec echo --- \;
301+
302+
- name: Set Caffeine variables
303+
run: |
304+
set -x
305+
# docker instances cannot handle high levels of subjob parallelism
306+
if test -n "${{ matrix.container }}"; then \
307+
echo "SUBJOB_PREFIX=CAF_IMAGES=2" >> "$GITHUB_ENV" ; \
308+
fi
309+
# disable shared-memory bypass with network=udp to simulate multi-node runs
310+
if test "${{ matrix.network }}" = "udp"; then \
311+
echo "GASNET_SUPERNODE_MAXSIZE=1" >> "$GITHUB_ENV" ; \
312+
fi
313+
# Turn some knobs for a compiler that natively uses PRIF for multi-image features:
314+
# HAVE_MULTI_IMAGE : controls app/native-multi-image and prif_init testing
315+
# HAVE_MULTI_IMAGE_SUPPORT : force-enable Julienne's multi-image support
316+
if [ "${NATIVE_MULTI_IMAGE}" == true ] ; then
317+
echo "FFLAGS=$FFLAGS -DHAVE_MULTI_IMAGE -DHAVE_MULTI_IMAGE_SUPPORT" >> "$GITHUB_ENV" ; \
318+
fi
319+
320+
##########################################################################
321+
# Caffeine Install
322+
294323
- name: Version info (pre-build)
295324
run: |
296325
echo == TOOL VERSIONS ==
@@ -311,7 +340,10 @@ jobs:
311340
for var in FC CC CXX FFLAGS CPPFLAGS CFLAGS CXXFLAGS LDFLAGS LIBS GASNET_CONFIGURE_ARGS ; do \
312341
eval echo "$var=\$$var"; done
313342
set -x
314-
./install.sh --prefix=${PREFIX} --network=${{ matrix.network }} --verbose
343+
./install.sh --prefix=${PREFIX} ${NETWORK_ARG} --verbose
344+
345+
##########################################################################
346+
# Caffeine Testing
315347

316348
- name: Version info (run-fpm)
317349
run: |
@@ -324,7 +356,7 @@ jobs:
324356
./run-fpm.sh run --verbose --example hello
325357
326358
- name: Run native multi-image test
327-
if: ${{ matrix.native_multi_image }}
359+
if: ${{ env.NATIVE_MULTI_IMAGE == 'true' }}
328360
run: |
329361
set -x ; ./run-fpm.sh run --verbose 2>&1 | tee output ; \
330362
test ${PIPESTATUS[0]} = 0 && \
@@ -375,6 +407,6 @@ jobs:
375407
for var in FC CC CXX FFLAGS CPPFLAGS CFLAGS LDFLAGS LIBS GASNET_CONFIGURE_ARGS ; do \
376408
eval echo "$var=\$$var"; done
377409
set -x
378-
./install.sh --prefix=${PREFIX} --network=${{ matrix.network }} --enable-threads --verbose
410+
./install.sh --prefix=${PREFIX} ${NETWORK_ARG} --enable-threads --verbose
379411
./run-fpm.sh test --verbose --
380412

0 commit comments

Comments
 (0)