Skip to content

Depend on hdf5-platform instead of only the macosx-arm64 natives - #11

Merged
mkitti merged 1 commit into
github-actions-cifrom
hdf5-platform
Oct 13, 2026
Merged

mkitti merged 1 commit into
github-actions-cifrom
hdf5-platform

Conversation

@mkitti

@mkitti mkitti commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #10. Fixes the native libraries janelia-jhdf5 gives its consumers.

Problem

janelia-jhdf5 had two compile dependencies on HDF5:

  • org.bytedeco:hdf5: the Java classes, without native code.
  • org.bytedeco:hdf5:macosx-arm64: the native libraries for Apple Silicon only.

Everything that depends on janelia-jhdf5 (Fiji plugins, BigDataViewer, applications) got exactly those two jars. On Apple Silicon that works. On Linux, Windows and Intel Macs the classpath had HDF5's Java classes but no native code for the running platform, so the first HDF5 call failed with an UnsatisfiedLinkError unless the consumer added the right natives jar themselves. Every platform also bundled an unused 4.2 MB macOS jar.

Change

Depend on org.bytedeco:hdf5-platform instead. It's bytedeco's standard aggregate of the HDF5 classes plus the natives for every published platform: android arm64/x86_64, linux arm64/ppc64le/x86_64, macOS arm64/x86_64 and windows x86_64. JavaCPP loads the ones matching the platform it runs on.

The test-only natives profiles added in #10 are removed; hdf5-platform covers them.

Trade-off

The natives jars are 1.8–9.5 MB each, roughly 40 MB together, plus JavaCPP's own natives. Consumers who target one platform can build with -Djavacpp.platform=linux-x86_64 (or another platform), which bytedeco's platform poms honour to pull in only that platform's natives.

Testing

🤖 Generated with Claude Code

janelia-jhdf5 had compile dependencies on org.bytedeco:hdf5 and on its
macosx-arm64 natives only. Every consumer therefore got native HDF5 for
Apple Silicon and nothing else: on Linux, Windows and Intel Macs the
first HDF5 call fails with an UnsatisfiedLinkError unless the consumer
adds the right natives jar themselves.

Depend on org.bytedeco:hdf5-platform instead, which brings the classes
plus the natives for every published platform; JavaCPP loads the ones for
the platform it runs on, and -Djavacpp.platform=<platform> restricts the
build to one. This also makes the test-only natives profiles redundant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mkitti added a commit that referenced this pull request Oct 13, 2026
Merges, via the top of the stack, PRs #1 through #19: HDF5 2.2.0 via org.bytedeco:hdf5 (#1, #2), vendored cisd:base (#3-#7), the upstream TestNG suite and fixes (#8, #9, #12, #15), CI (#10, #16), hdf5-platform (#11), native-library loading (#13, #14), imported cisd:base tests (#17), README (#18) and benchmarks (#19). Each PR's commits are preserved.
@mkitti
mkitti merged commit e4de0ff into github-actions-ci Oct 13, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant