From cd606285669a3c8026a6c7c6990067690e7b0e15 Mon Sep 17 00:00:00 2001 From: Hyo-Kyung Lee Date: Sun, 10 Mar 2024 22:04:18 -0500 Subject: [PATCH 1/6] Add Cygwin GitHub Action. --- .github/workflows/cwin-auto.yml | 59 ++++++++++++++++++++++++++++++++ .github/workflows/cwin-cmake.yml | 50 +++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 .github/workflows/cwin-auto.yml create mode 100644 .github/workflows/cwin-cmake.yml diff --git a/.github/workflows/cwin-auto.yml b/.github/workflows/cwin-auto.yml new file mode 100644 index 00000000000..4402845518e --- /dev/null +++ b/.github/workflows/cwin-auto.yml @@ -0,0 +1,59 @@ +name: hdf5 dev autotools Cygwin + +on: + workflow_call: + inputs: + build_mode: + description: "release vs. debug build" + required: true + type: string + +permissions: + contents: read + +jobs: + cygwin_build_and_test: + name: "Cygwin ${{ inputs.build_mode }}" + runs-on: windows-latest + steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf input + + - uses: actions/checkout@v4 + + - name: Install Cygwin + uses: cygwin/cygwin-install-action@master + with: + packages: automake make gcc-fortran libjpeg-devel libtool zlib-devel + + - name: Autotools Configure + run: | + export PATH=/usr/bin:$PATH + ./autogen.sh + ./configure --enable-build-mode=${{ inputs.build_mode }} + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + + - name: Autotools Build + run: | + export PATH=/usr/bin:$PATH + make + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + + - name: Autotools Run Tests + run: | + export PATH=/usr/bin:$PATH + make check + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + + - name: Autotools Install + run: | + export PATH=/usr/bin:$PATH + make install + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + + - name: Autotools Uninstall + run: | + export PATH=/usr/bin:$PATH + make uninstall + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' diff --git a/.github/workflows/cwin-cmake.yml b/.github/workflows/cwin-cmake.yml new file mode 100644 index 00000000000..cc32f2c70b9 --- /dev/null +++ b/.github/workflows/cwin-cmake.yml @@ -0,0 +1,50 @@ +name: hdf5 dev CMake Cygwin + +on: + workflow_call: + inputs: + build_mode: + description: "release vs. debug build" + required: true + type: string + +jobs: + cygwin_build_and_test: + name: "Cygwin ${{ inputs.build_mode }}" + runs-on: windows-latest + steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf input + + - uses: actions/checkout@v4 + + - name: Install Cygwin + uses: cygwin/cygwin-install-action@master + with: + packages: cmake gcc-fortran make ninja perl zlib-devel + + - name: Configure + run: | + export PATH=/usr/bin:$PATH + mkdir build + cd build + cmake -G Ninja \ + -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ + -D BUILD_SHARED_LIBS:BOOL=OFF \ + .. + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + + - name: Build + run: | + export PATH=/usr/bin:$PATH + cd build + ctest -T Build + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + + - name: Test + run: | + export PATH=/usr/bin:$PATH + cd build + ctest -T Test + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' From 62cd9d871504696aad5b639776f158eed76385e8 Mon Sep 17 00:00:00 2001 From: Hyo-Kyung Lee Date: Sun, 10 Mar 2024 22:13:51 -0500 Subject: [PATCH 2/6] Update main actions to call Cygwin actions. --- .github/workflows/autotools.yml | 6 ++++++ .github/workflows/cmake.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/autotools.yml b/.github/workflows/autotools.yml index 4075b259d79..c87badec4e4 100644 --- a/.github/workflows/autotools.yml +++ b/.github/workflows/autotools.yml @@ -70,3 +70,9 @@ jobs: uses: ./.github/workflows/nvhpc-auto.yml with: build_mode: "production" + + call-release-auto-cygwin: + name: "Autotools Cygwin Workflows" + uses: ./.github/workflows/cwin-auto.yml + with: + build_mode: "production" diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 7911be7354e..3153d3048e6 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -73,3 +73,9 @@ jobs: uses: ./.github/workflows/nvhpc-cmake.yml with: build_mode: "Release" + + call-release-cmake-cygwin: + name: "CMake Cygwin Workflows" + uses: ./.github/workflows/cwin-cmake.yml + with: + build_mode: "Release" From df5afb1c24d92d730d9202c1acc2dd51d3afed6a Mon Sep 17 00:00:00 2001 From: Hyo-Kyung Lee Date: Mon, 11 Mar 2024 12:33:40 -0500 Subject: [PATCH 3/6] Address @byrnHDF review. --- .github/workflows/autotools.yml | 2 +- .github/workflows/cmake.yml | 2 +- .github/workflows/{cwin-auto.yml => cygwin-auto.yml} | 0 .github/workflows/{cwin-cmake.yml => cygwin-cmake.yml} | 0 config/cmake/ConfigureChecks.cmake | 4 ++++ 5 files changed, 6 insertions(+), 2 deletions(-) rename .github/workflows/{cwin-auto.yml => cygwin-auto.yml} (100%) rename .github/workflows/{cwin-cmake.yml => cygwin-cmake.yml} (100%) diff --git a/.github/workflows/autotools.yml b/.github/workflows/autotools.yml index c87badec4e4..1714a2305cb 100644 --- a/.github/workflows/autotools.yml +++ b/.github/workflows/autotools.yml @@ -73,6 +73,6 @@ jobs: call-release-auto-cygwin: name: "Autotools Cygwin Workflows" - uses: ./.github/workflows/cwin-auto.yml + uses: ./.github/workflows/cygwin-auto.yml with: build_mode: "production" diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3153d3048e6..6a0fd5e7727 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -76,6 +76,6 @@ jobs: call-release-cmake-cygwin: name: "CMake Cygwin Workflows" - uses: ./.github/workflows/cwin-cmake.yml + uses: ./.github/workflows/cygwin-cmake.yml with: build_mode: "Release" diff --git a/.github/workflows/cwin-auto.yml b/.github/workflows/cygwin-auto.yml similarity index 100% rename from .github/workflows/cwin-auto.yml rename to .github/workflows/cygwin-auto.yml diff --git a/.github/workflows/cwin-cmake.yml b/.github/workflows/cygwin-cmake.yml similarity index 100% rename from .github/workflows/cwin-cmake.yml rename to .github/workflows/cygwin-cmake.yml diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 59755334d20..9bad217ba11 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -51,6 +51,10 @@ endmacro () # ---------------------------------------------------------------------- set (WINDOWS) +if (CYGWIN) + set (HDF5_CMAKE_C_FLAGS ${HDF5_CMAKE_C_FLAGS} -D_GNU_SOURCE) +endif() + if (MINGW) set (${HDF_PREFIX}_HAVE_MINGW 1) set (WINDOWS 1) # MinGW tries to imitate Windows From 8f7198eae1e9e1e10e9796cca4c290363d5a3533 Mon Sep 17 00:00:00 2001 From: Hyo-Kyung Lee Date: Mon, 11 Mar 2024 14:03:43 -0500 Subject: [PATCH 4/6] Apply CMake equivalent patch to Autotools. --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 4646ba78368..477e0e4583e 100644 --- a/configure.ac +++ b/configure.ac @@ -1519,6 +1519,10 @@ case "$host_cpu-$host_vendor-$host_os" in AC_DEFINE([HAVE_MINGW], [1], [Define if using MinGW]) H5_CPPFLAGS="-D_GNU_SOURCE -D__USE_MINGW_ANSI_STDIO $H5_CPPFLAGS" ;; + *cygwin*) + AC_DEFINE([HAVE_CYGWIN], [1], [Define if using MinGW]) + H5_CPPFLAGS="-D_GNU_SOURCE" + ;; esac ## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible From 180e1d843cb0d21779bd71a15b69afcba95bc3a2 Mon Sep 17 00:00:00 2001 From: Hyo-Kyung Lee Date: Mon, 11 Mar 2024 14:24:25 -0500 Subject: [PATCH 5/6] Address @byrnHDF review. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 477e0e4583e..77a3d19cfa8 100644 --- a/configure.ac +++ b/configure.ac @@ -1521,7 +1521,7 @@ case "$host_cpu-$host_vendor-$host_os" in ;; *cygwin*) AC_DEFINE([HAVE_CYGWIN], [1], [Define if using MinGW]) - H5_CPPFLAGS="-D_GNU_SOURCE" + H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" ;; esac From dfd079fc1d97dcc7ab04787f88839394cb8ac8a7 Mon Sep 17 00:00:00 2001 From: Hyo-Kyung Lee Date: Mon, 11 Mar 2024 14:26:09 -0500 Subject: [PATCH 6/6] Fix comment: MinGW->Cygwin --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 77a3d19cfa8..37b65e5cf85 100644 --- a/configure.ac +++ b/configure.ac @@ -1520,7 +1520,7 @@ case "$host_cpu-$host_vendor-$host_os" in H5_CPPFLAGS="-D_GNU_SOURCE -D__USE_MINGW_ANSI_STDIO $H5_CPPFLAGS" ;; *cygwin*) - AC_DEFINE([HAVE_CYGWIN], [1], [Define if using MinGW]) + AC_DEFINE([HAVE_CYGWIN], [1], [Define if using Cygwin]) H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" ;; esac