Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HDF5 OSX intermediate group creation errors #1741

Merged
merged 3 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/test_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ jobs:
- name: homebrew
run: |
if [[ ${{ matrix.os }} == macos* ]] ; then \
brew install hdf5@1.10 swig gcc libomp \
&& echo "/usr/local/opt/hdf5@1.10/bin" >> $GITHUB_PATH \
&& echo LDFLAGS="-L/usr/local/lib/ -L/usr/local/opt/hdf5@1.10/lib" >> $GITHUB_ENV \
&& echo CPPFLAGS="-I/usr/local/opt/hdf5@1.10/include" >> $GITHUB_ENV \
&& echo HDF5_BASE="/usr/local/opt/hdf5@1.10/" >> $GITHUB_ENV
brew install hdf5 swig gcc libomp \
&& echo LDFLAGS="-L/usr/local/lib/" >> $GITHUB_ENV
fi
- name: Set up Python ${{ matrix.python-version }}
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/test_python_cplusplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,11 @@ jobs:
# install amici dependencies
- name: homebrew
run: |
brew install hdf5@1.10 swig gcc cppcheck libomp boost \
brew install hdf5 swig gcc cppcheck libomp boost \
&& brew ls -v boost \
&& brew ls -v libomp \
&& echo "/usr/local/opt/hdf5@1.10/bin" >> $GITHUB_PATH \
&& echo LDFLAGS="-L/usr/local/lib/ -L/usr/local/opt/hdf5@1.10/lib -L/usr/local/Cellar/boost/1.78.0_1/lib/" >> $GITHUB_ENV \
&& echo CPPFLAGS="-I/usr/local/opt/hdf5@1.10/include -I/usr/local/Cellar/boost/1.78.0_1/include/" >> $GITHUB_ENV \
&& echo HDF5_BASE="/usr/local/opt/hdf5@1.10/" >> $GITHUB_ENV
&& echo LDFLAGS="-L/usr/local/lib/ -L/usr/local/Cellar/boost/1.78.0_1/lib/" >> $GITHUB_ENV \
&& echo CPPFLAGS="-I/usr/local/Cellar/boost/1.78.0_1/include/" >> $GITHUB_ENV
- name: Build AMICI
run: |
Expand Down
7 changes: 6 additions & 1 deletion src/hdf5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ void checkEventDimensionsCompatible(hsize_t m, hsize_t n, Model const& model) {
void createGroup(H5::H5File const& file,
std::string const& groupPath,
bool recursively) {

#if H5_VERSION_GE(1, 10, 6)
H5::LinkCreatPropList lcpl;
lcpl.setCreateIntermediateGroup(recursively);
file.createGroup(groupPath.c_str(), lcpl);
#else
auto groupCreationPropertyList = H5P_DEFAULT;

if (recursively) {
Expand All @@ -101,6 +105,7 @@ void createGroup(H5::H5File const& file,
throw(AmiException("Failed to create group in hdf5CreateGroup: %s",
groupPath.c_str()));
H5Gclose(group);
#endif
}

std::unique_ptr<ExpData> readSimulationExpData(std::string const& hdf5Filename,
Expand Down