Skip to content

Commit

Permalink
Merge remote-tracking branch 'canonical/develop' into refactor_h5fd_a…
Browse files Browse the repository at this point in the history
…nd_packages
  • Loading branch information
derobins committed Oct 24, 2024
2 parents 257f7c7 + 26cf164 commit 52fdac5
Show file tree
Hide file tree
Showing 23 changed files with 569 additions and 173 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/julia-auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ jobs:
name: "julia ${{ inputs.build_mode }}"
runs-on: ubuntu-latest
steps:
- name: Get Sources
- name: Get HDF5 source
uses: actions/[email protected]

# Checking out the Julia HDF5 wrappers will clobber the HDF5 checkout
# NOTE: Remove this when the Julia wrappers have been patched
- name: Save the Julia patch file
shell: bash
run: |
mkdir "${{ runner.workspace }}/julia_patch"
cp .github/workflows/julia_ci.patch "${{ runner.workspace }}/julia_patch"
- name: Install Dependencies
shell: bash
run: |
Expand Down Expand Up @@ -65,6 +73,11 @@ jobs:
repository: JuliaIO/HDF5.jl
path: .

# NOTE: Remove this when the Julia wrappers have been patched
- name: Patch Julia CI
run: |
git apply "${{ runner.workspace }}/julia_patch/julia_ci.patch" -v
- name: Generate LocalPreferences
run: |
echo '[HDF5]' >> LocalPreferences.toml
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/julia-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ jobs:
name: "julia ${{ inputs.build_mode }}"
runs-on: ubuntu-latest
steps:
- name: Get Sources
- name: Get HDF5 source
uses: actions/[email protected]

# Checking out the Julia HDF5 wrappers will clobber the HDF5 checkout
# NOTE: Remove this when the Julia wrappers have been patched
- name: Save the Julia patch file
shell: bash
run: |
mkdir "${{ runner.workspace }}/julia_patch"
cp .github/workflows/julia_ci.patch "${{ runner.workspace }}/julia_patch"
- name: Install Dependencies
shell: bash
run: |
Expand Down Expand Up @@ -68,6 +76,11 @@ jobs:
repository: JuliaIO/HDF5.jl
path: .

# NOTE: Remove this when the Julia wrappers have been patched
- name: Patch Julia CI
run: |
git apply "${{ runner.workspace }}/julia_patch/julia_ci.patch" -v
- name: Generate LocalPreferences
run: |
echo '[HDF5]' >> LocalPreferences.toml
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/julia_ci.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/test/objects.jl b/test/objects.jl
index d68dd749..0541e91a 100644
--- a/test/objects.jl
+++ b/test/objects.jl
@@ -16,7 +16,13 @@ using HDF5.API
h5open(fn, "r") do h5f
@test API.h5o_exists_by_name(h5f, "data")
@test API.h5o_exists_by_name(h5f, "lore")
- @test_throws API.H5Error API.h5o_exists_by_name(h5f, "noonian")
+ @static if HDF5.API.h5_get_libversion() <= v"1.14.5"
+ # Buggy behavior in earlier versions of HDF5 returns FAIL (-1)
+ @test_throws API.H5Error API.h5o_exists_by_name(h5f, "noonian")
+ else
+ # The correct behavior is to return false (0)
+ @test API.h5o_exists_by_name(h5f, "noonian") == 0
+ end

loc_id = API.h5o_open(h5f, "data", API.H5P_DEFAULT)
try
10 changes: 9 additions & 1 deletion CMakeFilters.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
endif ()
set(H5_ZLIB_FOUND ${ZLIB_FOUND})
if (H5_ZLIB_FOUND)
set (H5_ZLIB_HEADER "zlib.h")
if (HDF5_USE_ZLIB_NG)
set (H5_ZLIB_HEADER "zlib-ng.h")
else ()
set (H5_ZLIB_HEADER "zlib.h")
endif ()
set (H5_ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR})
set (H5_ZLIB_INCLUDE_DIRS ${H5_ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR})
# The FindZLIB.cmake module does not set an OUTPUT_NAME
Expand All @@ -125,6 +129,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
if (H5_ZLIB_FOUND)
set (H5_HAVE_FILTER_DEFLATE 1)
set (H5_HAVE_ZLIB_H 1)
if (HDF5_USE_ZLIB_NG)
set (H5_HAVE_ZLIBNG_H 1)
endif ()
set (H5_HAVE_LIBZ 1)
if (H5_HAVE_FILTER_DEFLATE)
set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE")
Expand All @@ -135,6 +142,7 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
set (HDF5_ENABLE_Z_LIB_SUPPORT OFF CACHE BOOL "" FORCE)
message (WARNING " ZLib support in HDF5 was enabled but not found")
endif ()
message(STATUS "H5_ZLIB_HEADER=${H5_ZLIB_HEADER}")
endif ()

#-----------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"hidden": true,
"cacheVariables": {
"ZLIB_PACKAGE_NAME": {"type": "STRING", "value": "zlib"},
"ZLIB_TGZ_ORIGPATH": {"type": "STRING", "value": "https://github.com/madler/zlib/releases/download/v1.3"},
"ZLIB_TGZ_NAME": {"type": "STRING", "value": "zlib-1.3.tar.gz"},
"ZLIB_TGZ_ORIGPATH": {"type": "STRING", "value": "https://github.com/madler/zlib/releases/download/v1.3.1"},
"ZLIB_TGZ_NAME": {"type": "STRING", "value": "zlib-1.3.1.tar.gz"},
"ZLIBNG_PACKAGE_NAME": {"type": "STRING", "value": "zlib-ng"},
"ZLIBNG_TGZ_ORIGPATH": {"type": "STRING", "value": "https://github.com/zlib-ng/zlib-ng/archive/refs/tags"},
"ZLIBNG_TGZ_NAME": {"type": "STRING", "value": "2.1.6.tar.gz"},
"ZLIBNG_TGZ_NAME": {"type": "STRING", "value": "2.2.2.tar.gz"},
"LIBAEC_PACKAGE_NAME": {"type": "STRING", "value": "libaec"},
"LIBAEC_TGZ_ORIGPATH": {"type": "STRING", "value": "https://github.com/MathisRosenhauer/libaec/releases/download/v1.1.3"},
"LIBAEC_TGZ_NAME": {"type": "STRING", "value": "libaec-1.1.3.tar.gz"}
Expand Down
3 changes: 3 additions & 0 deletions config/cmake/H5pubconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@
/* Define to 1 if you have the <zlib.h> header file. */
#cmakedefine H5_HAVE_ZLIB_H @H5_HAVE_ZLIB_H@

/* Define to 1 if you have the <zlib.h> header file. */
#cmakedefine H5_HAVE_ZLIBNG_H @H5_HAVE_ZLIBNG_H@

/* Define to 1 if you have the `_getvideoconfig' function. */
#cmakedefine H5_HAVE__GETVIDEOCONFIG @H5_HAVE__GETVIDEOCONFIG@

Expand Down
5 changes: 5 additions & 0 deletions config/cmake/HDFLibMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
add_library(${HDF_PACKAGE_NAMESPACE}zlib-static ALIAS zlib-static)
set (H5_ZLIB_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-static")
set (H5_ZLIB_LIBRARIES ${H5_ZLIB_STATIC_LIBRARY})
if (HDF5_USE_ZLIB_NG)
set (H5_ZLIB_HEADER "zlib-ng.h")
else ()
set (H5_ZLIB_HEADER "zlib.h")
endif ()

set (H5_ZLIB_INCLUDE_DIR_GEN "${hdf5_zlib_BINARY_DIR}")
set (H5_ZLIB_INCLUDE_DIR "${hdf5_zlib_SOURCE_DIR}")
Expand Down
2 changes: 1 addition & 1 deletion config/cmake/LIBAEC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ target_include_directories (${LIBAEC_LIB_TARGET} PUBLIC
"$<BUILD_INTERFACE:${LIBAEC_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>"
"$<INSTALL_INTERFACE:include>")
if (CMAKE_C_COMPILER_ID MATCHES "IntelLLVM" OR CMAKE_C_COMPILER_ID MATCHES "[Cc]lang")
if (CMAKE_C_COMPILER_ID MATCHES "IntelLLVM" OR (CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0))
target_compile_options(${LIBAEC_LIB_TARGET} PRIVATE -Wno-deprecated-non-prototype)
endif ()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
Expand Down
8 changes: 6 additions & 2 deletions config/cmake/ZLIB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.18)
set (CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
project (ZLIB C)

set (VERSION "1.3")
set(VERSION "1.3.1")

#-----------------------------------------------------------------------------
# Basic ZLIB stuff here
Expand Down Expand Up @@ -131,6 +131,7 @@ set_directory_properties (PROPERTIES INCLUDE_DIRECTORIES
if (MSVC)
set(CMAKE_DEBUG_POSTFIX "d")
add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1)
add_definitions (-D_CRT_SECURE_NO_DEPRECATE)
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
add_definitions (-D_CONSOLE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
Expand Down Expand Up @@ -191,7 +192,10 @@ set(ZLIB_SRCS
)

add_library(${ZLIB_LIB_TARGET} STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
target_include_directories(${ZLIB_LIB_TARGET} PRIVATE "${CMAKE_BINARY_DIR}")
target_include_directories(${ZLIB_LIB_TARGET}
PRIVATE "${CMAKE_BINARY_DIR}"
PUBLIC "${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}"
)
if (MSVC AND CMAKE_CL_64)
set_target_properties (${ZLIB_LIB_TARGET} PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
endif ()
Expand Down
Loading

0 comments on commit 52fdac5

Please sign in to comment.