tH5P_F03.f90 use of "SIZEOF(fill_ctype)"

When building HDF5/1.8.13 with fortran2003 and the Cray compiler I got a build failure on tH5P_F03.f90 because of inconsistant implications/usage of SIZEOF. To get it to build I changed:

--- tH5P_F03.f90 2014-05-08 14:19:38.000000000 -0500
+++ tH5P_F03.f90.new 2014-04-29 14:16:46.000000000 -0500
@@ -137,7 +137,7 @@

   ! /* Create a compound datatype */

- CALL h5tcreate_f(H5T_COMPOUND_F, INT(SIZEOF(fill_ctype),size_t), comp_type_id, error)
+ CALL h5tcreate_f(H5T_COMPOUND_F, INT((storage_size(fill_ctype)/8),size_t), comp_type_id, error)
   CALL check("h5tcreate_f", error, total_error)
   h5off = H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%a))
   CALL h5tinsert_f(comp_type_id, "a", h5off , H5T_NATIVE_REAL, error)

For better compatibility I recommend using Fortran intrinsics like "storage_size" and then scaling for bytes/arrays or using C_SIZEOF from the ISO_C_BINDING module.

Sean

Hi Sean,

This is on our to-do list (the fix is slated for the next release) as we have not yet incorporated any of the intrinsics from the Fortran 2008 standard.

Scot

···

On May 8, 2014, at 3:10 PM, Sean Byland <seanb@cray.com<mailto:seanb@cray.com>> wrote:

When building HDF5/1.8.13 with fortran2003 and the Cray compiler I got a build failure on tH5P_F03.f90 because of inconsistant implications/usage of SIZEOF. To get it to build I changed:

--- tH5P_F03.f90 2014-05-08 14:19:38.000000000 -0500
+++ tH5P_F03.f90.new 2014-04-29 14:16:46.000000000 -0500
@@ -137,7 +137,7 @@

   ! /* Create a compound datatype */

- CALL h5tcreate_f(H5T_COMPOUND_F, INT(SIZEOF(fill_ctype),size_t), comp_type_id, error)
+ CALL h5tcreate_f(H5T_COMPOUND_F, INT((storage_size(fill_ctype)/8),size_t), comp_type_id, error)
   CALL check("h5tcreate_f", error, total_error)
   h5off = H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%a))
   CALL h5tinsert_f(comp_type_id, "a", h5off , H5T_NATIVE_REAL, error)

For better compatibility I recommend using Fortran intrinsics like "storage_size" and then scaling for bytes/arrays or using C_SIZEOF from the ISO_C_BINDING module.

Sean

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org<mailto:Hdf-forum@lists.hdfgroup.org>
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org