From 896f9129f5e2bb4a244c0a9309d880f724f1c8af Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 20 Nov 2023 08:30:18 -0500 Subject: [PATCH 01/40] CI: Create a Cygwin workflow So far only tests whether ESMF actuall compiles on Cygwin. I don't actually run the tests yet. I will need to figure out how to add "-D_BSD_SOURCE" to C++ compile lines before it completes. --- .github/workflows/test-build-cygwin.yml | 51 +++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/test-build-cygwin.yml diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml new file mode 100644 index 0000000000..0982d312ed --- /dev/null +++ b/.github/workflows/test-build-cygwin.yml @@ -0,0 +1,51 @@ +name: Test on Cygwin +on: ["push", "pull_request"] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + ESMF_BOPT: O + ESMF_OPTLEVEL: 2 + ESMF_COMM: mpiuni + ESMF_COMPILER: gfortran + ESMF_TESTSHAREDOBJ: ON + ESMF_RANLIB: ranlib + ESMF_LAPACK: system + ESMF_LAPACK_LIBPATH: /usr/lib + ESMF_LAPACK_LIBS: -llapack -lblas + NETCDF: /usr + ESMF_NETCDF: split + ESMF_NETCDF_INCLUDE: /usr/include + ESMF_NETCDF_LIBPATH: /usr/lib + ESMF_CXX: g++ + ESMF_CXXCOMPILEOPTS: "-g -O2" + ESMF_F90: gfortran + ESMF_F90COMPILEOPTS: "-g -O2" + ESMF_INSTALL_PREFIX: /tmp/fakeroot/usr + ESMF_INSTALL_DOCDIR: share/doc/esmf + +jobs: + cygwin_build_test: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: cygwin/cygwin-install-action@v4 + with: + platform: x86_64 + install-dir: 'C:\tools\cygwin' + packages: >- + openmpi gcc-core gcc-fortran gcc-g++ libnetcdf-devel libnetcdf-fortran-devel + texlive-collection-latex perl + - name: Build ESMF + run: | + C:\tools\cygwin\bin\dash.exe -c "make all" + - name: Build ESMF Docs + run: | + C:\tools\cygwin\bin\dash.exe -c "make doc" From 110c0be5b178b580a9977587563f98fd7d88a466 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 20 Nov 2023 08:38:15 -0500 Subject: [PATCH 02/40] FIX: Set ESMF_DIR to CI exec location. This should let the compilation start. --- .github/workflows/test-build-cygwin.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index 0982d312ed..c80417bef4 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -9,6 +9,7 @@ permissions: contents: read # to fetch code (actions/checkout) env: + ESMF_DIR: /cygdrive/d/a/esmf/esmf ESMF_BOPT: O ESMF_OPTLEVEL: 2 ESMF_COMM: mpiuni From 3045b70081e1bd126cbed801699d5044928092cf Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 20 Nov 2023 08:48:37 -0500 Subject: [PATCH 03/40] FIX: Install Cygwin make. --- .github/workflows/test-build-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index c80417bef4..c95ac5f09f 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -43,7 +43,7 @@ jobs: install-dir: 'C:\tools\cygwin' packages: >- openmpi gcc-core gcc-fortran gcc-g++ libnetcdf-devel libnetcdf-fortran-devel - texlive-collection-latex perl + texlive-collection-latex perl make - name: Build ESMF run: | C:\tools\cygwin\bin\dash.exe -c "make all" From fd0e1673b3f2c274a6d542f48648e1316f13a115 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 20 Nov 2023 08:56:19 -0500 Subject: [PATCH 04/40] FIX: Ensure bash/dash installed, Cygwin make used. --- .github/workflows/test-build-cygwin.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index c95ac5f09f..455ffa3947 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -43,10 +43,10 @@ jobs: install-dir: 'C:\tools\cygwin' packages: >- openmpi gcc-core gcc-fortran gcc-g++ libnetcdf-devel libnetcdf-fortran-devel - texlive-collection-latex perl make + texlive-collection-latex perl make bash dash - name: Build ESMF run: | - C:\tools\cygwin\bin\dash.exe -c "make all" + C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make all" - name: Build ESMF Docs run: | - C:\tools\cygwin\bin\dash.exe -c "make doc" + C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make doc" From 839602d699ff875692fabe119580f8b4b4455c22 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 20 Nov 2023 09:05:05 -0500 Subject: [PATCH 05/40] FIX: Check ESMF_DIR setting. --- .github/workflows/test-build-cygwin.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index 455ffa3947..6f44fc8810 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -44,6 +44,9 @@ jobs: packages: >- openmpi gcc-core gcc-fortran gcc-g++ libnetcdf-devel libnetcdf-fortran-devel texlive-collection-latex perl make bash dash + - name: Check location + run: | + C:\tools\cygwin\bin\dash.exe -c "pwd; echo ${ESMF_DIR}" - name: Build ESMF run: | C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make all" From 438d20c071528f725660cf68ad0424b851580a8f Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 20 Nov 2023 09:19:36 -0500 Subject: [PATCH 06/40] DBG: Add more information to pwd check Hopefully this lets me figure out the unexpected end of file errors. --- .github/workflows/test-build-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index 6f44fc8810..71d8cbecf3 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -46,7 +46,7 @@ jobs: texlive-collection-latex perl make bash dash - name: Check location run: | - C:\tools\cygwin\bin\dash.exe -c "pwd; echo ${ESMF_DIR}" + C:\tools\cygwin\bin\dash.exe -c "echo PWD; pwd; echo ESMF_DIR=${ESMF_DIR}" - name: Build ESMF run: | C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make all" From fdd00b3d5b29bc269164393ae251b584b59c6159 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 20 Nov 2023 09:25:33 -0500 Subject: [PATCH 07/40] DBG: Try to fix newline errors. Forgot that Windows git would put \r\n line endings, which Cygwin doesn't like. --- .github/workflows/test-build-cygwin.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index 71d8cbecf3..668e0142fb 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -9,6 +9,9 @@ permissions: contents: read # to fetch code (actions/checkout) env: + SHELLOPTS: igncr + CYGWIN_NOWINPATH: 1 + CHERE_INVOKING: 1 ESMF_DIR: /cygdrive/d/a/esmf/esmf ESMF_BOPT: O ESMF_OPTLEVEL: 2 @@ -34,6 +37,7 @@ jobs: cygwin_build_test: runs-on: windows-latest steps: + - run: git config --global core.autocrlf input - uses: actions/checkout@v3 with: submodules: recursive From 6d4feceaef280460bf29b1ecdc4e590709ad7298 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 20 Nov 2023 09:49:07 -0500 Subject: [PATCH 08/40] BLD: Ensure kill, sigset*, M_PI, and friends get defined on Cygwin. Many declarations are hidden behind visibility macros. _BSD_SOURCE un-hides most of them. _POSIX_C_SOURCE un-hides another couple. --- build_config/Cygwin.gfortran.default/build_rules.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build_config/Cygwin.gfortran.default/build_rules.mk b/build_config/Cygwin.gfortran.default/build_rules.mk index 7fad49a1eb..26805e3abe 100644 --- a/build_config/Cygwin.gfortran.default/build_rules.mk +++ b/build_config/Cygwin.gfortran.default/build_rules.mk @@ -9,6 +9,7 @@ ESMF_F90DEFAULT = gfortran ESMF_CXXDEFAULT = g++ ESMF_CDEFAULT = gcc +ESMF_CXXCOMPILECPPFLAGS+= -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L ############################################################ # Default MPI setting. @@ -115,8 +116,8 @@ ESMF_CXXOPTFLAG_G += -Wall -Wextra -Wno-unused ############################################################ # Cygwin 1.5.24 does not yet support POSIX IPC (memory mapped files) -# -ESMF_CXXCOMPILECPPFLAGS += -DESMF_NO_POSIXIPC +# Cygwin 3.4.9 might +# ESMF_CXXCOMPILECPPFLAGS += -DESMF_NO_POSIXIPC ############################################################ # Fortran symbol convention From 9a8dad34b51dc0a37dbe3fa985f64bddca796472 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:24:11 -0500 Subject: [PATCH 09/40] CI: Install liblapack-devel on Cygwin runner. --- .github/workflows/test-build-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index 668e0142fb..c3e2491b1c 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -47,7 +47,7 @@ jobs: install-dir: 'C:\tools\cygwin' packages: >- openmpi gcc-core gcc-fortran gcc-g++ libnetcdf-devel libnetcdf-fortran-devel - texlive-collection-latex perl make bash dash + texlive-collection-latex perl make bash dash liblapack-devel - name: Check location run: | C:\tools\cygwin\bin\dash.exe -c "echo PWD; pwd; echo ESMF_DIR=${ESMF_DIR}" From 171e8b558914826cbb55d478df33d72599128726 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 20 Nov 2023 13:57:36 -0500 Subject: [PATCH 10/40] BLD: Fix shared library compile lines for Cygwin Cygwin is more like Windows than Linux here: make sure the import library gets generated in addition to the DLL and that both have the right names. Import library: lib${name}.dll.a Shared library: cyg${name}-${abi}.dll or cyg${name}.dll --- build/common.mk | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build/common.mk b/build/common.mk index b5ed00dc71..f89b266f45 100644 --- a/build/common.mk +++ b/build/common.mk @@ -4010,7 +4010,11 @@ $(ESMF_LOCOBJDIR)/%.o : %.cpp .F90.$(ESMF_SL_SUFFIX): $(ESMF_F90COMPILEFREECPP_CMD) $(ESMF_SO_F90COMPILEOPTS) $< - $(ESMF_F90LINKER) $(ESMF_SO_F90LINKOPTS) $(ESMF_F90LINKOPTS) $(ESMF_F90LINKPATHS) $(ESMF_F90LINKRPATHS) -o $@ $*.o $(ESMF_F90ESMFLINKLIBS) + if [ ${ESMF_SL_SUFFIX} -ne "dll.a" ] ; then \ + $(ESMF_F90LINKER) $(ESMF_SO_F90LINKOPTS) $(ESMF_F90LINKOPTS) $(ESMF_F90LINKPATHS) $(ESMF_F90LINKRPATHS) -o $@ $*.o $(ESMF_F90ESMFLINKLIBS) \ + else \ + $(ESMF_F90LINKER) $(ESMF_SO_F90LINKOPTS) $(ESMF_F90LINKOPTS) $(ESMF_F90LINKPATHS) -shared -o $(@:.dll.a=.dll) -Wl,--out-implib=$@ -Wl,--export-all-symbols -Wl,--whole-archive $*.o -Wl,--no-whole-archive $(ESMF_F90ESMFLINKLIBS) \ + fi .F90.$(ESMF_LIB_SUFFIX): $(ESMF_F90COMPILEFREECPP_CMD) $< @@ -4111,11 +4115,16 @@ shared: mkdir tmp_$$NEXTLIB ;\ cd tmp_$$NEXTLIB ;\ $(ESMF_AREXTRACT) ../$$NEXTLIB.$(ESMF_LIB_SUFFIX) ;\ + if [ "${ESMF_SL_SUFFIX}" -ne "dll.a" ] ; then \ echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB.$(ESMF_SL_SUFFIX) *.o $(ESMF_SL_LIBLIBS) ;\ $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB.$(ESMF_SL_SUFFIX) *.o $(ESMF_SL_LIBLIBS) ;\ echo Converting $$NEXTLIB.$(ESMF_SL_SUFFIX) to $$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) ;\ echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) *.o $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) *.o $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ + else \ + echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ + $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ + fi ;\ cd .. ;\ $(ESMF_RM) -r tmp_$$NEXTLIB ;\ fi ;\ From b8f1537fb139143cd183e85698dea4c0c0dd6a6e Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 20 Nov 2023 18:19:58 -0500 Subject: [PATCH 11/40] FIX: Fix syntax in SL linking rule. I forgot the semicolons, so bash didn't recognize the control structures. --- build/common.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/common.mk b/build/common.mk index f89b266f45..762c24dba7 100644 --- a/build/common.mk +++ b/build/common.mk @@ -4011,10 +4011,10 @@ $(ESMF_LOCOBJDIR)/%.o : %.cpp .F90.$(ESMF_SL_SUFFIX): $(ESMF_F90COMPILEFREECPP_CMD) $(ESMF_SO_F90COMPILEOPTS) $< if [ ${ESMF_SL_SUFFIX} -ne "dll.a" ] ; then \ - $(ESMF_F90LINKER) $(ESMF_SO_F90LINKOPTS) $(ESMF_F90LINKOPTS) $(ESMF_F90LINKPATHS) $(ESMF_F90LINKRPATHS) -o $@ $*.o $(ESMF_F90ESMFLINKLIBS) \ + $(ESMF_F90LINKER) $(ESMF_SO_F90LINKOPTS) $(ESMF_F90LINKOPTS) $(ESMF_F90LINKPATHS) $(ESMF_F90LINKRPATHS) -o $@ $*.o $(ESMF_F90ESMFLINKLIBS); \ else \ - $(ESMF_F90LINKER) $(ESMF_SO_F90LINKOPTS) $(ESMF_F90LINKOPTS) $(ESMF_F90LINKPATHS) -shared -o $(@:.dll.a=.dll) -Wl,--out-implib=$@ -Wl,--export-all-symbols -Wl,--whole-archive $*.o -Wl,--no-whole-archive $(ESMF_F90ESMFLINKLIBS) \ - fi + $(ESMF_F90LINKER) $(ESMF_SO_F90LINKOPTS) $(ESMF_F90LINKOPTS) $(ESMF_F90LINKPATHS) -shared -o $(@:.dll.a=.dll) -Wl,--out-implib=$@ -Wl,--export-all-symbols -Wl,--whole-archive $*.o -Wl,--no-whole-archive $(ESMF_F90ESMFLINKLIBS); \ + fi; .F90.$(ESMF_LIB_SUFFIX): $(ESMF_F90COMPILEFREECPP_CMD) $< From 44c66ba7eb55da677277611e7dab0464aff3b814 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 20 Nov 2023 20:51:19 -0500 Subject: [PATCH 12/40] CI,FIX: Install protex files for doc build. Not sure if this will fix the failure, the error wasn't very clear. --- .github/workflows/test-build-cygwin.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index c3e2491b1c..ad0d0970db 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -47,7 +47,8 @@ jobs: install-dir: 'C:\tools\cygwin' packages: >- openmpi gcc-core gcc-fortran gcc-g++ libnetcdf-devel libnetcdf-fortran-devel - texlive-collection-latex perl make bash dash liblapack-devel + texlive-collection-latex texlive-collection-latexextra perl make bash dash + liblapack-devel - name: Check location run: | C:\tools\cygwin\bin\dash.exe -c "echo PWD; pwd; echo ESMF_DIR=${ESMF_DIR}" From 72e2a45c94808eb73ba5240825b03fead0bac246 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 20 Nov 2023 21:00:42 -0500 Subject: [PATCH 13/40] CI: Add Python and tests to Cygwin CI job. --- .github/workflows/test-build-cygwin.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index ad0d0970db..3b67daa3eb 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -49,12 +49,22 @@ jobs: openmpi gcc-core gcc-fortran gcc-g++ libnetcdf-devel libnetcdf-fortran-devel texlive-collection-latex texlive-collection-latexextra perl make bash dash liblapack-devel + python39-devel python39-pip python39-numpy python39-pytest - name: Check location run: | C:\tools\cygwin\bin\dash.exe -c "echo PWD; pwd; echo ESMF_DIR=${ESMF_DIR}" - name: Build ESMF run: | C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make all" + - name: Build ESMPy + run: | + C:\tools\cygwin\bin\dash.exe -c "cd src/addon/esmpy; python -m pip install ." + - name: Check ESMF + run: | + C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make check" + - name: Check ESMPy + run: | + C:\tools\cygwin\bin\dash.exe -c "cd src/addon/esmpy; /usr/bin/make download test_all" - name: Build ESMF Docs run: | C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make doc" From 9bf40dbb3c7ed0bd3e6c19ca8db891decc8423bf Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Tue, 21 Nov 2023 10:32:01 -0500 Subject: [PATCH 14/40] CI: Ensure Lapack is in Cygwin path. --- .github/workflows/test-build-cygwin.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index 3b67daa3eb..cb1a179697 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -50,6 +50,10 @@ jobs: texlive-collection-latex texlive-collection-latexextra perl make bash dash liblapack-devel python39-devel python39-pip python39-numpy python39-pytest + - name: Set Windows PATH + uses: egor-tensin/cleanup-path@v3 + with: + dirs: 'C:\tools\cygwin\bin;C:\tools\cygwin\lib\lapack' - name: Check location run: | C:\tools\cygwin\bin\dash.exe -c "echo PWD; pwd; echo ESMF_DIR=${ESMF_DIR}" From 6ac7f8c0371777e54010120f195be0312673ffc8 Mon Sep 17 00:00:00 2001 From: Gerhard Theurich Date: Fri, 8 Dec 2023 11:31:07 -0800 Subject: [PATCH 15/40] Fix logic syntax, and formatting. --- build/common.mk | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/build/common.mk b/build/common.mk index 71bc5c04b1..1d9510ae4c 100644 --- a/build/common.mk +++ b/build/common.mk @@ -4027,10 +4027,10 @@ $(ESMF_LOCOBJDIR)/%.o : %.cpp .F90.$(ESMF_SL_SUFFIX): $(ESMF_F90COMPILEFREECPP_CMD) $(ESMF_SO_F90COMPILEOPTS) $< - if [ ${ESMF_SL_SUFFIX} -ne "dll.a" ] ; then \ - $(ESMF_F90LINKER) $(ESMF_SO_F90LINKOPTS) $(ESMF_F90LINKOPTS) $(ESMF_F90LINKPATHS) $(ESMF_F90LINKRPATHS) -o $@ $*.o $(ESMF_F90ESMFLINKLIBS); \ + if [ $(ESMF_SL_SUFFIX) != "dll.a" ] ; then \ + $(ESMF_F90LINKER) $(ESMF_SO_F90LINKOPTS) $(ESMF_F90LINKOPTS) $(ESMF_F90LINKPATHS) $(ESMF_F90LINKRPATHS) -o $@ $*.o $(ESMF_F90ESMFLINKLIBS); \ else \ - $(ESMF_F90LINKER) $(ESMF_SO_F90LINKOPTS) $(ESMF_F90LINKOPTS) $(ESMF_F90LINKPATHS) -shared -o $(@:.dll.a=.dll) -Wl,--out-implib=$@ -Wl,--export-all-symbols -Wl,--whole-archive $*.o -Wl,--no-whole-archive $(ESMF_F90ESMFLINKLIBS); \ + $(ESMF_F90LINKER) $(ESMF_SO_F90LINKOPTS) $(ESMF_F90LINKOPTS) $(ESMF_F90LINKPATHS) -shared -o $(@:.dll.a=.dll) -Wl,--out-implib=$@ -Wl,--export-all-symbols -Wl,--whole-archive $*.o -Wl,--no-whole-archive $(ESMF_F90ESMFLINKLIBS); \ fi; .F90.$(ESMF_LIB_SUFFIX): @@ -4131,17 +4131,17 @@ shared: echo Converting $$NEXTLIB.a to $$NEXTLIB.$(ESMF_SL_SUFFIX) ;\ mkdir tmp_$$NEXTLIB ;\ cd tmp_$$NEXTLIB ;\ - $(ESMF_AREXTRACT) ../$$NEXTLIB.$(ESMF_LIB_SUFFIX) ;\ - if [ "${ESMF_SL_SUFFIX}" -ne "dll.a" ] ; then \ - echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB.$(ESMF_SL_SUFFIX) *.o $(ESMF_SL_LIBLIBS) ;\ - $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB.$(ESMF_SL_SUFFIX) *.o $(ESMF_SL_LIBLIBS) ;\ - echo Converting $$NEXTLIB.$(ESMF_SL_SUFFIX) to $$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) ;\ - echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) *.o $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ - $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) *.o $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ + $(ESMF_AREXTRACT) ../$$NEXTLIB.$(ESMF_LIB_SUFFIX) ;\ + if [ $(ESMF_SL_SUFFIX) != "dll.a" ] ; then \ + echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB.$(ESMF_SL_SUFFIX) *.o $(ESMF_SL_LIBLIBS) ;\ + $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB.$(ESMF_SL_SUFFIX) *.o $(ESMF_SL_LIBLIBS) ;\ + echo Converting $$NEXTLIB.$(ESMF_SL_SUFFIX) to $$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) ;\ + echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) *.o $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ + $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) *.o $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ else \ echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ - $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ - fi ;\ + $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ + fi ;\ cd .. ;\ $(ESMF_RM) -r tmp_$$NEXTLIB ;\ fi ;\ From 9afb99d5eb0986471e3da0a0d47d9859a84b8c02 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 11 Dec 2023 09:38:34 -0500 Subject: [PATCH 16/40] CI: Update Cygwin CI workflow triggers. Drop push, add workflow_dispatch and release. --- .github/workflows/test-build-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index cb1a179697..682a31df8e 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -1,5 +1,5 @@ name: Test on Cygwin -on: ["push", "pull_request"] +on: ["workflow_dispatch", "pull_request", "release"] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} From 8323f7676686cdcbef7dcf81389d6fb2f00887da Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 10 May 2024 15:07:52 -0400 Subject: [PATCH 17/40] CI:Cygwin: Remove ESMPy and doc checks. I don't think those were actually working anyway, and I don't feel like debugging those. --- .github/workflows/test-build-cygwin.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index 682a31df8e..0fe330b7e4 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -66,9 +66,3 @@ jobs: - name: Check ESMF run: | C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make check" - - name: Check ESMPy - run: | - C:\tools\cygwin\bin\dash.exe -c "cd src/addon/esmpy; /usr/bin/make download test_all" - - name: Build ESMF Docs - run: | - C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make doc" From f04998c90163153821891ba2eca08aa7cb042d13 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Thu, 6 Feb 2025 05:26:46 -0500 Subject: [PATCH 18/40] CI: Drop runs on each CI commit --- .github/workflows/test-build-cygwin.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index 0fe330b7e4..67ddd87e99 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -1,5 +1,8 @@ name: Test on Cygwin -on: ["workflow_dispatch", "pull_request", "release"] +on: + workflow_dispatch: + release: + type: ["published"] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} From caf1a510acfd921459b0fb4a4827a4d4878f59ed Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Thu, 6 Feb 2025 07:43:46 -0500 Subject: [PATCH 19/40] CI: Add CMake for PIO build --- .github/workflows/test-build-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index cb1a179697..a96d432b92 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -48,7 +48,7 @@ jobs: packages: >- openmpi gcc-core gcc-fortran gcc-g++ libnetcdf-devel libnetcdf-fortran-devel texlive-collection-latex texlive-collection-latexextra perl make bash dash - liblapack-devel + liblapack-devel cmake python39-devel python39-pip python39-numpy python39-pytest - name: Set Windows PATH uses: egor-tensin/cleanup-path@v3 From ff0fa780181425ccd31080580b8b2a0bdea6210d Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 10 Feb 2025 08:27:33 -0500 Subject: [PATCH 20/40] CI:Cygwin: Run on release-like tags --- .github/workflows/test-build-cygwin.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index 67ddd87e99..0909f9db68 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -3,6 +3,9 @@ on: workflow_dispatch: release: type: ["published"] + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} From a6ce87b03ff73d55c992f99eb2e725448c098f09 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 10 Feb 2025 08:30:34 -0500 Subject: [PATCH 21/40] CI:Cygwin: Install CMake for PIO --- .github/workflows/test-build-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index 0909f9db68..8f70f10eb2 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -54,7 +54,7 @@ jobs: packages: >- openmpi gcc-core gcc-fortran gcc-g++ libnetcdf-devel libnetcdf-fortran-devel texlive-collection-latex texlive-collection-latexextra perl make bash dash - liblapack-devel + liblapack-devel cmake python39-devel python39-pip python39-numpy python39-pytest - name: Set Windows PATH uses: egor-tensin/cleanup-path@v3 From 7576ad75f1ccd0cc7a27f0871daa04aa942c1bfc Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 12 Mar 2025 21:35:41 -0400 Subject: [PATCH 22/40] CI:Cygwin: Remove LaTeX packages for skipped doc build --- .github/workflows/test-build-cygwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index 8f70f10eb2..66f5c93568 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -53,7 +53,7 @@ jobs: install-dir: 'C:\tools\cygwin' packages: >- openmpi gcc-core gcc-fortran gcc-g++ libnetcdf-devel libnetcdf-fortran-devel - texlive-collection-latex texlive-collection-latexextra perl make bash dash + perl make bash dash liblapack-devel cmake python39-devel python39-pip python39-numpy python39-pytest - name: Set Windows PATH From fd49f7f27ea434fc8b329106068f1572b5f295cf Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 14 Mar 2025 07:11:45 -0400 Subject: [PATCH 23/40] CI:Cygwin: Define ESMFMKFILE --- .github/workflows/test-build-cygwin.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index a96d432b92..ba7eee3ab9 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -61,12 +61,16 @@ jobs: run: | C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make all" - name: Build ESMPy + env: + ESMFMKFILE: "${ESMF_DIR}/esmf.mk" run: | C:\tools\cygwin\bin\dash.exe -c "cd src/addon/esmpy; python -m pip install ." - name: Check ESMF run: | C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make check" - name: Check ESMPy + env: + ESMFMKFILE: "${ESMF_DIR}/esmf.mk" run: | C:\tools\cygwin\bin\dash.exe -c "cd src/addon/esmpy; /usr/bin/make download test_all" - name: Build ESMF Docs From 3ed8bf7fdd1035e35d87fed536760a864f80db5c Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 14 Mar 2025 21:38:29 -0400 Subject: [PATCH 24/40] CI:Cygwin: Install libyaml-devel and specify ESMFMKFILE for ESMPy This used to be optional, but I suppose that changed. --- .github/workflows/test-build-cygwin.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index ba7eee3ab9..3dbd73abfa 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -48,7 +48,7 @@ jobs: packages: >- openmpi gcc-core gcc-fortran gcc-g++ libnetcdf-devel libnetcdf-fortran-devel texlive-collection-latex texlive-collection-latexextra perl make bash dash - liblapack-devel cmake + liblapack-devel cmake libyaml-devel python39-devel python39-pip python39-numpy python39-pytest - name: Set Windows PATH uses: egor-tensin/cleanup-path@v3 @@ -68,9 +68,17 @@ jobs: - name: Check ESMF run: | C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make check" + - name: Install ESMF + run: | + C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make install" + - name: ESMF Installcheck + env: + ESMFMKFILE: "/tmp/fakeroot/usr/lib/esmf.mk" + run: | + C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make installcheck" - name: Check ESMPy env: - ESMFMKFILE: "${ESMF_DIR}/esmf.mk" + ESMFMKFILE: "/tmp/fakeroot/usr/lib/esmf.mk" run: | C:\tools\cygwin\bin\dash.exe -c "cd src/addon/esmpy; /usr/bin/make download test_all" - name: Build ESMF Docs From 40477146cbfdef233e50af1a5d15f67ab8ed6637 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sat, 15 Mar 2025 09:55:18 -0400 Subject: [PATCH 25/40] CI:Cygwin: Fix ESMFMKFILE value Let's see if this works --- .github/workflows/test-build-cygwin.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index 3dbd73abfa..cf4743e52c 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -73,12 +73,12 @@ jobs: C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make install" - name: ESMF Installcheck env: - ESMFMKFILE: "/tmp/fakeroot/usr/lib/esmf.mk" + ESMFMKFILE: "/tmp/fakeroot/usr/lib/libO/Cygwin.gfortran.64.mpiuni.default/esmf.mk" run: | C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make installcheck" - name: Check ESMPy env: - ESMFMKFILE: "/tmp/fakeroot/usr/lib/esmf.mk" + ESMFMKFILE: "/tmp/fakeroot/usr/lib/libO/Cygwin.gfortran.64.mpiuni.default/esmf.mk" run: | C:\tools\cygwin\bin\dash.exe -c "cd src/addon/esmpy; /usr/bin/make download test_all" - name: Build ESMF Docs From ba9568f45fba0620d30f55655d7f26f7fc81a6b3 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 19 Mar 2025 15:28:05 -0400 Subject: [PATCH 26/40] ENH:ESMPy: Add ESMF_OS constant for Cygwin Necessary for CTypes load of ESMF DLL in interface.loadESMF --- src/addon/esmpy/src/esmpy/api/constants.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/addon/esmpy/src/esmpy/api/constants.py b/src/addon/esmpy/src/esmpy/api/constants.py index 8d9c88927d..2734151bd7 100644 --- a/src/addon/esmpy/src/esmpy/api/constants.py +++ b/src/addon/esmpy/src/esmpy/api/constants.py @@ -34,9 +34,10 @@ # ESMF OS _ESMF_OS = None -(_ESMF_OS_DARWIN, +(_ESMF_OS_CYGWIN, + _ESMF_OS_DARWIN, _ESMF_OS_LINUX, - _ESMF_OS_UNICOS) = (-5,-4,-3) + _ESMF_OS_UNICOS) = (-6, -5,-4,-3) # ESMF_NETCDF _ESMF_NETCDF = False From 17d4b299fe2b477acaa48d9eba2894cf2cd3c09e Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 19 Mar 2025 15:31:28 -0400 Subject: [PATCH 27/40] ENH:ESMPy: Tell ESMF loader about Cygwin --- src/addon/esmpy/src/esmpy/interface/loadESMF.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/addon/esmpy/src/esmpy/interface/loadESMF.py b/src/addon/esmpy/src/esmpy/interface/loadESMF.py index f664efec53..ff82d64f73 100644 --- a/src/addon/esmpy/src/esmpy/interface/loadESMF.py +++ b/src/addon/esmpy/src/esmpy/interface/loadESMF.py @@ -113,8 +113,10 @@ constants._ESMF_OS = constants._ESMF_OS_LINUX elif "Unicos" in esmfos: constants._ESMF_OS = constants._ESMF_OS_UNICOS +elif "Cygwin" in esmfos: + constants._ESMF_OS = constants._ESMF_OS_CYGWIN else: - raise ValueError("Unrecognized ESMF_OS setting!") + raise ValueError(f"Unrecognized ESMF_OS setting: {esmfos:s}!") # set _ESMF_ABI for 32/64 switching if "64" in esmfabi: @@ -146,7 +148,7 @@ # load the shared library for esmf try: - if constants._ESMF_OS == constants._ESMF_OS_DARWIN: + if constants._ESMF_OS in (constants._ESMF_OS_DARWIN, constants._ESMF_OS_CYGWIN): _ESMF = np.ctypeslib.load_library('libesmf_fullylinked',libsdir) else: _ESMF = ct.CDLL(os.path.join(libsdir,'libesmf_fullylinked.so'), From 23eb16e2a4842949b56499702688dc9c8f85f105 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Thu, 20 Mar 2025 09:46:27 -0400 Subject: [PATCH 28/40] CI:Cygwin: Check installed files I'm used to CMake and Autotools being explicit about what got installed. Here it's "cp -f lib/* $(prefix)/lib/", which doesn't tell me whether the required files got copied, nor what they might be called. --- .github/workflows/test-build-cygwin.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index cf4743e52c..6178c28ae7 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -71,6 +71,9 @@ jobs: - name: Install ESMF run: | C:\tools\cygwin\bin\dash.exe -c "/usr/bin/make install" + - name: List ESMF Installed files + run: | + C:\tools\cygwin\bin\dash.exe -c "/usr/bin/find /tmp/fakeroot" - name: ESMF Installcheck env: ESMFMKFILE: "/tmp/fakeroot/usr/lib/libO/Cygwin.gfortran.64.mpiuni.default/esmf.mk" From e9415769d19176a611b02f72a30d3fab946cfb3b Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Thu, 20 Mar 2025 14:08:56 -0400 Subject: [PATCH 29/40] BLD:Cygwin: Ensure DLL gets installed, not just import library The linker needs the import library, the DLL is needed at runtime. Cygwin usually installs DLLs to `$(bindir)`, which defaults to `$(prefix)/bin`. --- makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/makefile b/makefile index 0867bc74e3..40876a08be 100644 --- a/makefile +++ b/makefile @@ -819,6 +819,9 @@ install: envdump cp -f $(ESMF_MODDIR)/*.mod $(ESMF_INSTALL_MODDIR_ABSPATH) mkdir -p $(ESMF_INSTALL_LIBDIR_ABSPATH) cp -f $(ESMF_LIBDIR)/libesmf*.* $(ESMF_INSTALL_LIBDIR_ABSPATH) +ifeq ($(ESMF_OS),Cygwin) + cp -f $(ESMF_LIBDIR)/cygesmf*.* $(ESMF_INSTALL_BINDIR_ABSPATH) +endif ifeq ($(ESMF_PIO),internal) cp -f $(ESMF_LIBDIR)/libpioc.* $(ESMF_INSTALL_LIBDIR_ABSPATH) From c1aee185ce69eecfab48c4580c4197ebfb356c2a Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 21 Mar 2025 09:43:14 -0400 Subject: [PATCH 30/40] BLD:Cygwin: List ESMF_LDIR contents after making a shared library I'm trying to find where the .dll got to. --- build/common.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build/common.mk b/build/common.mk index 1d9510ae4c..b6aea60850 100644 --- a/build/common.mk +++ b/build/common.mk @@ -4139,8 +4139,11 @@ shared: echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) *.o $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) *.o $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ else \ - echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ - $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ + echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import \ + -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ + $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import \ + -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ + ls $(ESMF_LDIR) fi ;\ cd .. ;\ $(ESMF_RM) -r tmp_$$NEXTLIB ;\ From f9e8875764ed6ddf1ee27e901685bd8d6f5d783d Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 21 Mar 2025 09:46:58 -0400 Subject: [PATCH 31/40] BLD:Cygwin: List ESMF_LDIR when building a shared library I'm trying to figure out where cygesmf.dll wound up. --- build/common.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build/common.mk b/build/common.mk index f52be4b29c..f164f519d0 100644 --- a/build/common.mk +++ b/build/common.mk @@ -4209,8 +4209,11 @@ shared: echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) *.o $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) *.o $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ else \ - echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ - $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ + echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import \ + -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ + $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import \ + -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ + ls $(ESMF_LDIR) fi ;\ cd .. ;\ $(ESMF_RM) -r tmp_$$NEXTLIB ;\ From ba335a80f8c2475c068c2f792ec7e7eb461efa90 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 21 Mar 2025 09:48:51 -0400 Subject: [PATCH 32/40] BLD:Cygwin: Fix syntax for building shared libraries I keep forgetting -ne is numeric comparison and != is lexical --- build/common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/common.mk b/build/common.mk index f164f519d0..15632d987d 100644 --- a/build/common.mk +++ b/build/common.mk @@ -4202,7 +4202,7 @@ shared: mkdir tmp_$$NEXTLIB ;\ cd tmp_$$NEXTLIB ;\ $(ESMF_AREXTRACT) ../$$NEXTLIB.$(ESMF_LIB_SUFFIX) ;\ - if [ "${ESMF_SL_SUFFIX}" -ne "dll.a" ] ; then \ + if [ "${ESMF_SL_SUFFIX}" != "dll.a" ] ; then \ echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB.$(ESMF_SL_SUFFIX) *.o $(ESMF_SL_LIBLIBS) ;\ $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB.$(ESMF_SL_SUFFIX) *.o $(ESMF_SL_LIBLIBS) ;\ echo Converting $$NEXTLIB.$(ESMF_SL_SUFFIX) to $$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) ;\ From ab311e4b2d85ee5d8d4799b5ddceeae59d818800 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 21 Mar 2025 09:55:01 -0400 Subject: [PATCH 33/40] BLD:Cygwin: Link netCDF libraries when linking PIO Current order was leaving PIO symbols unresolved, apparently in PIO --- build/common.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/common.mk b/build/common.mk index 15632d987d..cb979c84a8 100644 --- a/build/common.mk +++ b/build/common.mk @@ -1731,6 +1731,8 @@ ifdef ESMF_PIO ESMF_CPPFLAGS += -DESMF_PIO=1 ifneq ($(origin ESMF_PIO_LIBS), environment) ESMF_PIO_LIBS = -lpioc +ifeq ($(ESMF_OS),Cygwin) +ESMF_PIO_LIBS += $(ESMF_NETCDF_LIBS) endif ifdef ESMF_PIO_INCLUDE ESMF_CXXCOMPILEPATHSTHIRD += -I$(ESMF_PIO_INCLUDE) From 391f0ae4e58c78cf5fc750ad91d41daa7bf27005 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 21 Mar 2025 12:37:20 -0400 Subject: [PATCH 34/40] BLD:Cygwin: Fix syntax for netCDF libraries --- build/common.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/build/common.mk b/build/common.mk index cb979c84a8..4c6dfe2e74 100644 --- a/build/common.mk +++ b/build/common.mk @@ -1734,6 +1734,7 @@ ESMF_PIO_LIBS = -lpioc ifeq ($(ESMF_OS),Cygwin) ESMF_PIO_LIBS += $(ESMF_NETCDF_LIBS) endif +endif ifdef ESMF_PIO_INCLUDE ESMF_CXXCOMPILEPATHSTHIRD += -I$(ESMF_PIO_INCLUDE) ESMF_F90COMPILEPATHSTHIRD += -I$(ESMF_PIO_INCLUDE) From 8e02f256ba06d7445041bbb86c2b3d7f8dc60826 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 21 Mar 2025 14:30:29 -0400 Subject: [PATCH 35/40] BLD:Cygwin: Fix syntax for shared library rule --- build/common.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/common.mk b/build/common.mk index 4c6dfe2e74..2ea6dedd4a 100644 --- a/build/common.mk +++ b/build/common.mk @@ -4212,11 +4212,11 @@ shared: echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) *.o $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/$$NEXTLIB\_fullylinked.$(ESMF_SL_SUFFIX) *.o $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ else \ - echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import \ + echo $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/"cyg$${NEXTLIB#lib}.dll" -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import \ -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ $(ESMF_SL_LIBLINKER) $(ESMF_SL_LIBOPTS) -o $(ESMF_LDIR)/cyg$${NEXTLIB#lib}\.dll -Wl,--out-implib=$(ESMF_LDIR)/$$NEXTLIB\.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import \ -Wl,--whole-archive *.o -Wl,--no-whole-archive $(ESMF_CXXLINKOPTS) $(ESMF_CXXLINKPATHS) $(ESMF_CXXLINKRPATHS) $(ESMF_CXXLINKLIBS) ;\ - ls $(ESMF_LDIR) + ls $(ESMF_LDIR) ; \ fi ;\ cd .. ;\ $(ESMF_RM) -r tmp_$$NEXTLIB ;\ From 0460ac145dc535f5dcafdf70b67226cfc73503ad Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Fri, 21 Mar 2025 23:54:16 -0400 Subject: [PATCH 36/40] BLD:Cygwin: Create binary install directory --- makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/makefile b/makefile index 40876a08be..dccbad69cf 100644 --- a/makefile +++ b/makefile @@ -820,6 +820,7 @@ install: envdump mkdir -p $(ESMF_INSTALL_LIBDIR_ABSPATH) cp -f $(ESMF_LIBDIR)/libesmf*.* $(ESMF_INSTALL_LIBDIR_ABSPATH) ifeq ($(ESMF_OS),Cygwin) + mkdir -p $(ESMF_INSTALL_BINDIR_ABSPATH) cp -f $(ESMF_LIBDIR)/cygesmf*.* $(ESMF_INSTALL_BINDIR_ABSPATH) endif From c9878cdef84804e7f6cc4b50844740707557480f Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Sun, 23 Mar 2025 18:38:44 -0400 Subject: [PATCH 37/40] ENH:ESMPy:Cygwin: Separate DLL loading code from other platforms Cygwin runtime linking is Windows with different naming conventions, rather different from Linux. --- src/addon/esmpy/src/esmpy/interface/loadESMF.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/addon/esmpy/src/esmpy/interface/loadESMF.py b/src/addon/esmpy/src/esmpy/interface/loadESMF.py index ff82d64f73..0a7e4bbed8 100644 --- a/src/addon/esmpy/src/esmpy/interface/loadESMF.py +++ b/src/addon/esmpy/src/esmpy/interface/loadESMF.py @@ -62,6 +62,8 @@ for line in MKFILE: if 'ESMF_LIBSDIR' in line: libsdir = line.split("=")[1] + elif 'ESMF_BINDIR' in line: + bindir = line.split("=", 1)[1].strip() elif 'ESMF_OS:' in line: esmfos = line.split(":")[1] elif 'ESMF_ABI:' in line: @@ -148,8 +150,10 @@ # load the shared library for esmf try: - if constants._ESMF_OS in (constants._ESMF_OS_DARWIN, constants._ESMF_OS_CYGWIN): + if constants._ESMF_OS == constants._ESMF_OS_DARWIN: _ESMF = np.ctypeslib.load_library('libesmf_fullylinked',libsdir) + elif constants._ESMF_OS == constants._ESMF_OS_CYGWIN: + _ESMF = np.ctypeslib.load_library('cygesmf.dll', bindir) else: _ESMF = ct.CDLL(os.path.join(libsdir,'libesmf_fullylinked.so'), mode=ct.RTLD_GLOBAL) From 8ede710e03a847c6869897d981414fbd0e857188 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Mon, 24 Mar 2025 09:49:39 -0400 Subject: [PATCH 38/40] DBG:CI:Cygwin: Find variable names in esmf.mk --- .github/workflows/test-build-cygwin.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index 6178c28ae7..70ae81878a 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -74,6 +74,9 @@ jobs: - name: List ESMF Installed files run: | C:\tools\cygwin\bin\dash.exe -c "/usr/bin/find /tmp/fakeroot" + - name: Print esmf.mk + run: | + C:\tools\cygwin\bin\dash.exe -c "/usr/bin/find /tmp/fakeroot -name esmf.mk -exec cat {} +" - name: ESMF Installcheck env: ESMFMKFILE: "/tmp/fakeroot/usr/lib/libO/Cygwin.gfortran.64.mpiuni.default/esmf.mk" From 406bc948e3ced1b48d38fc4b2b243b2ad3bf5d85 Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 26 Mar 2025 13:59:26 -0400 Subject: [PATCH 39/40] FIX:ESMPy:Cygwin: Fix name of APPSDIR I'm used to it being bindir in Autotools, which many other build systems also use, due to the popularity of Autotools from the mid-'90s through the aughts --- src/addon/esmpy/src/esmpy/interface/loadESMF.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/addon/esmpy/src/esmpy/interface/loadESMF.py b/src/addon/esmpy/src/esmpy/interface/loadESMF.py index 0a7e4bbed8..53b951b6de 100644 --- a/src/addon/esmpy/src/esmpy/interface/loadESMF.py +++ b/src/addon/esmpy/src/esmpy/interface/loadESMF.py @@ -51,6 +51,7 @@ # investigate esmf.mk libsdir = None + appsdir = None esmfos = None esmfabi = None esmfcomm = None @@ -62,8 +63,8 @@ for line in MKFILE: if 'ESMF_LIBSDIR' in line: libsdir = line.split("=")[1] - elif 'ESMF_BINDIR' in line: - bindir = line.split("=", 1)[1].strip() + elif 'ESMF_APPSDIR' in line: + appsdir = line.split("=", 1)[1].strip() elif 'ESMF_OS:' in line: esmfos = line.split(":")[1] elif 'ESMF_ABI:' in line: @@ -153,7 +154,7 @@ if constants._ESMF_OS == constants._ESMF_OS_DARWIN: _ESMF = np.ctypeslib.load_library('libesmf_fullylinked',libsdir) elif constants._ESMF_OS == constants._ESMF_OS_CYGWIN: - _ESMF = np.ctypeslib.load_library('cygesmf.dll', bindir) + _ESMF = np.ctypeslib.load_library('cygesmf.dll', appsdir) else: _ESMF = ct.CDLL(os.path.join(libsdir,'libesmf_fullylinked.so'), mode=ct.RTLD_GLOBAL) From 69481d80f8d05b2174838058fcd9d810548151ea Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Wed, 26 Mar 2025 18:03:58 -0400 Subject: [PATCH 40/40] CI:Cygwin: Install version of pytest compatible with python version --- .github/workflows/test-build-cygwin.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build-cygwin.yml b/.github/workflows/test-build-cygwin.yml index 70ae81878a..db756b9b3f 100644 --- a/.github/workflows/test-build-cygwin.yml +++ b/.github/workflows/test-build-cygwin.yml @@ -49,7 +49,7 @@ jobs: openmpi gcc-core gcc-fortran gcc-g++ libnetcdf-devel libnetcdf-fortran-devel texlive-collection-latex texlive-collection-latexextra perl make bash dash liblapack-devel cmake libyaml-devel - python39-devel python39-pip python39-numpy python39-pytest + python39-devel python39-pip python39-numpy python39-pytest==7.3.0 - name: Set Windows PATH uses: egor-tensin/cleanup-path@v3 with: @@ -86,6 +86,7 @@ jobs: env: ESMFMKFILE: "/tmp/fakeroot/usr/lib/libO/Cygwin.gfortran.64.mpiuni.default/esmf.mk" run: | + C:\tools\cygwin\bin\dash.exe -c "/usr/bin/python -m pip install pytest" C:\tools\cygwin\bin\dash.exe -c "cd src/addon/esmpy; /usr/bin/make download test_all" - name: Build ESMF Docs run: |