Hi Francesc,

it took me a while to figure out this detail, too, I had the blosc.dll in the PATH at first, and it seems to work under some circumstances but not others... not entirely clear to me when it needs to be in the PATH or in the calling's DLL's directory outside of the PATH.

There's some code in H5PL.c that checks for a lib prefix:

#ifndef __CYGWIN__
        if(!HDstrncmp(dp->d_name, "lib", (size_t)3) &&
(HDstrstr(dp->d_name, ".so") || HDstrstr(dp->d_name, ".dylib"))) {
#else
...

#endif

So I guess in your case that prefix check did not apply, whereas for me using gcc under windows it did. Thus it seems best for compatibility to keep the plugins named with lib- starting under Windows, once compiled that C code should not matter whether it was produced by GCC or MSC. Otherwise yes, the name does not matter indeed.

         Werner


On 28.06.2017 15:00, Francesc Alted wrote:
Hi Werner,

Right, what I was missing was basically moving the blosc.dll library into the HDF5 plugin directory. I thought that putting blosc.dll in a directory in the %PATH% was going to be enough, but apparently this is not the case (I suppose this is a Windows trickery).

For what is worth, the name of the DLL plugin is not that important as I have tried with libHDF5blosc.dll, libH5Zblosc.dll, H5Zblosc.dll and even blosc_plugin.dll and all of them work. Apparently the HDF5 library tries all the DLLs in the plugin directory and uses the one that registers the necessary filter ID; pretty smart.

Thanks so much!

2017-06-28 14:31 GMT+02:00 Werner Benger <[email protected] <mailto:[email protected]>>:

    Just to add:

     under windows, the plugins need to start with lib as prefix. It's
    technically not required, but the HDF5 plugin loader expects that.
    So the liblz4.dll in my plugins dir is the LZ4 plugin,the
    libHDF5blosc.dll the blosc-filter; the blosc.dll is used by the
    blosc filter and needs to be in the same directory if compiled as
    dynamic library as well.

            Werner


    On 28.06.2017 14:24, Werner Benger wrote:

    Hi,

     I am using HDF5 with blosc dynamic plugin loading regularly
    under Windows,  and this are the files as needed in the plugin
    directory that HDF5 looks for:

    HDF5Plugins $ ll
    total 1.2M
    -rwxr-xr-x 1 Wrk None 382K Jun 26 23:30 blosc.dll*
    -rwxr-xr-x 1 Wrk None 330K Jun 26 23:30 libHDF5blosc.dll*
    -rwxr-xr-x 1 Wrk None 410K Jun 26 23:30 liblz4.dll*

    The blosc.dll is the blosc library, libHDF5blosc.dll is the HDF5
    plugin using that library.

    I'm using Mingw64, which is gcc  6.3 under MSYS2 .

              Werner


    On 28.06.2017 13:44, Francesc Alted wrote:
    Hi,

    I have been trying to give support to HDF5 on Windows for
    dynamically loading the Blosc plugin
    (https://github.com/Blosc/hdf5-blosc
    <https://github.com/Blosc/hdf5-blosc>), but no success so far.

    I basically have compiled the plugin with:

    > cl /I"C:\Program Files (x86)\blosc\include"
    /I"C:\HDF_Group\HDF5\1.8.12\include" libH5Zblosc.c
    blosc_filter.c /OUT:libH5Zblosc.dll /LD /link
    /LIBPATH:"C:\Program Files (x86)\blosc\lib"
    /LIBPATH:"C:\HDF_Group\HDF5\1.8.12\lib" blosc.lib hdf5.lib

    ​and then copied the ​libH5Zblosc.dll
    to "%ALLUSERSPROFILE%/hdf5/lib/plugin", but when I try to use a
    h5dump for getting the data of an HDF5 with some datasets
    compressed with Blosc, I am getting:

    >h5dump \tmp\carray1-blosc.h5
    HDF5 "\tmp\carray1-blosc.h5" {
    GROUP "/" {
       DATASET "carray" {
          DATATYPE  H5T_STD_U8LE
          DATASPACE  SIMPLE { ( 200, 300 ) / ( 218, 300 ) }
          DATA {h5dump error: unable to print data

          }
       }
    }
    }

    ​When asking for more errors, I am getting a more informative
    message:

    ​>h5dump --enable-error-stack \tmp\carray1-blosc.h5
    HDF5 "\tmp\carray1-blosc.h5" {
    GROUP "/" {
     DATASET "carray" {
    DATATYPE  H5T_STD_U8LE
    DATASPACE  SIMPLE { ( 200, 300 ) / ( 218, 300 ) }
    DATA {HDF5-DIAG: Error detected in HDF5 (1.10.1) thread 0:
    #000:
    C:\autotest\hdf5110-StdRelease-code-10vs14\build\hdfsrc\src\H5Dio.c
    line 171 in H5Dread(): can't read data
    major: Dataset
    minor: Read failed
    #001:
    C:\autotest\hdf5110-StdRelease-code-10vs14\build\hdfsrc\src\H5Dio.c
    line 544 in H5D__read(): can't read data
    major: Dataset
    minor: Read failed
    #002:
    C:\autotest\hdf5110-StdRelease-code-10vs14\build\hdfsrc\src\H5Dchunk.c
    line 2050 in H5D__chunk_read(): unable to read raw data chunk
    major: Low-level I/O
    minor: Read failed
    #003:
    C:\autotest\hdf5110-StdRelease-code-10vs14\build\hdfsrc\src\H5Dchunk.c
    line 3405 in H5D__chunk_lock(): data pipeline read failed
    major: Data filters
    minor: Filter operation failed
    #004:
    C:\autotest\hdf5110-StdRelease-code-10vs14\build\hdfsrc\src\H5Z.c
    line 1349 in H5Z_pipeline(): required filter 'blosc' is not
    registered
    major: Data filters
    minor: Read failed
    #005:
    C:\autotest\hdf5110-StdRelease-code-10vs14\build\hdfsrc\src\H5PL.c
    line 389 in H5PL_load(): search in paths failed
    major: Plugin for dynamically loaded library
    minor: Can't get value
    #006:
    C:\autotest\hdf5110-StdRelease-code-10vs14\build\hdfsrc\src\H5PL.c
    line 812 in H5PL__find(): can't open directory
    major: Plugin for dynamically loaded library
    minor: Can't open directory or file
    h5dump error: unable to print data

    }
       }
    }
    }
    H5tools-DIAG: Error detected in HDF5:tools (1.10.1) thread 0:
    #000:
    
C:\autotest\hdf5110-StdRelease-code-10vs14\build\hdfsrc\tools\lib\h5tools_dump.c
    line 1639 in h5tools_dump_simple_dset(): H5Dread failed
    major: Failure in tools library
    minor: error in function

    ​I suppose the meaningful part is here:

    10vs14\build\hdfsrc\src\H5PL.c line 812 in H5PL__find(): can't
    open directory

    b
    ​ut I have no clues on 1) what directory the dynamic plugin
    machinery in HDF5 is looking at and 2) ​which name the DLL
    should have (as per manual, I am using libH5Zblosc.dll, but I
    have tried with H5Zblosc.dll and blosc.dll with no success).

    I have also tried to use the HDF5_PLUGIN_PATH environment
    variable, so as to direct the plugin machinery in HDF5 to look
    into the specific
    %ALLUSERSPROFILE%/hdf5/lib/plugin
    ​ place, ​
    but no luck.

​I tried with HDF5 1.8.12 and 1.10.1, with same results​. Finally, if it is of any help, I am using Windows 10 64 bit.

    ​As a suggestion, it may help to debug situations like this if
    the HDF5 backtrace of the plugin machinery would provide info
    about 1) which directory it is looking at for finding the HDF5
    plugin and 2) the name of the DLL that it is trying to load.

    Thanks in advance,​

-- Francesc Alted


    _______________________________________________
    Hdf-forum is for HDF software users discussion.
    [email protected] <mailto:[email protected]>
    http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
    <http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org>
    Twitter:https://twitter.com/hdf5

-- ___________________________________________________________________________
    Dr. Werner Benger                Visualization Research
    Center for Computation & Technology at Louisiana State University (CCT/LSU)
    2019  Digital Media Center, Baton Rouge, Louisiana 70803
Tel.:+1 225 578 4809 <tel:%28225%29%20578-4809> Fax.:+1 225 578-5362 <tel:%28225%29%20578-5362>

    _______________________________________________
    Hdf-forum is for HDF software users discussion.
    [email protected] <mailto:[email protected]>
    http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
    <http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org>
    Twitter:https://twitter.com/hdf5

-- ___________________________________________________________________________
    Dr. Werner Benger                Visualization Research
    Center for Computation & Technology at Louisiana State University (CCT/LSU)
    2019  Digital Media Center, Baton Rouge, Louisiana 70803
Tel.:+1 225 578 4809 <tel:%28225%29%20578-4809> Fax.:+1 225 578-5362 <tel:%28225%29%20578-5362>

    _______________________________________________
    Hdf-forum is for HDF software users discussion.
    [email protected] <mailto:[email protected]>
    http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
    <http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org>
    Twitter: https://twitter.com/hdf5




--
Francesc Alted


_______________________________________________
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

--
___________________________________________________________________________
Dr. Werner Benger                Visualization Research
Center for Computation & Technology at Louisiana State University (CCT/LSU)
2019  Digital Media Center, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809                        Fax.: +1 225 578-5362

_______________________________________________
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

Reply via email to