Open mkitti opened 1 year ago
It is not clear to me what the diff is between The HDF Group's low level JNI bindings and those from ETH SIS: https://sissource.ethz.ch/sispub/jhdf5/-/tree/master/source/c/jni
If there are useful elements here, I would be interested to see if we can upstream these changes or move them to a distinct layer on top of the JNI wrappers.
I am partially addressing this by incorporating The HDF Group bindings into the JavaCPP distribution of HDF5: https://github.com/bytedeco/javacpp-presets/pull/1327
This will provide a maven accessible copy of the THG Java bindings as well as auto-generated Java bindings under org.bytedeco.hdf5
.
Here is a current preview of the combined JavaDoc: https://mkitti.github.io/janelia/javacpp-hdf5/1.14.0-1.5.9-SNAPSHOT/javadoc/
Our internal buildbot and the github CI has the three major platforms that can build java libs for hdf5/hdf4. It would be nice to create a single hdf5 and hdf4 java jar that has the native libs inside. I wonder if that would be beneficial?
I discovered that the JavaCPP project was already doing this. https://oss.sonatype.org/#nexus-search;gav~org.bytedeco~hdf5~~~~kw,versionexpand
For example you can download their hdf5 distribution for x86_64 Linux: https://oss.sonatype.org/service/local/repositories/snapshots/content/org/bytedeco/hdf5/1.14.0-1.5.9-SNAPSHOT/hdf5-1.14.0-1.5.9-20230308.032243-12-linux-x86_64.jar
The platform independent Java code exists here: https://oss.sonatype.org/service/local/repositories/snapshots/content/org/bytedeco/hdf5/1.14.0-1.5.9-SNAPSHOT/hdf5-1.14.0-1.5.9-20230308.032243-12.jar
I recently added the HDF5 library code to this jar.
Additionally there are "platform" jars: https://oss.sonatype.org/service/local/repositories/snapshots/content/org/bytedeco/hdf5-platform/1.14.0-1.5.9-SNAPSHOT/hdf5-platform-1.14.0-1.5.9-20230308.032034-9.jar
$ jar tvf hdf5-platform-1.14.0-1.5.9-20230308.032034-9.jar
576 Tue Mar 07 22:20:34 EST 2023 META-INF/MANIFEST.MF
0 Tue Mar 07 22:20:34 EST 2023 META-INF/
0 Tue Mar 07 22:20:34 EST 2023 META-INF/maven/
0 Tue Mar 07 22:20:34 EST 2023 META-INF/maven/org.bytedeco/
0 Tue Mar 07 22:20:34 EST 2023 META-INF/maven/org.bytedeco/hdf5-platform/
6040 Tue Mar 07 22:12:44 EST 2023 META-INF/maven/org.bytedeco/hdf5-platform/pom.xml
79 Tue Mar 07 22:20:34 EST 2023 META-INF/maven/org.bytedeco/hdf5-platform/pom.properties
0 Tue Mar 07 22:20:34 EST 2023 META-INF/versions/
0 Tue Mar 07 22:20:34 EST 2023 META-INF/versions/9/
334 Tue Mar 07 22:20:34 EST 2023 META-INF/versions/9/module-info.class
These contain pom.xml files which have dependencies in the following structure. The classifier property allows one to select a particular platform so one does not need to download files for all the platforms.
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${javacpp.moduleId}</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${javacpp.moduleId}</artifactId>
<version>${project.version}</version>
<classifier>${javacpp.platform.linux-x86}</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${javacpp.moduleId}</artifactId>
<version>${project.version}</version>
<classifier>${javacpp.platform.linux-x86_64}</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${javacpp.moduleId}</artifactId>
<version>${project.version}</version>
<classifier>${javacpp.platform.macosx-x86_64}</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${javacpp.moduleId}</artifactId>
<version>${project.version}</version>
<classifier>${javacpp.platform.windows-x86}</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${javacpp.moduleId}</artifactId>
<version>${project.version}</version>
<classifier>${javacpp.platform.windows-x86_64}</classifier>
</dependency>
Is your feature request related to a problem? Please describe. This is a tracking issue for enhancements to the Java bindings from the Janelia Research Campus of the Howard Hughes Medical Institute
Describe the solution you'd like Improve Java Native Interface Bindings:
Improve packaging for Java:
Describe alternatives you've considered Java Native Access allows for dynamically generated bindings: https://github.com/java-native-access/jna
JavaCPP creates automatically generated bindings https://github.com/bytedeco/javacpp-presets/tree/master/hdf5
Additional context
asByteBuffer
method.