Skip to content

Commit

Permalink
Fix HDF5 ambiguous overload (#2031)
Browse files Browse the repository at this point in the history
reported by @dilpath: 
> Fails with HDF5 1.14.0, 1.13.3. Works with 1.12.1

```
      amici/src/hdf5.cpp:949:65: error: call of overloaded ‘H5File(const char*, unsigned int, int)’ is ambiguous
        949 |     H5::H5File file(hdffile.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT);
```

Co-authored-by: Stephan Grein <[email protected]>
  • Loading branch information
dweindl and stephanmg authored Mar 8, 2023
1 parent e2d38ed commit ecd6bbb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hdf5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -946,14 +946,16 @@ void readSolverSettingsFromHDF5(H5::H5File const& file, Solver &solver,

void readSolverSettingsFromHDF5(const std::string &hdffile, Solver &solver,
const std::string &datasetPath) {
H5::H5File file(hdffile.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT);
H5::H5File file(hdffile.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT,
H5::FileAccPropList::DEFAULT);

readSolverSettingsFromHDF5(file, solver, datasetPath);
}

void readModelDataFromHDF5(const std::string &hdffile, Model &model,
const std::string &datasetPath) {
H5::H5File file(hdffile.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT);
H5::H5File file(hdffile.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT,
H5::FileAccPropList::DEFAULT);

readModelDataFromHDF5(file, model, datasetPath);
}
Expand Down

0 comments on commit ecd6bbb

Please sign in to comment.