Skip to content

Commit b2db6bf

Browse files
committed
CI: Fortran 2018 testing
This patch enables Fortran 2018 standard compliance testing. We could do 2023, but our current CI of choice doesn't yet have a compiler which can do this. The actual content of this PR is a decoupling of FCFLAGS_DEBUG and FCFLAGS_FMS. There is now a default FCFLAGS macro which is used by the other two macros. One can now optionally configure FCFLAGS_DEBUG without worrying about the impact on FCFLAGS_FMS. The motivation here is that we don't want to test for F2018/2023 compliance in FMS.
1 parent b67e93a commit b2db6bf

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/actions/ubuntu-setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
run: |
2424
echo "::group::config.mk"
2525
cd .testing
26-
echo "FCFLAGS_DEBUG = -g -O0 -Wextra -Wno-compare-reals -fbacktrace -ffpe-trap=invalid,zero,overflow -fcheck=bounds" >> config.mk
26+
echo "FCFLAGS_DEBUG = -g -O0 -std=f2018 -Wextra -Wno-compare-reals -fbacktrace -ffpe-trap=invalid,zero,overflow -fcheck=bounds" >> config.mk
2727
echo "FCFLAGS_REPRO = -g -O2 -fbacktrace" >> config.mk
2828
echo "FCFLAGS_INIT = -finit-real=snan -finit-integer=2147483647 -finit-derived" >> config.mk
2929
echo "FCFLAGS_FMS = -g -fbacktrace -O0" >> config.mk

.testing/Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,21 @@ export FMS_URL
8383
# TODO: This needs more automated configuration
8484
MPIRUN ?= mpirun
8585

86-
# Generic compiler variables are pass through to the builds
86+
# Generic compiler variables are passed through to the builds
8787
export CC
8888
export MPICC
8989
export FC
9090
export MPIFC
9191

9292
# Builds are distinguished by FCFLAGS
93-
FCFLAGS_DEBUG ?= -g -O0
93+
FCFLAGS ?= -g -O0
94+
95+
FCFLAGS_DEBUG ?= $(FCFLAGS)
9496
FCFLAGS_REPRO ?= -g -O2
9597
FCFLAGS_OPT ?= -g -O3 -mavx -fno-omit-frame-pointer
9698
FCFLAGS_INIT ?=
9799
FCFLAGS_COVERAGE ?= -g -O0 -fbacktrace --coverage
98-
FCFLAGS_FMS ?= $(FCFLAGS_DEBUG)
100+
FCFLAGS_FMS ?= $(FCFLAGS)
99101
# Additional notes:
100102
# - These default values are simple, minimalist flags, supported by nearly all
101103
# compilers, and are somewhat analogous to GFDL's DEBUG and REPRO builds.

0 commit comments

Comments
 (0)