Delphi interface for hdf5.dll 1.10.0

Hello Ladies and Gentlemen!

A new version of auto-generated HDF5 bindings for Delphi is available.
It is attached along with generator script.

Changes:
1) Updated for HDF5 1.10.0.
2) Dropped support for ancient Delphi versions.

hdf5dll.pas (278 KB)

hdf5pas.py (24.7 KB)

···

---

I have noticed the following problems when adjusting my code for HDF5 1.8.14 -> 1.10.0:

3) Symbol H5F_LIBVER_18 definition is missing in 1.10.0. I used to pass the value to H5Pset_libver_bounds to ensure files are readable by HDF5 1.8+. How do I proceed with HDF 1.10 to achieve the same effect (i.e. readability by HDF5 1.8+)?

4) The symbols H5F_ACC_* are now #defined using H5OPEN treat, meaning that H5open call is needed before access to constant values. However, the values are defined as plain constants -- why use H5OPEN?

It would be awesome is HDF5 devs could shed some light on above.

Best wishes,
Andrey Paramonov

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Hi Andrey,

···

On Apr 4, 2016, at 5:41 AM, Андрей Парамонов <paramon@acdlabs.ru<mailto:paramon@acdlabs.ru>> wrote:

Hello Ladies and Gentlemen!

A new version of auto-generated HDF5 bindings for Delphi is available.
It is attached along with generator script.

Changes:
1) Updated for HDF5 1.10.0.
2) Dropped support for ancient Delphi versions.

---

I have noticed the following problems when adjusting my code for HDF5
1.8.14 -> 1.10.0:

3) Symbol H5F_LIBVER_18 definition is missing in 1.10.0. I used to pass
the value to H5Pset_libver_bounds to ensure files are readable by HDF5
1.8+. How do I proceed with HDF 1.10 to achieve the same effect (i.e.
readability by HDF5 1.8+)?

Unfortunately, HDF5 1.10.0 doesn’t have a flag to get 1.8 behavior. We ran out of time and the feature didn’t make into the release.
Focus of HDF5 1.10.0 was on the new SWMR and VDS features that are not compatible with 1.8. In 1.10.1 we will finish integration of the promised
HPC improvements and will add control for library versioning.

In 1.10.0, if one specifies the H5F_LIBVER_LATEST flag to the H5Pset_libver_bounds function, the file will be created according to
the latest version of the HDF5 file format and may not be readable by HDF5 1.8.*. We will create a document that describes
which objects are compatible with 1.8 when the H5F_LIBVER_LATEST flag is used.

4) The symbols H5F_ACC_* are now #defined using H5OPEN treat, meaning
that H5open call is needed before access to constant values. However,
the values are defined as plain constants -- why use H5OPEN?

Thank you for bringing this to our attention. We discussed it today and agreed that using H5CHECK and H5OPEN with the constants is overkill and not needed.
We will be looking into the issue.

Thank you!

Elena

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elena Pourmal The HDF Group http://hdfgroup.org
1800 So. Oak St., Suite 203, Champaign IL 61820
217.531.6112
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It would be awesome is HDF5 devs could shed some light on above.

Best wishes,
Andrey Paramonov

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

<hdf5dll.pas><hdf5pas.py>_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

05.04.2016 4:27, Elena Pourmal пишет:

3) Symbol H5F_LIBVER_18 definition is missing in 1.10.0. I used to pass
the value to H5Pset_libver_bounds to ensure files are readable by HDF5
1.8+. How do I proceed with HDF 1.10 to achieve the same effect (i.e.
readability by HDF5 1.8+)?

Unfortunately, HDF5 1.10.0 doesn’t have a flag to get 1.8 behavior. We
ran out of time and the feature didn’t make into the release.
Focus of HDF5 1.10.0 was on the new SWMR and VDS features that are not
compatible with 1.8. In 1.10.1 we will finish integration of the promised
HPC improvements and will add control for library versioning.

In 1.10.0, if one specifies the |H5F_LIBVER_LATEST flag to the
H5Pset_libver_bounds function, the file will be created according to |
>the latest version of the HDF5 file format and may not be readable by
HDF5 1.8.*. We will create a document that describes |
>which objects are compatible with 1.8 when the |H5F_LIBVER_LATEST flag
is used.
>

Hello Elena!

It would suffice to introduce H5F_LIBVER_18_110 equals to the previous value of H5F_LIBVER_18. It is understandable that using new 1.10 features (e.g. SWMR) may introduce backward incompatibility for 1.8 readers.

I'm a bit cautious to use H5F_LIBVER_LATEST everywhere because my understanding is its value may change in the future. The header file says

     H5F_LIBVER_LATEST /* Use the latest possible format available for storing objects*/

but usually I'd like to ensure 1.8 compatibility even if new format is introduced in 1.12 and H5F_LIBVER_LATEST value is increased.

I can wait for the next update of 1.10 :slight_smile:

4) The symbols H5F_ACC_* are now #defined using H5OPEN treat, meaning
that H5open call is needed before access to constant values. However,
the values are defined as plain constants -- why use H5OPEN?

Thank you for bringing this to our attention. We discussed it today and
agreed that using H5CHECK and H5OPEN with the constants is overkill and
not needed.
We will be looking into the issue.

Thank you for your support,
Andrey Paramonov

···

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Andre - I’m going to try using your interface module in Delphi 10.3. Before I start do you have any late changes that I can pick up?
Regards… Jim

I am translating the example code in the Learning Basics section of the documentation to Delphi (Object Pascal). I have the first eight done and working but I’m having a problem with #9 ‘Create an extendible (unlimited dimension) dataset’. I’m using the Delphi wrapper marked ‘Auto-generated 2019-03-01 by Andrey Paramonv’
My test code is here:

 procedure TForm26.FormCreate(Sender: TObject);
   begin
     HDF5DLL := THDF5DLL.Create('hdf5.dll');
  end;

 procedure TForm26.btnTestClick(Sender: TObject);
   const
    RANK = 2;
    dims: array [0 .. 1] of integer = (3, 3);
    chunk_dims: array [0 .. 1] of hsize_t = (2, 5);
    maxdims: array [0 .. 1] of hsize_t = (H5S_UNLIMITED - 1, H5S_UNLIMITED - 1);
    // maxdims: array [0 .. 1] of hsize_t = (H5S_UNLIMITED, H5S_UNLIMITED);
 var
    dataspace, dataset: hid_t;
    prop: hid_t;
   status: herr_t;
 begin
    // Create the data space with unlimited dimensions.
    dataspace := HDF5DLL.H5Screate_simple(RANK, @dims, @maxdims);
    // Create a new file.If file exists its contents will be overwritten.
    fileH := HDF5DLL.H5Fcreate('extend.h5', H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
    // Modify dataset creation properties, i.e.enable chunking
    prop := HDF5DLL.H5Pcreate(HDF5DLL.H5P_DATASET_CREATE);
    status := HDF5DLL.H5Pset_chunk(prop, RANK, @chunk_dims);
  end;

To get the dataspace return to work I had to define the values in maxdims as H5S_UNLIMITED-1.
I also cannot get the h5Pset_chunk to return a status of anything but -1

Any idea?

I am looking for the latest version of hdf5dll.pas by Andre Paramonov
Not sure if this thread is still active or the way to go …

I am a Delphi dinosaur wishing to read and write HDF5 files using the open source C++ DLL’s.

I downloaded Andre’s hdf5dll-1.8.17.pas auto generated on 2016-05-31
and see a post for a version 2019-03-01
It looks extremely powerful and useful - many thanks to Andre.

  1. Where can I get the latest version ?
  2. Any links to Delphi examples would be really appreciated.

To my knowledge, Andrei was the only developer who worked on Delphi interface to HDF5.

Andrei was a great advocate for HDF5 and an amazing person.

Elena

1 Like