diff --git a/.github/actions/testing-setup/action.yml b/.github/actions/testing-setup/action.yml index a21ee949db..8a3264b140 100644 --- a/.github/actions/testing-setup/action.yml +++ b/.github/actions/testing-setup/action.yml @@ -32,7 +32,7 @@ runs: run: | echo "::group::Compile FMS library" cd .testing - make deps/lib/libFMS.a -s -j + REPORT_ERROR_LOGS=true make deps/lib/libFMS.a -s -j echo "::endgroup::" - name: Store compiler flags used in Makefile diff --git a/.github/workflows/macos-regression.yml b/.github/workflows/macos-regression.yml index d975854e0c..e8f7469cca 100644 --- a/.github/workflows/macos-regression.yml +++ b/.github/workflows/macos-regression.yml @@ -8,8 +8,7 @@ jobs: runs-on: macOS-latest env: - CC: gcc-11 - FC: gfortran-11 + FC: gfortran defaults: run: diff --git a/.github/workflows/macos-stencil.yml b/.github/workflows/macos-stencil.yml index 33436c221f..e0fcfeef8e 100644 --- a/.github/workflows/macos-stencil.yml +++ b/.github/workflows/macos-stencil.yml @@ -8,8 +8,7 @@ jobs: runs-on: macOS-latest env: - CC: gcc-11 - FC: gfortran-11 + FC: gfortran defaults: run: diff --git a/.testing/Makefile b/.testing/Makefile index 150a365692..917feb311b 100644 --- a/.testing/Makefile +++ b/.testing/Makefile @@ -116,6 +116,9 @@ DO_COVERAGE ?= # Report failure if coverage report is not uploaded REQUIRE_COVERAGE_UPLOAD ?= +# Print logs if an error is encountered +REPORT_ERROR_LOGS ?= + # Time measurement (configurable by the CI) TIME ?= time @@ -330,7 +333,10 @@ $(TARGET_CODEBASE): # FMS # Set up the FMS build environment variables -FMS_ENV = PATH="${PATH}:$(realpath ../ac)" FCFLAGS="$(FCFLAGS_FMS)" +FMS_ENV = \ + PATH="${PATH}:$(realpath ../ac)" \ + FCFLAGS="$(FCFLAGS_FMS)" \ + REPORT_ERROR_LOGS="$(REPORT_ERROR_LOGS)" deps/lib/libFMS.a: deps/fms/build/libFMS.a $(MAKE) -C deps lib/libFMS.a diff --git a/ac/deps/Makefile b/ac/deps/Makefile index af567f6a72..84d43eb26d 100644 --- a/ac/deps/Makefile +++ b/ac/deps/Makefile @@ -14,13 +14,16 @@ FMS_COMMIT ?= 2019.01.03 # List of source files to link this Makefile's dependencies to model Makefiles # Assumes a depth of two, and the following extensions: F90 inc c h # (1): Root directory -# NOTE: extensions could be a second variable SOURCE = \ $(foreach ext,F90 inc c h,$(wildcard $(1)/*/*.$(ext) $(1)/*/*/*.$(ext))) FMS_SOURCE = $(call SOURCE,fms/src) +# If `true`, print logs if an error is encountered. +REPORT_ERROR_LOGS ?= + + #--- # Rules @@ -33,13 +36,8 @@ all: lib/libFMS.a # NOTE: We emulate the automake `make install` stage by storing libFMS.a to # ${srcdir}/deps/lib and copying module files to ${srcdir}/deps/include. -# This is a flawed approach, since module files are untracked and could be -# handled more safely, but this is adequate for now. - - -# TODO: track *.mod copy? lib/libFMS.a: fms/build/libFMS.a - mkdir -p {lib,include} + mkdir -p lib include cp fms/build/libFMS.a lib/libFMS.a cp fms/build/*.mod include @@ -51,10 +49,15 @@ fms/build/libFMS.a: fms/build/Makefile fms/build/Makefile: Makefile.fms.in fms/src/configure mkdir -p fms/build cp Makefile.fms.in fms/src/Makefile.in - cd $(@D) && ../src/configure --srcdir=../src + cd $(@D) && { \ + ../src/configure --srcdir=../src \ + || { \ + if [ "${REPORT_ERROR_LOGS}" = true ]; then cat config.log ; fi ; \ + false; \ + } \ + } -# TODO: Track m4 macros? fms/src/configure: configure.fms.ac $(FMS_SOURCE) | fms/src cp configure.fms.ac fms/src/configure.ac cp -r m4 $(@D)