Well, I am C++ naïve but this is also the conclusion I came to when I tried using custom filters with jhdf5 on Windows a while back.
I could compile the filter linked with the hd5f.lib import library to produce a filter plugin dll. This worked just fine as expected from a C++ test program that found the plugin on the HDF5_PLUGIN_PATH. When I tried to use the same plugin from a Java program using jhdf5.dll, the filter loaded but H5 API calls made by the plugin failed. I (naively) guessed this was because I had ended up with both statically and dynamically linked versions of hdf5. So I then tried to link the filter plugin using the jhdf5.lib import library instead, but that wouldn't link. Dan -----Original Message----- From: Hdf-forum [mailto:[email protected]] On Behalf Of Miller, Mark C. Sent: 18 May 2016 17:53 To: HDF Users Discussion List Subject: Re: [Hdf-forum] Shared library problems with plugin filters I may have a silly question because I am Java-naive but isn't the problem that the libhdf5 gets statically linked into the JNI? Is there any way to make libhdf5 dynamically linked into the JNI? If so, then I think a later dlopen of a libhdf5-dependent shared library (e.g. a compressor) would find and use the libhdf5 already loaded when the JNI was loaded. On 5/18/16, 9:26 AM, "Hdf-forum on behalf of Derick Swanepoel" <[email protected] on behalf of [email protected]> wrote: >Good day, > >We¹ve been developing a compression filter and have discovered that >tools such as h5dump and libraries such as h5py fail to load the >filter, while our own C++ tools that read/write datasets using the filter work >fine. >However, explicitly linking the filter with libpthread allows h5dump to >load it, and additionally linking it with libhdf5 allows h5py to load it. > >Our C++ tools are already linked with these libraries which would >explain why they have no trouble loading it. > >I see that someone came across a similar issue before and it was >recommended that filters that use HDF5 calls should link with the >library >(https://lists.hdfgroup.org/pipermail/hdf-forum_lists.hdfgroup.org/2015 >-De cember/009100.html). I¹m not sure I understand why this is >necessary, since any code that is capable of opening an HDF5 file would >already link with libhdf5. > >If this is normal, perhaps it¹s worth noting in the filter >documentation, especially since implementing a set_local callback would >almost certainly involve calling some HDF5 functions (we use it to >determine type size, >etc.) > >Regards, >Derick >_______________________________________________ >Hdf-forum is for HDF software users discussion. >[email protected] >http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org >Twitter: https://twitter.com/hdf5 _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5 _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5
