From e83e31dcf7cbfeef2416c57f4f955be233ac435c Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 27 Jan 2024 15:56:42 -0500 Subject: [PATCH 01/12] CI: Create a Cygwin workflow Copied from the old version of develop in this repo, which was used for testing the registry compiler warnings PR. --- .github/workflows/cygwin-compile.yml | 58 ++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/cygwin-compile.yml diff --git a/.github/workflows/cygwin-compile.yml b/.github/workflows/cygwin-compile.yml new file mode 100644 index 0000000000..0792f688e3 --- /dev/null +++ b/.github/workflows/cygwin-compile.yml @@ -0,0 +1,58 @@ +name: Check Cygwin Compile + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: windows-latest + env: + SHELLOPTS: igncr:pipefail + CYGWIN_NOWINPATH: 1 + CHERE_INVOKING: 1 + NETCDF: /usr + NETCDF4: 1 + WRFIO_NCD_NO_LARGE_FILE_SUPPORT: 0 + + strategy: + matrix: + parallelization: [1, 2, 3] + nesting: [0, 1] + + steps: + - name: Line-ending normalization + run: git config --global core.autocrlf input + + - uses: actions/checkout@v3 + + - uses: cygwin/cygwin-install-action@v3 + with: + packages: >- + gcc-core gcc-fortran + libnetcdf-fortran-devel libnetcdf-devel libhdf5-devel zlib-devel + openmpi libopenmpi-devel libhwloc-devel libevent-devel + libjasper-devel + perl perl_base tcsh m4 make sed + gawk tar gzip coreutils which file grep + libtirpc-devel + + - name: configure + shell: 'C:\cygwin\bin\bash.exe -o igncr -eo pipefail {0}' + # Options: + # 1 serial 2 smpar 3 dmpar 4 dm+sm + # Nesting? 0 none 1 basic 2 preset move 3 vortex-following + run: | + echo ${{ matrix.parallelization }}$'\n'${{ matrix.nesting }} | /bin/dash ./configure arw + if [ -f tools/nc4_test.log ] ; then cat tools/nc4_test.log; fi + test -f configure.wrf + + - name: Compile + shell: 'C:\cygwin\bin\bash.exe -o igncr -eo pipefail {0}' + run: | + ./compile em_real + ls main/*.exe + ls test/em_real/real.exe From a69d6b1851914c29227734b1965d0fdf57889133 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Thu, 8 Feb 2024 13:45:31 -0500 Subject: [PATCH 02/12] BUG: Set FCCOMPAT This variable is much more useful when there's actual values in it. --- arch/configure.defaults | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/configure.defaults b/arch/configure.defaults index 36ca1b6e00..810c26624f 100644 --- a/arch/configure.defaults +++ b/arch/configure.defaults @@ -1994,7 +1994,7 @@ FCDEBUG = # -g $(FCNOOPT) # -ggdb -fbacktrace FORMAT_FIXED = -ffixed-form FORMAT_FREE = -ffree-form -ffree-line-length-none FCSUFFIX = -FCCOMPAT = +FCCOMPAT = -fallow-argument-mismatch -fallow-invalid-boz BYTESWAPIO = -fconvert=big-endian -frecord-marker=4 FCBASEOPTS_NO_G = -w $(FORMAT_FREE) $(BYTESWAPIO) $(FCCOMPAT) FCBASEOPTS = $(FCBASEOPTS_NO_G) $(FCDEBUG) From b71b6521517e8d6e984688cefbe470bdab3aa60c Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:18:45 -0500 Subject: [PATCH 03/12] CI: Only install MPI on dmpar jobs. The serial and smpar builds shouldn't need MPI. --- .github/workflows/cygwin-compile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cygwin-compile.yml b/.github/workflows/cygwin-compile.yml index 0792f688e3..54be2788a9 100644 --- a/.github/workflows/cygwin-compile.yml +++ b/.github/workflows/cygwin-compile.yml @@ -34,7 +34,7 @@ jobs: packages: >- gcc-core gcc-fortran libnetcdf-fortran-devel libnetcdf-devel libhdf5-devel zlib-devel - openmpi libopenmpi-devel libhwloc-devel libevent-devel + ${{ matrix.parallelization >= 3 && 'openmpi libopenmpi-devel libhwloc-devel libevent-devel' }} libjasper-devel perl perl_base tcsh m4 make sed gawk tar gzip coreutils which file grep From 8a1db6078a870b6149d08e6c8d128cdbd03285a8 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:26:22 -0500 Subject: [PATCH 04/12] CI: Add WRF-Chem build to Cygwin matrix --- .github/workflows/cygwin-compile.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cygwin-compile.yml b/.github/workflows/cygwin-compile.yml index 54be2788a9..cf4f89409b 100644 --- a/.github/workflows/cygwin-compile.yml +++ b/.github/workflows/cygwin-compile.yml @@ -17,11 +17,15 @@ jobs: NETCDF: /usr NETCDF4: 1 WRFIO_NCD_NO_LARGE_FILE_SUPPORT: 0 + WRF_CHEM: ${{ matrix.chemistry }} + FLEX_LIB_DIR: /usr/lib + YACC: "/usr/bin/yacc -d" strategy: matrix: parallelization: [1, 2, 3] nesting: [0, 1] + chemistry: [0, 1] steps: - name: Line-ending normalization @@ -34,11 +38,12 @@ jobs: packages: >- gcc-core gcc-fortran libnetcdf-fortran-devel libnetcdf-devel libhdf5-devel zlib-devel - ${{ matrix.parallelization >= 3 && 'openmpi libopenmpi-devel libhwloc-devel libevent-devel' }} + ${{ matrix.parallelization >= 3 && 'openmpi libopenmpi-devel libhwloc-devel libevent-devel' || '' }} libjasper-devel perl perl_base tcsh m4 make sed gawk tar gzip coreutils which file grep libtirpc-devel + ${{ matrix.chemistry && 'flex bison' || '' }} - name: configure shell: 'C:\cygwin\bin\bash.exe -o igncr -eo pipefail {0}' From 8c8a84b8214a077af46095a2dae5286cde3f5a2a Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Thu, 8 Feb 2024 16:42:36 -0500 Subject: [PATCH 05/12] CI: Add WRF-Hydro to the Cygwin workflow Also add concurrency so making two commits in quick succession only runs one set of jobs, and limit the number of jobs run at once to catch the weirder errors first. --- .github/workflows/cygwin-compile.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cygwin-compile.yml b/.github/workflows/cygwin-compile.yml index cf4f89409b..cedcf2a4a9 100644 --- a/.github/workflows/cygwin-compile.yml +++ b/.github/workflows/cygwin-compile.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ "master" ] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: @@ -20,20 +24,23 @@ jobs: WRF_CHEM: ${{ matrix.chemistry }} FLEX_LIB_DIR: /usr/lib YACC: "/usr/bin/yacc -d" + WRF_HYDRO: ${{ matrix.hydrology }} strategy: + max-parallel: 4 matrix: parallelization: [1, 2, 3] nesting: [0, 1] chemistry: [0, 1] + hydrology: [0, 1] steps: - name: Line-ending normalization run: git config --global core.autocrlf input - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: cygwin/cygwin-install-action@v3 + - uses: cygwin/cygwin-install-action@v4 with: packages: >- gcc-core gcc-fortran @@ -51,6 +58,7 @@ jobs: # 1 serial 2 smpar 3 dmpar 4 dm+sm # Nesting? 0 none 1 basic 2 preset move 3 vortex-following run: | + ${{ matrix.hydrology == 1 && source hydro/template/setEnvar.sh || '' }} echo ${{ matrix.parallelization }}$'\n'${{ matrix.nesting }} | /bin/dash ./configure arw if [ -f tools/nc4_test.log ] ; then cat tools/nc4_test.log; fi test -f configure.wrf @@ -58,6 +66,7 @@ jobs: - name: Compile shell: 'C:\cygwin\bin\bash.exe -o igncr -eo pipefail {0}' run: | + ${{ matrix.hydrology == 1 && source hydro/template/setEnvar.sh || '' }} ./compile em_real ls main/*.exe ls test/em_real/real.exe From 75988c95e93839364a1ee4b33fbf450967d4a26c Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Thu, 8 Feb 2024 16:44:14 -0500 Subject: [PATCH 06/12] FIX: Quote command for WRF-Hydro vars I need GHA to pass this to bash, not try to evaluate it itself. --- .github/workflows/cygwin-compile.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cygwin-compile.yml b/.github/workflows/cygwin-compile.yml index cedcf2a4a9..7a114fb545 100644 --- a/.github/workflows/cygwin-compile.yml +++ b/.github/workflows/cygwin-compile.yml @@ -58,7 +58,7 @@ jobs: # 1 serial 2 smpar 3 dmpar 4 dm+sm # Nesting? 0 none 1 basic 2 preset move 3 vortex-following run: | - ${{ matrix.hydrology == 1 && source hydro/template/setEnvar.sh || '' }} + ${{ matrix.hydrology == 1 && 'source hydro/template/setEnvar.sh' || '' }} echo ${{ matrix.parallelization }}$'\n'${{ matrix.nesting }} | /bin/dash ./configure arw if [ -f tools/nc4_test.log ] ; then cat tools/nc4_test.log; fi test -f configure.wrf @@ -66,7 +66,7 @@ jobs: - name: Compile shell: 'C:\cygwin\bin\bash.exe -o igncr -eo pipefail {0}' run: | - ${{ matrix.hydrology == 1 && source hydro/template/setEnvar.sh || '' }} + ${{ matrix.hydrology == 1 && 'source hydro/template/setEnvar.sh' || '' }} ./compile em_real ls main/*.exe ls test/em_real/real.exe From 7034d4f40b3ac55499e8ee24d8836ecfc13657dd Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Thu, 8 Feb 2024 20:15:31 -0500 Subject: [PATCH 07/12] CI: Ensure WRF-Hydro config gets run. I should look through top-level configure to see why this isn't happening already. --- .github/workflows/cygwin-compile.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cygwin-compile.yml b/.github/workflows/cygwin-compile.yml index 7a114fb545..f4c5fd819d 100644 --- a/.github/workflows/cygwin-compile.yml +++ b/.github/workflows/cygwin-compile.yml @@ -62,6 +62,7 @@ jobs: echo ${{ matrix.parallelization }}$'\n'${{ matrix.nesting }} | /bin/dash ./configure arw if [ -f tools/nc4_test.log ] ; then cat tools/nc4_test.log; fi test -f configure.wrf + ${{ matrix.hydrology == 1 && 'if [ ! -f hydro/Makefile.comm ] ; then cd hydro && /bin/dash ./configure gfort; fi' || '' }} - name: Compile shell: 'C:\cygwin\bin\bash.exe -o igncr -eo pipefail {0}' From 3a18c0b609b887b872d8564360145a5ddd372874 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 9 Feb 2024 09:33:03 -0500 Subject: [PATCH 08/12] CI: hydro/configure uses bashisms Try to ensure the job exits unsuccessfully if the configure script has syntax errors. --- .github/workflows/cygwin-compile.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cygwin-compile.yml b/.github/workflows/cygwin-compile.yml index f4c5fd819d..a6c7a02069 100644 --- a/.github/workflows/cygwin-compile.yml +++ b/.github/workflows/cygwin-compile.yml @@ -62,7 +62,8 @@ jobs: echo ${{ matrix.parallelization }}$'\n'${{ matrix.nesting }} | /bin/dash ./configure arw if [ -f tools/nc4_test.log ] ; then cat tools/nc4_test.log; fi test -f configure.wrf - ${{ matrix.hydrology == 1 && 'if [ ! -f hydro/Makefile.comm ] ; then cd hydro && /bin/dash ./configure gfort; fi' || '' }} + ${{ matrix.hydrology == 1 && 'if [ ! -f hydro/Makefile.comm ] ; then cd hydro && /bin/bash -ex ./configure gfort; fi' || '' }} + ${{ matrix.hydrology == 1 && 'test -f hydro/Makefile.comm' || '' }} - name: Compile shell: 'C:\cygwin\bin\bash.exe -o igncr -eo pipefail {0}' From a69674384b7d7fdf5e26b20712a3a9729da8b751 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 9 Feb 2024 09:39:57 -0500 Subject: [PATCH 09/12] BLD: Check that hydro configure actually creates the files I'm not finding Makefile.comm after. --- hydro/configure | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hydro/configure b/hydro/configure index ce896c95fe..7e8b85719e 100755 --- a/hydro/configure +++ b/hydro/configure @@ -96,6 +96,9 @@ if [[ "$theArgument" == "2" ]] || [[ "$theArgument" == "gfort" ]]; then cp arc/macros.mpp.gfort macros cp arc/Makefile.mpp Makefile.comm echo "Configured: gfort" + pwd + ls -lh Makefile.comm + file Makefile.comm fi if [[ "$theArgument" == "3" ]] || [[ "$theArgument" == "ifort" ]]; then @@ -178,6 +181,7 @@ if [[ -e macros.tmp ]]; then rm -f macros.tmp mv macros.a macros fi +test -f Makefile.comm ## success exit 0 From 1d4cbd3f542e2d6aec0dcf8f7460ceccfefa06c1 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 9 Feb 2024 09:44:13 -0500 Subject: [PATCH 10/12] CI: More debug information --- .github/workflows/cygwin-compile.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cygwin-compile.yml b/.github/workflows/cygwin-compile.yml index a6c7a02069..f71374051f 100644 --- a/.github/workflows/cygwin-compile.yml +++ b/.github/workflows/cygwin-compile.yml @@ -63,6 +63,8 @@ jobs: if [ -f tools/nc4_test.log ] ; then cat tools/nc4_test.log; fi test -f configure.wrf ${{ matrix.hydrology == 1 && 'if [ ! -f hydro/Makefile.comm ] ; then cd hydro && /bin/bash -ex ./configure gfort; fi' || '' }} + pwd + ls hydro ${{ matrix.hydrology == 1 && 'test -f hydro/Makefile.comm' || '' }} - name: Compile From 1800f1a9a5f870e30d5efa492643e8623b4a616b Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 9 Feb 2024 09:50:14 -0500 Subject: [PATCH 11/12] CI: Ensure correct directory when checking file created. I forgot that would propagate. --- .github/workflows/cygwin-compile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cygwin-compile.yml b/.github/workflows/cygwin-compile.yml index f71374051f..30d316ae5c 100644 --- a/.github/workflows/cygwin-compile.yml +++ b/.github/workflows/cygwin-compile.yml @@ -62,7 +62,7 @@ jobs: echo ${{ matrix.parallelization }}$'\n'${{ matrix.nesting }} | /bin/dash ./configure arw if [ -f tools/nc4_test.log ] ; then cat tools/nc4_test.log; fi test -f configure.wrf - ${{ matrix.hydrology == 1 && 'if [ ! -f hydro/Makefile.comm ] ; then cd hydro && /bin/bash -ex ./configure gfort; fi' || '' }} + ${{ matrix.hydrology == 1 && 'if [ ! -f hydro/Makefile.comm ] ; then cd hydro && /bin/bash -ex ./configure gfort && cd ..; fi' || '' }} pwd ls hydro ${{ matrix.hydrology == 1 && 'test -f hydro/Makefile.comm' || '' }} From 9244ec49eb477ed87a0d48293798a51d0f5c814a Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 9 Feb 2024 11:29:32 -0500 Subject: [PATCH 12/12] CI: WRF-Hydro requires dmpar Forgot this earlier. --- .github/workflows/cygwin-compile.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cygwin-compile.yml b/.github/workflows/cygwin-compile.yml index 30d316ae5c..ed10f2b199 100644 --- a/.github/workflows/cygwin-compile.yml +++ b/.github/workflows/cygwin-compile.yml @@ -29,10 +29,15 @@ jobs: strategy: max-parallel: 4 matrix: - parallelization: [1, 2, 3] + parallelization: [3, 1, 2] nesting: [0, 1] chemistry: [0, 1] hydrology: [0, 1] + exclude: + - hydrology: 1 + parallelization: 1 + - hydrology: 1 + parallelization: 2 steps: - name: Line-ending normalization