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

hdf5.mod file not found #403

Open
dburnarddata opened this issue Aug 20, 2024 · 1 comment
Open

hdf5.mod file not found #403

dburnarddata opened this issue Aug 20, 2024 · 1 comment

Comments

@dburnarddata
Copy link

Hi there,
I am following the instructions detailed on https://github.com/EDmodel/ED2/wiki/Quick-start, and I keep getting an error that the hdf5.mod file cannot be located even though it is there and file path specified. This error is appearing with all compiler options. Can you please advise?

@mpaiao
Copy link
Contributor

mpaiao commented Aug 20, 2024

Hello @dburnarddata, this error suggests that the compilation is either not finding the hdf5 libraries, or the hdf5 libraries are not compatible with the fortran/c compiler you are using.

There may be two ways of identifying the HDF5 libraries in your system:

Method 1. On your terminal, type locate libhdf5_fortran and locate libdhf5_hl. If these commands work, they should return a list of paths, something like:

/some/path/lib/libhdf5_fortran.a
/some/path/lib/libhdf5_fortran.so
/some/path/lib/libhdf5_fortran.so.310

If this works. then search libz too (locate libz). This will likely return many more paths, look for the ones that show libz.a and/or libz.so (or libz.dylib if running on a Mac). For example:

/another/path/lib/libz.a
/another/path/lib/libz.so

Method 2. If locate doesn't work, try which h5dump. If this works, it should return something like:

/some/path/bin/h5dump

You may need to search for libz.a manually (maybe others have better ideas). Then check that you have libhdf5_fortran by typing ls /some/path/lib/libhdf5_fortran.*, which should show files.

If none of them work, it's likely that you don't have hdf5 installed correctly. If one of them works, them the path you are interested is /some/path (or the equivalent in your path, without the last lib or bin). Then go to the include.mk.???? file that you are using for compiling ED2, and make the following edits:

ZLIB_PATH=/another/path
HDF5_PATH=/some/path
HDF5_INCS=-I$(HDF5_PATH)/include
HDF5C_INCS=$(HDF5_INCS)
HDF5_LIBS=-L$(ZLIB_PATH)/lib -lz -L$(HDF5_PATH)/lib -lhdf5_fortran -lhdf5 -lhdf5_hl

This in principle should fix the hdf5 issue. If you find h5dump and find libhdf5.a or libhdf5.so, but you don't find libhdf5_fortran and/or libhdf5_hl, this means that your hdf5 is missing development features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants