Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include hdf.hdf5lib.* java packages #1327

Merged
merged 5 commits into from
Mar 8, 2023

Conversation

mkitti
Copy link
Contributor

@mkitti mkitti commented Feb 23, 2023

This includes the hdf5_java.{dll, so, dylib} as well as the following Java packages:

  • hdf.hdf5lib
  • hdf.hdf5lib.callbacks
  • hdf.hdf5lib.exceptions
  • hdf.hdf5lib.structs

@mkitti
Copy link
Contributor Author

mkitti commented Feb 23, 2023

We currently end up compiling the hdf.hdf5lib.* java classes twice. Once when building HDF5 and then again when assembling the classes. Could we avoid this? I'm tempted just to expand the jarhdf5 that is produced.

$ jar tvf hdf5/cppbuild/linux-x86_64/lib/jarhdf5-1.14.0.jar 
     0 Thu Feb 23 16:56:30 EST 2023 META-INF/
    77 Thu Feb 23 16:56:30 EST 2023 META-INF/MANIFEST.MF
     0 Thu Feb 23 11:45:16 EST 2023 hdf/hdf5lib/
  3510 Thu Feb 23 11:45:16 EST 2023 hdf/hdf5lib/HDFNativeData.class
  4180 Thu Feb 23 11:45:16 EST 2023 hdf/hdf5lib/ArrayDescriptor.class
 12551 Thu Feb 23 11:45:16 EST 2023 hdf/hdf5lib/HDFArray.class
 46612 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/HDF5Constants.class
     0 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/structs/
  1749 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/structs/H5FD_ros3_fapl_t.class
   804 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/structs/H5L_info_t.class
   714 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/structs/H5O_token_t.class
  1779 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/structs/H5AC_cache_config_t.class
   720 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/structs/H5O_info_t.class
   592 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/structs/H5_ih_info_t.class
   794 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/structs/H5F_info2_t.class
   921 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/structs/H5O_native_info_t.class
  1105 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/structs/H5O_hdr_info_t.class
   664 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/structs/H5E_error2_t.class
   481 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/structs/H5A_info_t.class
   393 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/structs/H5G_info_t.class
  1879 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.class
 57116 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/H5.class
     0 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/
   252 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.class
   121 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/Callbacks.class
   127 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5D_append_t.class
   227 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.class
   129 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_iterate_t.class
   123 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5E_walk_t.class
   143 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_cls_close_func_t.class
   129 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5D_iterate_t.class
   232 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.class
   257 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.class
   129 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5A_iterate_t.class
   288 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5O_iterate_t.class
   230 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.class
   258 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5E_walk_cb.class
   288 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5L_iterate_t.class
   228 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.class
   227 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.class
   143 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.class
   232 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5D_append_cb.class
   141 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.class
   251 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_iterate_cb.class
   254 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.class
   143 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.class
   218 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.class
   238 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5D_iterate_cb.class
   233 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.class
   283 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5A_iterate_cb.class
   145 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/callbacks/H5P_cls_create_func_t.class
     0 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/
   350 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5DataFiltersException.class
   370 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5PropertyListInterfaceException.class
   354 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5InternalErrorException.class
   346 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5ReferenceException.class
   362 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5DatatypeInterfaceException.class
   364 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5DataspaceInterfaceException.class
   338 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5BtreeException.class
   362 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5FunctionEntryExitException.class
  7490 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5LibraryException.class
   346 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5AttributeException.class
   332 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5IdException.class
   348 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5LowLevelIOException.class
   350 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5SymbolTableException.class
   329 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5JavaException.class
   366 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5ResourceUnavailableException.class
   360 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5DatasetInterfaceException.class
   354 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5FileInterfaceException.class
   360 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5FunctionArgumentException.class
   352 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5ObjectHeaderException.class
   350 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5DataStorageException.class
   447 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5Exception.class
   336 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5HeapException.class
   354 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5MetaDataCacheException.class
   360 Thu Feb 23 11:45:14 EST 2023 hdf/hdf5lib/exceptions/HDF5ExternalFileListException.class

@mkitti
Copy link
Contributor Author

mkitti commented Feb 23, 2023

We may want to have h5.hdf5lib.loadH5Lib load org.bytedeco.hdf5.hdf5_java.

@saudet
Copy link
Member

saudet commented Feb 24, 2023

We currently end up compiling the hdf.hdf5lib.* java classes twice. Once when building HDF5 and then again when assembling the classes. Could we avoid this? I'm tempted just to expand the jarhdf5 that is produced.

I think it's fine having our project (re)compile the source. It makes sure we have all the dependencies in there. And we can make those dependencies "optional" so they are not forced upon the user.

We may want to have h5.hdf5lib.loadH5Lib load org.bytedeco.hdf5.hdf5_java.

Sure, I guess that should be fine.

@mkitti
Copy link
Contributor Author

mkitti commented Feb 24, 2023

Great. Is there anything else that needs to be done?

I am mainly pausing to test this out, but that could also be done from the snapshots.

I'm also evaluating if there are any elements from the SIS JHDF5 bindings that may be useful:

https://sissource.ethz.ch/sispub/jhdf5/-/tree/master/source/c

@saudet
Copy link
Member

saudet commented Feb 24, 2023

It looks fine, we can merge this, yes, but let's do it after it's been tested a bit locally, yes.

@mkitti
Copy link
Contributor Author

mkitti commented Feb 24, 2023

Why do half of the platforms use cmake and the other half use autotools?

HDF Group seems to moving towards retiring autotools:
https://forum.hdfgroup.org/t/can-we-retire-the-autotools/10362

@saudet
Copy link
Member

saudet commented Feb 24, 2023 via email

hdf5/cppbuild.sh Outdated
# Copyright 2007 - 2018 ETH Zuerich, CISD and SIS
# Apache License, Version 2.0
# https://sissource.ethz.ch/sispub/jhdf5
cp ../../../src/main/c/jhdf5/*.c java/src/jni/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't add them to this repository. Download them just like HDF5.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The files from JHDF5 need significant modification since they were last used with HDF 1.10.

I could start a branch on my fork and pull from there. Would that be better?

https://github.com/JaneliaSciComp/jhdf5

In the meantime, could we run the CI so I can see if there are any cross platform issues?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just rewrite it in Java then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that might be the easiest route. I'll revert recent changes

@mkitti mkitti marked this pull request as ready for review March 2, 2023 23:39
@mkitti
Copy link
Contributor Author

mkitti commented Mar 2, 2023

I'm willing to move ahead with this. I'll try the full Java approach to addressing the JHDF5 legacy.

@mkitti
Copy link
Contributor Author

mkitti commented Mar 6, 2023

To be clear, the future Java work lies outside of the scope of this PR. I'm done here unless there is something else to fix.

Let me know if you there are any other issues to address.

@mkitti
Copy link
Contributor Author

mkitti commented Mar 7, 2023

It may be useful to enable SZIP compression via libaec https://gitlab.dkrz.de/k202009/libaec .

The conda-forge build of HDF5 recently added support for SZIP compression via libaec in December 2022:
conda-forge/hdf5-feedstock#179

I plan to work on this in a separate branch based on this branch combined with changing all the builds to use cmake.

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Samuel Audet
* Copyright (C) 2023 Mark Kittisopikul
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. Thank you.

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.

None yet

2 participants