Skip to content

Commit

Permalink
WIP Update HDF5 library to 1.14.4-3
Browse files Browse the repository at this point in the history
Also, fix HDF5 jni for win32, update macOS requirement to 10.13+ (for GH runner's ARM64 macOS runner), update zlib to 1.3.1 and zstd to 1.5.6, update upload-artifact to v4

TODO, check win32 and macOS builds, and test all
  • Loading branch information
PeterC-DLS committed May 24, 2024
1 parent 2798d75 commit ae04d06
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-java-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
with:
limit-access-to-actor: true

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: hdf5-build-linux
path: dist
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-java-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: macos-12 # For >= Big Sur, to compile for Apple Silicon
runs-on: macos-14 # For >= Sonoma (on M1), can target 10.13 (High Sierra)

steps:
- uses: actions/checkout@v4
Expand All @@ -46,12 +46,12 @@ jobs:
with:
limit-access-to-actor: true

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: hdf5-build-macos
path: dist

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: hdf5-java-source
path: dist-src
2 changes: 1 addition & 1 deletion .github/workflows/build-java-win32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
with:
limit-access-to-actor: true

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: hdf5-build-win32
path: dist
Expand Down
13 changes: 7 additions & 6 deletions releng/build_codecs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

# codecs' version and checksum
ZLIB_URL="https://www.zlib.net"
ZLIB_VER=1.3
ZLIB_CHK=ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e
ZLIB_VER=1.3.1
ZLIB_CHK=9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23

LZ4_URL="https://github.com/lz4/lz4/archive/refs/tags"
LZ4_URL="https://github.com/lz4/lz4/releases/download"
LZ4_VER=1.9.4
LZ4_CHK=0b0e3aa07c8c063ddf40b082bdf7e37a1562bda40a0ff5272957f3e987e0e54b

Expand All @@ -22,8 +22,8 @@ LZF_SRC=liblzf-3.6
LZF_CHK=9c5de01f7b9ccae40c3f619d26a7abec9986c06c36d260c179cedd04b89fb46a

ZSTD_URL="https://github.com/facebook/zstd/releases/download"
ZSTD_VER=1.5.5
ZSTD_CHK=9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4
ZSTD_VER=1.5.6
ZSTD_CHK=8c29e06cf42aacc1eafc4077ae2ec6c6fcb96a626157e0593d5e82a34fd403c1

CB_URL="https://github.com/Blosc/c-blosc/archive/refs/tags"
CB_VER=1.21.5
Expand Down Expand Up @@ -112,7 +112,8 @@ else
LOCAL_CFLAGS="$GLOBAL_CFLAGS -march=armv8-a" # at least ARM Cortex-A53 (e.g. RPi 3 Model B or Zero W 2)
fi

download_check_extract_pushd lz4-$LZ4_VER v${LZ4_VER}.tar.gz $LZ4_CHK "$LZ4_URL"
LZ4_SRC=lz4-$LZ4_VER
download_check_extract_pushd $LZ4_SRC ${LZ4_SRC}.tar.gz $LZ4_CHK "$LZ4_URL/v$LZ4_VER"
make clean
if [ -n "$TESTCOMP" ]; then
make CFLAGS="$LOCAL_CFLAGS" PREFIX=$MY test
Expand Down
7 changes: 4 additions & 3 deletions releng/build_hdf5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ else
fi

if [ $PLAT_OS == "win32" ]; then
CMAKE_WIN32_OPTS=-DHDF5_MSVC_NAMING_CONVENTION=ON
CMAKE_WIN32_OPTS="-DHDF5_MSVC_NAMING_CONVENTION=ON -DH5_HAVE_VASPRINTF=0 -DH5_HAVE_ASPRINTF=0"
# TODO, to fix missing vasprintf, add -DH5_HAVE_VASPRINTF:INTERNAL=0 or use -D_GNU_SOURCE
fi

$CMAKE "$CMAKE_OPTS" $CMAKE_UTESTS -DBUILD_STATIC_LIBS=OFF -DALLOW_UNSUPPORTED=ON -DHDF5_BUILD_JAVA=ON -DHDF5_BUILD_TOOLS=ON -DHDF5_ENABLE_THREADSAFE=ON \
-DHDF5_ENABLE_Z_LIB_SUPPORT=ON -DHDF5_BUILD_EXAMPLES=OFF -DHDF5_BUILD_HL_LIB=OFF -DHDF5_BUILD_HL_GIF_TOOLS=OFF $CMAKE_WIN32_OPTS \
-DHDF5_ENABLE_Z_LIB_SUPPORT=ON -DHDF5_BUILD_EXAMPLES=OFF -DHDF5_BUILD_HL_LIB=OFF -DHDF5_BUILD_HL_GIF_TOOLS=OFF -DHDF5_ENABLE_SZIP_SUPPORT=OFF $CMAKE_WIN32_OPTS \
-DZLIB_USE_EXTERNAL=OFF -DZLIB_ROOT=$MY -DZLIB_INCLUDE_DIR=$MY/include -DZLIB_LIBRARY=$MY/lib/libz.a \
-DCMAKE_C_FLAGS="$GLOBAL_CFLAGS -I$MY/include -I$JAVA_HOME/include -I$JAVA_HOME/include/$JAVA_OS" -DCMAKE_EXE_LINKER_FLAGS="-L$MY/lib" -DCMAKE_INSTALL_PREFIX=$H5 \
-DCMAKE_C_FLAGS="$GLOBAL_CFLAGS -D_MSVC_TRADITIONAL=0 -I$MY/include -I$JAVA_HOME/include -I$JAVA_HOME/include/$JAVA_OS" -DCMAKE_EXE_LINKER_FLAGS="-L$MY/lib" -DCMAKE_INSTALL_PREFIX=$H5 \
-S .. -B .

if [ -n "$TESTHDF5" ]; then
Expand Down
2 changes: 1 addition & 1 deletion releng/build_macos_bindings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fi
brew install coreutils # for readlink and realpath
brew install openjdk@11

export MACOSX_DEPLOYMENT_TARGET=10.9 # minimum macOS version Mavericks for XCode 12.1+
export MACOSX_DEPLOYMENT_TARGET=10.13 # minimum macOS version Mavericks for XCode 14+

if [ -z "$HOMEBREW_PREFIX" ]; then
HOMEBREW_PREFIX=$(realpath $(dirname $(which brew))/..)
Expand Down
12 changes: 12 additions & 0 deletions releng/jni.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -ur hdf5-1.14.4-3/java/src/jni/h5Imp.c hdf5-1.14.4-3-new/java/src/jni/h5Imp.c
--- hdf5-1.14.4-3/java/src/jni/h5Imp.c 2024-05-22 19:43:17.000000000 +0100
+++ hdf5-1.14.4-3-new/java/src/jni/h5Imp.c 2024-05-24 14:59:59.752881342 +0100
@@ -105,7 +105,7 @@
Java_hdf_hdf5lib_H5_H5get_1libversion(JNIEnv *env, jclass clss, jintArray libversion)
{
jboolean libversionArrayIsCopy;
- int *libversionArray = NULL;
+ jint *libversionArray = NULL;
herr_t status = FAIL;

UNUSED(clss);
16 changes: 8 additions & 8 deletions releng/prepare_source.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
#

HDF5_SER=1.14
HDF5_VER=${HDF5_SER}.3
HDF5_CHK=9425f224ed75d1280bb46d6f26923dd938f9040e7eaebf57e66ec7357c08f917
HDF5_DIR=hdf5-${HDF5_VER}
HDF5_TAR=${HDF5_DIR}.tar.bz2
HDF5_VER=1.14.4
HDF5_PL=3
HDF5_CHK=019ac451d9e1cf89c0482ba2a06f07a46166caf23f60fea5ef3c37724a318e03
HDF5_DIR=hdf5-${HDF5_VER}-${HDF5_PL}
HDF5_TAR=${HDF5_DIR}.tar.gz

if [ ! -f ${HDF5_TAR} ]; then

curl -fsSLO "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${HDF5_SER}/hdf5-${HDF5_VER}/src/${HDF5_TAR}"
curl -fsSLO "https://github.com/HDFGroup/hdf5/releases/download/hdf5_${HDF5_VER}.${HDF5_PL}/${HDF5_TAR}"
echo "${HDF5_CHK} ${HDF5_TAR}" | sha256sum -c -

fi

if [ ! -d "${HDF5_DIR}" ]; then
tar xjf "${HDF5_TAR}"
tar xzf "${HDF5_TAR}"
pushd "${HDF5_DIR}"

ln -s ../releng .
patch -p1 < releng/javacmake.patch
patch -p1 < releng/hdf5-H5.patch
patch -p1 < releng/jni.patch
popd
fi

Expand Down
59 changes: 30 additions & 29 deletions releng/zstd-msys.patch
Original file line number Diff line number Diff line change
@@ -1,76 +1,77 @@
# From https://github.com/facebook/zstd/pull/1916
#
diff -ur zstd-1.5.2/lib/Makefile zstd-1.5.2-new/lib/Makefile
--- zstd-1.5.2/lib/Makefile 2022-01-20 21:17:18.000000000 +0000
+++ zstd-1.5.2-new/lib/Makefile 2022-06-24 11:43:07.526887440 +0100
@@ -249,7 +249,7 @@
diff -ur zstd-1.5.6/lib/Makefile zstd-1.5.6-new/lib/Makefile
--- zstd-1.5.6/lib/Makefile 2024-03-21 22:05:51.000000000 +0000
+++ zstd-1.5.6-new/lib/Makefile 2024-05-24 09:45:03.617182422 +0100
@@ -261,7 +261,7 @@
#-----------------------------------------------------------------------------
# make install is validated only for below listed environments
#-----------------------------------------------------------------------------
-ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX))
+ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX MSYS% MINGW%,$(UNAME)))
-ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX MSYS_NT CYGWIN_NT))
+ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX MSYS% MINGW% CYGWIN_NT,$(UNAME)))

lib: libzstd.pc

@@ -267,6 +267,8 @@
@@ -279,6 +279,7 @@
LIBDIR ?= $(libdir)
includedir ?= $(PREFIX)/include
INCLUDEDIR ?= $(includedir)
+bindir ?= $(PREFIX)/bin
+BINDIR ?= $(bindir)
+DLLDIR ?= $(PREFIX)/bin

PCINCDIR := $(patsubst $(PREFIX)%,%,$(INCLUDEDIR))
PCLIBDIR := $(patsubst $(EXEC_PREFIX)%,%,$(LIBDIR))
@@ -331,8 +333,13 @@
@@ -343,8 +344,13 @@
[ -e $(DESTDIR)$(LIBDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/
@echo Installing shared library
$(INSTALL_PROGRAM) $(LIBZSTD) $(DESTDIR)$(LIBDIR)
+ifneq (,$(filter MSYS% MINGW%,$(UNAME)))
+ @$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/
+ @$(INSTALL_PROGRAM) $(LIBZSTD) $(DESTDIR)$(BINDIR)
+ @$(INSTALL) -d -m 755 $(DESTDIR)$(DLLDIR)/
+ @$(INSTALL_PROGRAM) $(LIBZSTD) $(DESTDIR)$(DLLDIR)
+else
ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR)
ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT)
+endif

.PHONY: install-includes
install-includes:
@@ -345,9 +352,14 @@
@@ -357,8 +363,13 @@
.PHONY: uninstall
uninstall:
$(RM) $(DESTDIR)$(LIBDIR)/libzstd.a
- $(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT)
- $(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR)
+ifneq (,$(filter MSYS% MINGW%,$(UNAME)))
+ @$(RM) $(DESTDIR)$(BINDIR)/$(LIBZSTD)
+ @$(RM) $(DESTDIR)$(LIBDIR)/libzstd.dll.a
+else
$(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT)
$(RM) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR)
$(RM) $(DESTDIR)$(LIBDIR)/$(LIBZSTD)
+ $(RM) $(DESTDIR)$(DLLDIR)/libzstd.$(SHARED_EXT)
+ $(RM) $(DESTDIR)$(DLLDIR)/libzstd.$(SHARED_EXT_MAJOR)
+endif
$(RM) $(DESTDIR)$(LIBDIR)/$(LIBZSTD)
$(RM) $(DESTDIR)$(PKGCONFIGDIR)/libzstd.pc
$(RM) $(DESTDIR)$(INCLUDEDIR)/zstd.h
$(RM) $(DESTDIR)$(INCLUDEDIR)/zstd_errors.h
diff -ur zstd-1.5.2/Makefile zstd-1.5.2-new/Makefile
--- zstd-1.5.2/Makefile 2022-01-20 21:17:18.000000000 +0000
+++ zstd-1.5.2-new/Makefile 2022-06-24 11:33:22.382308061 +0100
@@ -149,7 +149,7 @@
diff -ur zstd-1.5.6/Makefile zstd-1.5.6-new/Makefile
--- zstd-1.5.6/Makefile 2024-03-21 22:05:51.000000000 +0000
+++ zstd-1.5.6-new/Makefile 2024-05-24 09:30:49.246432791 +0100
@@ -151,8 +151,7 @@
#------------------------------------------------------------------------------
# make install is validated only for Linux, macOS, Hurd and some BSD targets
#------------------------------------------------------------------------------
-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT Haiku AIX))
-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT CYGWIN_NT Haiku AIX))
-
+ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT Haiku AIX MSYS% MINGW%,$(shell uname)))

HOST_OS = POSIX

diff -ur zstd-1.5.2/programs/Makefile zstd-1.5.2-new/programs/Makefile
--- zstd-1.5.2/programs/Makefile 2022-01-20 21:17:18.000000000 +0000
+++ zstd-1.5.2-new/programs/Makefile 2022-06-24 11:42:11.564164547 +0100
@@ -335,7 +335,7 @@
MKDIR ?= mkdir -p
diff -ur zstd-1.5.6/programs/Makefile zstd-1.5.6-new/programs/Makefile
--- zstd-1.5.6/programs/Makefile 2024-03-21 22:05:51.000000000 +0000
+++ zstd-1.5.6-new/programs/Makefile 2024-05-24 09:31:31.602578536 +0100
@@ -345,7 +345,7 @@
#-----------------------------------------------------------------------------
# make install is validated only for Linux, macOS, BSD, Hurd and Solaris targets
#-----------------------------------------------------------------------------
-ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX))
+ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX MSYS% MINGW%,$(UNAME)))
-ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX MSYS_NT CYGWIN_NT))
+ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT Haiku AIX MSYS% MINGW%,$(shell uname)))

HAVE_COLORNEVER = $(shell echo a | egrep --color=never a > /dev/null 2> /dev/null && echo 1 || echo 0)
EGREP_OPTIONS ?=

0 comments on commit ae04d06

Please sign in to comment.