Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add msys2 workflow for CMake #4991

Merged
merged 21 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,14 @@ jobs:
name: "CMake TestExpress Workflows"
uses: ./.github/workflows/testxpr-cmake.yml

# call-release-cmake-julia:
# name: "CMake Julia Workflows"
# uses: ./.github/workflows/julia-cmake.yml
# with:
# build_mode: "Release"
# call-release-cmake-julia:
# name: "CMake Julia Workflows"
# uses: ./.github/workflows/julia-cmake.yml
# with:
# build_mode: "Release"

call-release-cmake-msys2:
name: "CMake Msys2 Workflows"
uses: ./.github/workflows/msys2-cmake.yml
with:
build_mode: "Release"
91 changes: 91 additions & 0 deletions .github/workflows/msys2-cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: hdf5 dev CMake MSys2 CI

# Triggers the workflow on a call from another workflow
on:
workflow_call:
inputs:
build_mode:
description: "release vs. debug build"
required: true
type: string

permissions:
contents: read

jobs:

CMake_build_and_test:

# The type of runner that the job will run on
runs-on: windows-latest
strategy:
matrix:
include:
- { icon: '⬛', sys: mingw32 }
- { icon: '🟦', sys: mingw64 }
- { icon: '🟨', sys: ucrt64 }
- { icon: '🟧', sys: clang64 }
name: ${{ matrix.icon }} MSYS2-${{ matrix.sys }}-${{ inputs.build_mode }}
defaults:
run:
shell: msys2 {0}

steps:
- name: '${{ matrix.icon }} Setup MSYS2'
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
install: >-
base-devel
git
gcc
make
development
pacboy: >-
toolchain:p
cmake:p
ninja:p

- name: Set git to use LF
run: |
git config --global core.autocrlf input

- name: Get Sources
uses: actions/[email protected]

- name: CMake Configure
run: |
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
-DCMAKE_TOOLCHAIN_FILE="" \
-DHDF5_GENERATE_HEADERS=OFF \
-DBUILD_SHARED_LIBS=ON \
-DHDF5_ENABLE_ALL_WARNINGS=ON \
-DHDF5_ENABLE_PARALLEL:BOOL=OFF \
-DHDF5_BUILD_CPP_LIB:BOOL=OFF \
-DHDF5_BUILD_FORTRAN=OFF \
-DHDF5_BUILD_JAVA=OFF \
-DHDF5_BUILD_DOC=OFF \
-DLIBAEC_USE_LOCALCONTENT=OFF \
-DZLIB_USE_LOCALCONTENT=OFF \
$GITHUB_WORKSPACE

- name: CMake Build
run: |
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
working-directory: ${{ runner.workspace }}/build

- name: CMake Run Tests
run: |
ctest . --parallel 2 -C ${{ inputs.build_mode }} -V -E "tfloatsattrs|testhdf5-base|cache_api|dt_arith|H5TEST-dtypes|err_compat"
working-directory: ${{ runner.workspace }}/build

- name: CMake Run Expected to Fail Tests
run: |
ctest . --parallel 2 -C ${{ inputs.build_mode }} -V -R "tfloatsattrs|testhdf5-base|cache_api|dt_arith|H5TEST-dtypes|err_compat"
working-directory: ${{ runner.workspace }}/build
continue-on-error: true
7 changes: 7 additions & 0 deletions .github/workflows/nvhpc-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ jobs:
ctest . -E "MPI_TEST|H5TEST-dt_arith|H5TEST-dtransform" --parallel 2 -C ${{ inputs.build_mode }} -V
working-directory: ${{ runner.workspace }}/build

- name: CMake Run Expected To Fail Tests
shell: bash
run: |
ctest . -R "H5TEST-dt_arith|H5TEST-dtransform" --parallel 2 -C ${{ inputs.build_mode }} -V
working-directory: ${{ runner.workspace }}/build
continue-on-error: true

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put this in a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

- name: CMake Run Parallel Tests
shell: bash
run: |
Expand Down
9 changes: 7 additions & 2 deletions config/cmake/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ else ()
set(C_INCLUDE_QUADMATH_H 0)
endif ()

if (CYGWIN)
if (MINGW OR CYGWIN)
set (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE")
add_definitions ("-D_GNU_SOURCE")
endif ()
Expand Down Expand Up @@ -399,7 +399,12 @@ endif ()
#-----------------------------------------------------------------------------
# Check for some functions that are used
#
CHECK_FUNCTION_EXISTS (alarm ${HDF_PREFIX}_HAVE_ALARM)
if (NOT MINGW)
# alarm(2) support is spotty in MinGW, so assume it doesn't exist
#
# https://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00040.html
CHECK_FUNCTION_EXISTS (alarm ${HDF_PREFIX}_HAVE_ALARM)
endif ()
CHECK_FUNCTION_EXISTS (fcntl ${HDF_PREFIX}_HAVE_FCNTL)
CHECK_FUNCTION_EXISTS (flock ${HDF_PREFIX}_HAVE_FLOCK)
CHECK_FUNCTION_EXISTS (fork ${HDF_PREFIX}_HAVE_FORK)
Expand Down
12 changes: 12 additions & 0 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ New Features

Configuration:
-------------
- Added support for MinGW + MSYS2 when building with CMake

We previously added support for this to the Autotools and the appropriate
configure-time checks have been added to CMake.

CMake + MinGW + MSYS2 is now tested with the following environments:

* mingw32
* mingw64
* ucrt64
* clang64

- Added CMake build mode flags to the libhdf5.settings file

Flags from the CMake build mode (e.g., optimization) are not a part of
Expand Down
Loading