mannau / h5

Interface to the HDF5 Library
Other
70 stars 22 forks source link

compilation of h5_0.9.8 with libhdf5-1.10.1 fails #56

Closed dariomel closed 7 years ago

dariomel commented 7 years ago

when I tried building h5_0.9.8 with libhdf5-1.10.1 I got the following compilation errors,

/opt/apps/tools/gcc-5.3.0/bin/g++ -std=c++11 -I/opt/apps/tools/R/R-3.2.4/lib/R/include -DNDEBUG -I/opt/apps/tools/hdf5-1.10.1/include -I/usr/local/include -I"/mnt/share/apps/tools/R/R-3.2.4/lib/R/library/Rcpp/include"   -fpic  -g -O2 -c Dataset.cpp -o Dataset.o
Dataset.cpp: In function ‘Rcpp::XPtr<H5::DataSet> CreateDataset(Rcpp::XPtr<H5::CommonFG>, std::__cxx11::string, char, Rcpp::NumericVector, Rcpp::NumericVector, Rcpp::NumericVector, int, int)’:
Dataset.cpp:121:29: error: ‘class H5::CommonFG’ has no member named ‘createDataSet’
     DataSet dataset = file->createDataSet(datasetname.c_str(),
                             ^
Dataset.cpp: In function ‘Rcpp::XPtr<H5::DataSet> OpenDataset(Rcpp::XPtr<H5::CommonFG>, std::__cxx11::string)’:
Dataset.cpp:142:42: error: ‘class H5::CommonFG’ has no member named ‘openDataSet’
     DataSet *dataset = new DataSet(file->openDataSet(datasetname.c_str()));
                                          ^
/opt/apps/tools/R/R-3.2.4/lib/R/etc/Makeconf:143: recipe for target 'Dataset.o' failed

I believe the problem is that the HDF5 class hierarchy was slightly changed in hdf5-1.10.1.

However, I successfully built and installed the h5 package after making the following changes to the source code: 1) replace every occurrence of CommonFG with Group in the C++ files under the src directory, 2) change h5_GetAttributeNames_CommonFG to h5_GetAttributeNames_Group inside function GetAttributeNames_CommonFG in file R/RcppExports.R.

epipping commented 7 years ago

I believe this has already been addressed in e01fa7870e9b7d4bd4fffc6bb59779ca3c752cc6 (It’s just that no release has been made since then)

epipping commented 7 years ago

It's worth mentioning that even Debian stretch (the current stable release) now comes with hdf5 1.10.0-patch1.

mannau commented 7 years ago

The current version of h5 0.9.9 is released now on CRAN, see https://CRAN.R-project.org/package=h5 and https://github.com/mannau/h5/releases/tag/release-cran-0.9.9.

Best, Mario