* Bug 14539 fixed: Building with hdf5 1.10.0 failed 65/20065/4
Gilles FILLIPINI through [Sun, 27 May 2018 11:21:59 +0000 (13:21 +0200)]
  http://bugzilla.scilab.org/14539

Change-Id: I4620ccf4b6530fc8af501784a94d1aba800fb643

scilab/CHANGES.md
scilab/modules/hdf5/Makefile.am
scilab/modules/hdf5/Makefile.in
scilab/modules/hdf5/sci_gateway/cpp/sci_hdf5_listvar_v3.cpp
scilab/modules/hdf5/sci_gateway/cpp/sci_hdf5_load_v3.cpp
scilab/modules/hdf5/src/c/h5_readDataFromFile.c
scilab/modules/hdf5/src/c/h5_readDataFromFile_v1.c
scilab/modules/hdf5/src/c/h5_writeDataToFile.c
scilab/modules/hdf5/src/cpp/H5ReferenceData.cpp

index 72b9c9d..3e9b183 100644 (file)
@@ -474,6 +474,7 @@ Known issues
 * [#14521](http://bugzilla.scilab.org/show_bug.cgi?id=14521): For the CONVERT Xcos block, types codes 2, 6, 7, and 8 were not documented.
 * [#14522](http://bugzilla.scilab.org/show_bug.cgi?id=14522): `or(%nan)` was %F.
 * [#14536](http://bugzilla.scilab.org/show_bug.cgi?id=14536): `xpoly` crashed Scilab when it is used in logarithmic mode for points with negative or null coordinates.
+* [#14539](http://bugzilla.scilab.org/show_bug.cgi?id=14539): It was not possible to build Scilab with hdf5 1.10.0.
 * [#14606](http://bugzilla.scilab.org/show_bug.cgi?id=14606): Memory used by variables returned by `[names,mem]=who()` was always zero.
 * [#14701](http://bugzilla.scilab.org/show_bug.cgi?id=14701): `poly(c,v,"coeff")` did not ignore null high order coefficients.
 * [#14704](http://bugzilla.scilab.org/show_bug.cgi?id=14704): In Scinotes, URL for the `https://`, `ftp://`, `ftps://`, and `file://` protocols were no longer hyperlinked.
index 274da64..3d6bce8 100644 (file)
@@ -94,7 +94,7 @@ endif
 
 
 #### hdf5 : include files ####
-FORCE_HDF_1.8_API = \
+FORCE_HDF_API = \
     -DH5Dopen_vers=2 \
     -DH5Topen_vers=2 \
     -DH5Dcreate_vers=2 \
@@ -102,7 +102,10 @@ FORCE_HDF_1.8_API = \
     -DH5Gcreate_vers=2 \
     -DH5Gopen_vers=2 \
     -DH5Tget_array_dims_vers=2 \
-    -DH5Acreate_vers=2 -DNO_DEPRECATED_SYMBOLS
+    -DH5Acreate_vers=2 \
+    -DH5Rdereference_vers=2 \
+    -DNO_DEPRECATED_SYMBOLS
+
 
 libscihdf5_la_CPPFLAGS = \
     -I$(srcdir)/includes/ \
@@ -132,7 +135,7 @@ libscihdf5_la_CPPFLAGS = \
     $(JAVA_JNI_INCLUDE) \
     $(HDF5_CFLAGS) \
     $(AM_CPPFLAGS) \
-    $(FORCE_HDF_1.8_API)
+    $(FORCE_HDF_API)
 
 
 
index e658fa9..490bac3 100644 (file)
@@ -702,7 +702,7 @@ GATEWAY_CXX_SOURCES = \
 @GIWS_TRUE@BUILT_SOURCES = giws
 
 #### hdf5 : include files ####
-FORCE_HDF_1.8_API = \
+FORCE_HDF_API = \
     -DH5Dopen_vers=2 \
     -DH5Topen_vers=2 \
     -DH5Dcreate_vers=2 \
@@ -710,7 +710,9 @@ FORCE_HDF_1.8_API = \
     -DH5Gcreate_vers=2 \
     -DH5Gopen_vers=2 \
     -DH5Tget_array_dims_vers=2 \
-    -DH5Acreate_vers=2 -DNO_DEPRECATED_SYMBOLS
+    -DH5Acreate_vers=2 \
+    -DH5Rdereference_vers=2 \
+    -DNO_DEPRECATED_SYMBOLS
 
 libscihdf5_la_CPPFLAGS = \
     -I$(srcdir)/includes/ \
@@ -740,7 +742,7 @@ libscihdf5_la_CPPFLAGS = \
     $(JAVA_JNI_INCLUDE) \
     $(HDF5_CFLAGS) \
     $(AM_CPPFLAGS) \
-    $(FORCE_HDF_1.8_API)
+    $(FORCE_HDF_API)
 
 
 #### hdf5 : gateway declaration ####
index 8bf6f16..79fa2a0 100644 (file)
@@ -738,7 +738,11 @@ static bool read_struct(int dataset, VarInfo6& info)
             //import field
             for (int j = 0; j < refcount; ++j)
             {
-                int data = H5Rdereference(refs, H5R_OBJECT, &vrefs[j]);
+                int data = H5Rdereference(refs,
+#if H5_VERSION_GE(1,10,0)
+                                          H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                                          H5R_OBJECT, &vrefs[j]);
                 if (data < 0)
                 {
                     return false;
index 6c03482..a125069 100644 (file)
@@ -654,7 +654,11 @@ static types::InternalType* import_struct(int dataset)
         //import field
         for (int j = 0; j < refcount; ++j)
         {
-            int data = H5Rdereference(refs, H5R_OBJECT, &vrefs[j]);
+            int data = H5Rdereference(refs,
+#if H5_VERSION_GE(1,10,0)
+                                      H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                                      H5R_OBJECT, &vrefs[j]);
             if (data < 0)
             {
                 freeStringMatrix(dfield, fields.data());
index e23973d..5d95d72 100644 (file)
@@ -746,7 +746,11 @@ int readCommonPolyMatrix(int _iDatasetId, char *_pstVarname, int _iComplex, int
         /*
          * Open the referenced object, get its name and type.
          */
-        obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pData[i]);
+        obj = H5Rdereference(_iDatasetId,
+    #if H5_VERSION_GE(1,10,0)
+                             H5P_DATASET_ACCESS_DEFAULT,
+    #endif
+                             H5R_OBJECT, &pData[i]);
         if (_iComplex)
         {
             status = readComplexPoly(obj, &_piNbCoef[i], &_pdblReal[i], &_pdblImg[i]);
@@ -980,7 +984,11 @@ int readCommonSparseComplexMatrix(int _iDatasetId, int _iComplex, int _iRows, in
     }
 
     //read Row data
-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[0]);
+    obj = H5Rdereference(_iDatasetId,
+#if H5_VERSION_GE(1,10,0)
+                         H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                         H5R_OBJECT, &pRef[0]);
     status = readInteger32Matrix(obj, _piNbItemRow);
     if (status < 0)
     {
@@ -988,7 +996,11 @@ int readCommonSparseComplexMatrix(int _iDatasetId, int _iComplex, int _iRows, in
     }
 
     //read cols data
-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[1]);
+    obj = H5Rdereference(_iDatasetId,
+#if H5_VERSION_GE(1,10,0)
+                         H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                         H5R_OBJECT, &pRef[1]);
     status = readInteger32Matrix(obj, _piColPos);
     if (status < 0)
     {
@@ -996,7 +1008,11 @@ int readCommonSparseComplexMatrix(int _iDatasetId, int _iComplex, int _iRows, in
     }
 
     //read sparse data
-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[2]);
+    obj = H5Rdereference(_iDatasetId,
+#if H5_VERSION_GE(1,10,0)
+                         H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                         H5R_OBJECT, &pRef[2]);
 
     if (_iComplex)
     {
@@ -1047,7 +1063,11 @@ int readBooleanSparseMatrix(int _iDatasetId, int _iRows, int _iCols, int _iNbIte
     }
 
     //read Row data
-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[0]);
+    obj = H5Rdereference(_iDatasetId,
+#if H5_VERSION_GE(1,10,0)
+                         H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                         H5R_OBJECT, &pRef[0]);
     status = readInteger32Matrix(obj, _piNbItemRow);
     if (status < 0)
     {
@@ -1057,7 +1077,11 @@ int readBooleanSparseMatrix(int _iDatasetId, int _iRows, int _iCols, int _iNbIte
     if (_iNbItem != 0)
     {
         //read cols data
-        obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[1]);
+        obj = H5Rdereference(_iDatasetId,
+    #if H5_VERSION_GE(1,10,0)
+                             H5P_DATASET_ACCESS_DEFAULT,
+    #endif
+                             H5R_OBJECT, &pRef[1]);
         status = readInteger32Matrix(obj, _piColPos);
         if (status < 0)
         {
@@ -1158,7 +1182,11 @@ int getListItemDataset(int _iDatasetId, void *_piItemRef, int _iItemPos, int *_p
 {
     hobj_ref_t poRef = ((hobj_ref_t *) _piItemRef)[_iItemPos];
 
-    *_piItemDataset = H5Rdereference(_iDatasetId, H5R_OBJECT, &poRef);
+    *_piItemDataset = H5Rdereference(_iDatasetId,
+#if H5_VERSION_GE(1,10,0)
+                                     H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                                     H5R_OBJECT, &poRef);
 
     if (*_piItemDataset == 0)
     {
index f636a26..2ab71b6 100644 (file)
@@ -474,7 +474,11 @@ int readDoubleMatrix_v1(int _iDatasetId, int _iRows, int _iCols, double *_pdblDa
         }
 
         //Open the referenced object, get its name and type.
-        obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &Ref);
+        obj = H5Rdereference(_iDatasetId,
+    #if H5_VERSION_GE(1,10,0)
+                             H5P_DATASET_ACCESS_DEFAULT,
+    #endif
+                             H5R_OBJECT, &Ref);
         readDouble_v1(obj, _iRows, _iCols, _pdblData);
     }
 
@@ -501,14 +505,22 @@ int readDoubleComplexMatrix_v1(int _iDatasetId, int _iRows, int _iCols, double *
     }
 
     //Open the referenced object, get its name and type.
-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[0]);
+    obj = H5Rdereference(_iDatasetId,
+#if H5_VERSION_GE(1,10,0)
+                         H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                         H5R_OBJECT, &pRef[0]);
     status = readDouble_v1(obj, _iRows, _iCols, _pdblReal);
     if (status < 0)
     {
         return -1;
     }
 
-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[1]);
+    obj = H5Rdereference(_iDatasetId,
+#if H5_VERSION_GE(1,10,0)
+                         H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                         H5R_OBJECT, &pRef[1]);
     status = readDouble_v1(obj, _iRows, _iCols, _pdblImg);
     if (status < 0)
     {
@@ -834,7 +846,11 @@ int readCommonPolyMatrix_v1(int _iDatasetId, char *_pstVarname, int _iComplex, i
         /*
         * Open the referenced object, get its name and type.
         */
-        obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pData[i]);
+        obj = H5Rdereference(_iDatasetId,
+    #if H5_VERSION_GE(1,10,0)
+                             H5P_DATASET_ACCESS_DEFAULT,
+    #endif
+                             H5R_OBJECT, &pData[i]);
         if (_iComplex)
         {
             status = readComplexPoly_v1(obj, &_piNbCoef[i], &_pdblReal[i], &_pdblImg[i]);
@@ -1069,7 +1085,11 @@ int readCommonSparseComplexMatrix_v1(int _iDatasetId, int _iComplex, int _iRows,
     }
 
     //read Row data
-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[0]);
+    obj = H5Rdereference(_iDatasetId,
+#if H5_VERSION_GE(1,10,0)
+                         H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                         H5R_OBJECT, &pRef[0]);
     status = readInteger32Matrix_v1(obj, 1, _iRows, _piNbItemRow);
     if (status < 0)
     {
@@ -1077,7 +1097,11 @@ int readCommonSparseComplexMatrix_v1(int _iDatasetId, int _iComplex, int _iRows,
     }
 
     //read cols data
-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[1]);
+    obj = H5Rdereference(_iDatasetId,
+#if H5_VERSION_GE(1,10,0)
+                         H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                         H5R_OBJECT, &pRef[1]);
     status = readInteger32Matrix_v1(obj, 1, _iNbItem, _piColPos);
     if (status < 0)
     {
@@ -1085,7 +1109,11 @@ int readCommonSparseComplexMatrix_v1(int _iDatasetId, int _iComplex, int _iRows,
     }
 
     //read sparse data
-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[2]);
+    obj = H5Rdereference(_iDatasetId,
+#if H5_VERSION_GE(1,10,0)
+                         H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                         H5R_OBJECT, &pRef[2]);
 
     if (_iComplex)
     {
@@ -1131,7 +1159,11 @@ int readBooleanSparseMatrix_v1(int _iDatasetId, int _iRows, int _iCols, int _iNb
     }
 
     //read Row data
-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[0]);
+    obj = H5Rdereference(_iDatasetId,
+#if H5_VERSION_GE(1,10,0)
+                         H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                         H5R_OBJECT, &pRef[0]);
     status = readInteger32Matrix_v1(obj, 1, _iRows, _piNbItemRow);
     if (status < 0)
     {
@@ -1139,7 +1171,11 @@ int readBooleanSparseMatrix_v1(int _iDatasetId, int _iRows, int _iCols, int _iNb
     }
 
     //read cols data
-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[1]);
+    obj = H5Rdereference(_iDatasetId,
+#if H5_VERSION_GE(1,10,0)
+                         H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                         H5R_OBJECT, &pRef[1]);
     status = readInteger32Matrix_v1(obj, 1, _iNbItem, _piColPos);
     if (status < 0)
     {
@@ -1234,7 +1270,11 @@ int getListItemDataset_v1(int _iDatasetId, void *_piItemRef, int _iItemPos, int
 {
     hobj_ref_t poRef = ((hobj_ref_t *) _piItemRef)[_iItemPos];
 
-    *_piItemDataset = H5Rdereference(_iDatasetId, H5R_OBJECT, &poRef);
+    *_piItemDataset = H5Rdereference(_iDatasetId,
+#if H5_VERSION_GE(1,10,0)
+                                     H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                                     H5R_OBJECT, &poRef);
 
     if (*_piItemDataset == 0)
     {
index 6f3aff1..1380c0b 100644 (file)
@@ -2178,7 +2178,7 @@ int writeDoubleMatrix6(int parent, const char* name, int dims, int* pdims, doubl
     return dset;
 }
 
-hid_t writeDoubleComplexMatrix6(int parent, const char* name, int dims, int* pdims, double* real, double* img)
+HDF5_SCILAB_IMPEXP int writeDoubleComplexMatrix6(int parent, const char* name, int dims, int* pdims, double* real, double* img)
 {
     hid_t space = 0;
     hid_t dset = 0;
index 496b8ce..378a442 100644 (file)
@@ -42,7 +42,11 @@ const char ** H5ReferenceData::getReferencesName() const
     for (int i = 0; i < totalSize; i++)
     {
         void * ref = &(((void **)cdata)[i]);
-        hid_t obj = H5Rdereference(file, datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
+        hid_t obj = H5Rdereference(file,
+    #if H5_VERSION_GE(1,10,0)
+                                   H5P_DATASET_ACCESS_DEFAULT,
+    #endif
+                                   datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
         H5O_info_t info;
         H5Oget_info(obj, &info);
         H5Oclose(obj);
@@ -84,7 +88,11 @@ H5Object & H5ReferenceData::getData(const unsigned int size, const unsigned int
 
     file = getFile().getH5Id();
     ref = &(((void **)cdata)[0]);
-    obj = H5Rdereference(file, datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
+    obj = H5Rdereference(file,
+#if H5_VERSION_GE(1,10,0)
+                         H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                         datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
     if (obj < 0)
     {
         throw H5Exception(__LINE__, __FILE__, _("Cannot open object at the given position."));
@@ -126,7 +134,11 @@ H5Object ** H5ReferenceData::getReferencesObject() const
     for (int i = 0; i < totalSize; i++)
     {
         void * ref = &(((void **)cdata)[i]);
-        hid_t obj = H5Rdereference(file, datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
+        hid_t obj = H5Rdereference(file,
+    #if H5_VERSION_GE(1,10,0)
+                                   H5P_DATASET_ACCESS_DEFAULT,
+    #endif
+                                   datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
         objs[i] = &H5Object::getObject(getParent(), obj);
     }
 
@@ -181,7 +193,11 @@ void H5ReferenceData::printData(std::ostream & os, const unsigned int pos, const
     char * cdata = static_cast<char *>(data) + offset + pos * (stride ? stride : dataSize);
     void ** ref = &(((void **)cdata)[0]);
     hid_t file = getFile().getH5Id();
-    hid_t obj = H5Rdereference(file, datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
+    hid_t obj = H5Rdereference(file,
+#if H5_VERSION_GE(1,10,0)
+                               H5P_DATASET_ACCESS_DEFAULT,
+#endif
+                               datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
     if (obj < 0)
     {
         os << "NULL";