geospace-code / h5fortran

Lightweight HDF5 polymorphic Fortran: h5write() h5read()
https://geospace-code.github.io/h5fortran
BSD 3-Clause "New" or "Revised" License
99 stars 23 forks source link

[Bug]: lhdf5_hl_fortran/lhdf5hl_fortran flag inconsistency with packages that depend on h5fortran but use higher version of HDF5 #37

Closed mghaderizefreh closed 1 year ago

mghaderizefreh commented 1 year ago

What happened?

I tried to install neural-fortran and got an error that hdf5hl_fortran is not found. After spending a long time realised HDF5 changed their flag for their library after an update and because I was using a higher version (1.12), lhdf5hl_fortran is now lhdf5_hl_fortran and therefore the dependency is breaking. (as also commented in the toml file)

A quick fix would be to somehow make an alias for this flag (I have no idea how) but I wonder if there is any other fix without downgrading HDF5. Getting toml to point to a specific release version of h5fortran that uses specifc version of HDF5 flag could be a solution but does that mean all downstream packages need to do the same?

Relevant log output

No response

mghaderizefreh commented 1 year ago

Edit: I used fpm to install.

Update: I changed the toml in build/dependecies/h5fortran/fpm.toml after the first failure (commented the wrong flags and put the right ones), and the build was succesful successful this time but now testing fails with error.

dyld: Library not loaded: @rpath/libhdf5.200.dylib

scivision commented 1 year ago

I don't think fpm can handle these situations. I asked the fpm team to make "if" clauses available in fpm.toml but they felt this was not according to their design philosophy. This to me leaves FPM as only suited for narrow sets of scenarios that need hand-editing to work with systems in general.