Skip to content

Commit

Permalink
Fix binary examples process (HDFGroup#4666)
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnHDF committed Jul 30, 2024
1 parent 9f0ec74 commit 01d96bc
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 24 deletions.
65 changes: 63 additions & 2 deletions .github/workflows/cmake-bintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
# MacOS w/ Clang + CMake
#
name: "MacOS Clang Binary Test"
runs-on: macos-latest
runs-on: macos-13
steps:
- name: Install Dependencies (MacOS)
run: brew install ninja doxygen
Expand All @@ -161,7 +161,7 @@ jobs:
- name: Get published binary (MacOS)
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-osx-${{ inputs.build_mode }}-binary
name: tgz-osx13-${{ inputs.build_mode }}-binary
path: ${{ github.workspace }}

- name: Uncompress hdf5 binary (MacOS)
Expand Down Expand Up @@ -204,3 +204,64 @@ jobs:
cmake --workflow --preset=ci-StdShar-OSX-Clang --fresh
shell: bash

test_binary_mac_latest:
# MacOS w/ Clang + CMake
#
name: "MacOS Clang Binary Test"
runs-on: macos-latest
steps:
- name: Install Dependencies (MacOS_latest)
run: brew install ninja doxygen

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Get published binary (MacOS_latest)
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-osx-${{ inputs.build_mode }}-binary
path: ${{ github.workspace }}

- name: Uncompress hdf5 binary (MacOS_latest)
run: |
cd "${{ github.workspace }}"
tar -zxvf ${{ github.workspace }}/HDF5-*-Darwin.tar.gz --strip-components 1
- name: set hdf5lib name
id: set-hdf5lib-name
run: |
HDF5DIR=${{ github.workspace }}/HDF_Group/HDF5/
FILE_NAME_HDF5=$(ls ${{ github.workspace }}/HDF_Group/HDF5)
echo "HDF5_ROOT=$HDF5DIR$FILE_NAME_HDF5" >> $GITHUB_OUTPUT
echo "HDF5_PLUGIN_PATH=$HDF5_ROOT/lib/plugin" >> $GITHUB_OUTPUT
- name: List files for the binaries (MacOS_latest)
run: |
ls -l ${{ github.workspace }}/HDF_Group/HDF5
- name: List files for the space (MacOS_latest)
run: |
ls ${{ github.workspace }}
ls ${{ runner.workspace }}
# symlinks the compiler executables to a common location
- name: Setup GNU Fortran
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: gcc
version: 12

- name: Run ctest (MacOS_latest)
id: run-ctest
env:
HDF5_ROOT: ${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }}
HDF5_PLUGIN_PATH: ${{ steps.set-hdf5lib-name.outputs.HDF5_PLUGIN_PATH }}
run: |
cd "${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }}/share/HDF5Examples"
cmake --workflow --preset=ci-StdShar-OSX-Clang --fresh
shell: bash

117 changes: 108 additions & 9 deletions .github/workflows/cmake-ctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,15 @@ jobs:
cmake --workflow --preset=${{ inputs.preset_name }}-MSVC --fresh
shell: bash

- name: Publish binary (Windows)
id: publish-ctest-binary
- name: Create build folders (Windows)
run: |
mkdir "${{ runner.workspace }}/build"
mkdir "${{ runner.workspace }}/build/hdf5"
shell: bash

- name: Publish binary (Windows)
id: publish-ctest-binary
run: |
Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-MSVC/README.md -Destination ${{ runner.workspace }}/build/hdf5/
Expand All @@ -102,8 +106,6 @@ jobs:
- name: Publish msi binary (Windows)
id: publish-ctest-msi-binary
run: |
mkdir "${{ runner.workspace }}/build"
mkdir "${{ runner.workspace }}/build/hdf5"
Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-MSVC/README.md -Destination ${{ runner.workspace }}/build/hdf5/
Expand Down Expand Up @@ -273,6 +275,12 @@ jobs:
with:
version: "1.9.7"

- name: Set up JDK 19
uses: actions/setup-java@v4
with:
java-version: '19'
distribution: 'temurin'

- name: Set file base name (MacOS)
id: set-file-base
run: |
Expand Down Expand Up @@ -326,7 +334,7 @@ jobs:
cp ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-Clang/README.md ${{ runner.workspace }}/build/hdf5
cp ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-Clang/*.tar.gz ${{ runner.workspace }}/build/hdf5
cd "${{ runner.workspace }}/build"
tar -zcvf ${{ steps.set-file-base.outputs.FILE_BASE }}-osx.tar.gz hdf5
tar -zcvf ${{ steps.set-file-base.outputs.FILE_BASE }}-osx13.tar.gz hdf5
shell: bash

- name: List files in the space (MacOS)
Expand All @@ -336,6 +344,95 @@ jobs:
# Save files created by ctest script
- name: Save published binary (MacOS)
uses: actions/upload-artifact@v4
with:
name: tgz-osx13-binary
path: ${{ runner.workspace }}/build/${{ steps.set-file-base.outputs.FILE_BASE }}-osx13.tar.gz
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

build_and_test_mac_latest:
# MacOS w/ Clang + CMake
#
name: "MacOS Clang CMake"
runs-on: macos-latest
steps:
- name: Install Dependencies (MacOS_latest)
run: brew install ninja

- name: Install Dependencies
uses: ssciwr/doxygen-install@v1
with:
version: "1.9.7"

- name: Set up JDK 19
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Set file base name (MacOS_latest)
id: set-file-base
run: |
FILE_NAME_BASE=$(echo "${{ inputs.file_base }}")
echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT
if [[ '${{ inputs.use_environ }}' == 'release' ]]
then
SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}")
else
SOURCE_NAME_BASE=$(echo "hdfsrc")
fi
echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT
# Get files created by release script
- name: Get tgz-tarball (MacOS_latest)
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-tarball
path: ${{ github.workspace }}

- name: List files for the space (MacOS_latest)
run: |
ls ${{ github.workspace }}
ls ${{ runner.workspace }}
- name: Uncompress source (MacOS_latest)
run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz

# symlinks the compiler executables to a common location
- name: Setup GNU Fortran
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: gcc
version: 12

- name: Run ctest (MacOS_latest)
id: run-ctest
run: |
cd "${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}"
cmake --workflow --preset=${{ inputs.preset_name }}-OSX-Clang --fresh
shell: bash

- name: Publish binary (MacOS_latest)
id: publish-ctest-binary
run: |
mkdir "${{ runner.workspace }}/build"
mkdir "${{ runner.workspace }}/build/hdf5"
cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING ${{ runner.workspace }}/build/hdf5
cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 ${{ runner.workspace }}/build/hdf5
cp ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-Clang/README.md ${{ runner.workspace }}/build/hdf5
cp ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-Clang/*.tar.gz ${{ runner.workspace }}/build/hdf5
cd "${{ runner.workspace }}/build"
tar -zcvf ${{ steps.set-file-base.outputs.FILE_BASE }}-osx.tar.gz hdf5
shell: bash

- name: List files in the space (MacOS_latest)
run: |
ls ${{ github.workspace }}
ls -l ${{ runner.workspace }}
# Save files created by ctest script
- name: Save published binary (MacOS_latest)
uses: actions/upload-artifact@v4
with:
name: tgz-osx-binary
Expand Down Expand Up @@ -477,11 +574,15 @@ jobs:
cmake --workflow --preset=${{ inputs.preset_name }}-win-Intel --fresh
shell: pwsh

- name: Publish binary (Windows_intel)
id: publish-ctest-binary
- name: Create build folders (Windows_intel)
run: |
mkdir "${{ runner.workspace }}/build"
mkdir "${{ runner.workspace }}/build/hdf5"
shell: bash

- name: Publish binary (Windows_intel)
id: publish-ctest-binary
run: |
Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-Intel/README.md -Destination ${{ runner.workspace }}/build/hdf5/
Expand All @@ -493,8 +594,6 @@ jobs:
- name: Publish msi binary (Windows_intel)
id: publish-ctest-msi-binary
run: |
mkdir "${{ runner.workspace }}/build"
mkdir "${{ runner.workspace }}/build/hdf5"
Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-Intel/README.md -Destination ${{ runner.workspace }}/build/hdf5/
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/main-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,14 @@ jobs:
if: ${{ (matrix.os == 'ubuntu-latest') && (inputs.thread_safety != 'TS') }}

- name: Save published binary (Mac)
uses: actions/upload-artifact@v4
with:
name: tgz-osx13-${{ inputs.build_mode }}-binary
path: ${{ runner.workspace }}/build/HDF5-*-Darwin.tar.gz
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
if: ${{ (matrix.os == 'macos-13') && (inputs.thread_safety != 'TS') }}

- name: Save published binary (Mac_latest)
uses: actions/upload-artifact@v4
with:
name: tgz-osx-${{ inputs.build_mode }}-binary
Expand Down
12 changes: 10 additions & 2 deletions HDF5Examples/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
"description": "MSVC Standard Config for x64 (Release)",
"inherits": [
"ci-x64-Release-MSVC",
"ci-StdJava",
"ci-StdFortran",
"ci-StdShar"
]
},
Expand All @@ -57,6 +59,8 @@
"description": "Clang Standard Config for x64 (Release)",
"inherits": [
"ci-x64-Release-Clang",
"ci-StdJava",
"ci-StdFortran",
"ci-StdShar"
]
},
Expand All @@ -65,6 +69,8 @@
"description": "GNUC Standard Config for x64 (Release)",
"inherits": [
"ci-x64-Release-GNUC",
"ci-StdJava",
"ci-StdFortran",
"ci-StdShar"
]
},
Expand All @@ -73,6 +79,8 @@
"description": "Intel Standard Config for x64 (Release)",
"inherits": [
"ci-x64-Release-Intel",
"ci-StdJava",
"ci-StdFortran",
"ci-StdShar"
]
}
Expand All @@ -98,7 +106,7 @@
"name": "ci-StdShar-GNUC",
"description": "GNUC Standard Build for x64 (Release)",
"configurePreset": "ci-StdShar-GNUC",
"verbose": false,
"verbose": true,
"inherits": [
"ci-x64-Release-GNUC"
]
Expand All @@ -107,7 +115,7 @@
"name": "ci-StdShar-Intel",
"description": "Intel Standard Build for x64 (Release)",
"configurePreset": "ci-StdShar-Intel",
"verbose": false,
"verbose": true,
"inherits": [
"ci-x64-Release-Intel"
]
Expand Down
21 changes: 10 additions & 11 deletions HDF5Examples/config/cmake/HDFExampleMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,17 @@ macro (HDF5_SUPPORT)
endif ()
set (H5EX_HDF5_DUMP_EXECUTABLE $<TARGET_FILE:${HDF5_NAMESPACE}h5dump>)
else ()
if (HDF5_BUILD_MODE)
string (TOUPPER "_${HDF5_BUILD_MODE}" UPPER_BUILD_TYPE)
elseif (HDF_CFG_NAME)
string (TOUPPER "_${HDF_CFG_NAME}" UPPER_BUILD_TYPE)
else ()
set (UPPER_BUILD_TYPE "")
endif ()
get_filename_component (_LIBRARY_PATH ${HDF5_INCLUDE_DIR} DIRECTORY)
set (HDF5_LIBRARY_PATH "${_LIBRARY_PATH}/lib")
if (USE_SHARED_LIBS AND HDF5_shared_C_FOUND)
set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} ${HDF5_C_SHARED_LIBRARY})
set (HDF5_LIBRARY_PATH ${PACKAGE_PREFIX_DIR}/lib)
else ()
set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} ${HDF5_C_STATIC_LIBRARY})
endif ()
Expand Down Expand Up @@ -227,20 +235,11 @@ macro (HDF5_SUPPORT)
if (HDF_BUILD_JAVA AND HDF5_Java_FOUND)
if (${HDF5_BUILD_JAVA})
set (CMAKE_JAVA_INCLUDE_PATH "${CMAKE_JAVA_INCLUDE_PATH};${HDF5_JAVA_INCLUDE_DIRS}")
if (HDF5_BUILD_MODE)
string(TOUPPER "${HDF5_BUILD_MODE}" UPPER_BUILD_TYPE)
get_target_property(libsoname ${HDF5_JAVA_LIBRARY} IMPORTED_SONAME_${UPPER_BUILD_TYPE})
elseif (HDF_CFG_NAME)
string(TOUPPER "${HDF_CFG_NAME}" UPPER_BUILD_TYPE)
get_target_property(libsoname ${HDF5_JAVA_LIBRARY} IMPORTED_SONAME_${UPPER_BUILD_TYPE})
else()
get_target_property(libsoname ${HDF5_JAVA_LIBRARY} IMPORTED_SONAME)
endif()
get_target_property (libsoname ${HDF5_JAVA_LIBRARY} IMPORTED_SONAME${UPPER_BUILD_TYPE})
get_filename_component (libname ${libsoname} NAME_WE)
string (REGEX REPLACE "^lib" "" libname ${libname})
message (STATUS "HDF5 lib:${HDF5_JAVA_LIBRARY} OR ${libsoname} OR ${libname}")
set (H5EX_JAVA_LIBRARY ${libname})
# set (H5EX_JAVA_LIBRARY $<TARGET_FILE_BASE_NAME:${HDF5_JAVA_LIBRARY}>)
set (H5EX_JAVA_LIBRARIES ${HDF5_JAVA_LIBRARY})
message (STATUS "HDF5 lib:${H5EX_JAVA_LIBRARY} jars:${HDF5_JAVA_INCLUDE_DIRS}}")
else ()
Expand Down

0 comments on commit 01d96bc

Please sign in to comment.