JuliaIO / HDF5.jl

Save and load data in the HDF5 file format from Julia
https://juliaio.github.io/HDF5.jl
MIT License
391 stars 143 forks source link

ERROR: LoadError: UndefVarError: `libhdf5` not defined in Julia 1.10 DEV #1080

Open truedichotomy opened 1 year ago

truedichotomy commented 1 year ago

When I tried to install HDF5 master in Julia 1.10 DEV, I get the following error:

(@ocean) pkg> add https://github.com/JuliaIO/HDF5.jl
    Updating git-repo `https://github.com/JuliaIO/HDF5.jl`
   Resolving package versions...
    Updating `~/.julia/environments/ocean/Project.toml`
  [f67ccb44] + HDF5 v0.17.0 `https://github.com/JuliaIO/HDF5.jl#master`
    Updating `~/.julia/environments/ocean/Manifest.toml`
  [f67ccb44] + HDF5 v0.17.0 `https://github.com/JuliaIO/HDF5.jl#master`
  [3da0fdf6] + MPIPreferences v0.1.8
Precompiling project...
  ✗ HDF5
  0 dependencies successfully precompiled in 2 seconds. 653 already precompiled.
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

(@ocean) pkg> precompile
Precompiling project...
  ✗ HDF5
  0 dependencies successfully precompiled in 2 seconds. 653 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

HDF5 [f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f]

Failed to precompile HDF5 [f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f] to "/Users/gong/.julia/compiled/v1.10/HDF5/jl_WCZkry".
ERROR: LoadError: UndefVarError: `libhdf5` not defined

versioninfo:

julia> versioninfo()
Julia Version 1.10.0-DEV.1536
Commit 71a6a32099 (2023-06-20 21:51 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin22.5.0)
  CPU: 8 × Apple M2
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
  Threads: 1 on 4 virtual cores
mkitti commented 1 year ago

I tested this on x86-64 Linux and HDF5 master branch seems load normally there.

(jl_Sp66TQ) pkg> st
Status `/tmp/jl_Sp66TQ/Project.toml`
  [f67ccb44] HDF5 v0.17.0 `https://github.com/JuliaIO/HDF5.jl.git#master`

julia> versioninfo()
Julia Version 1.10.0-DEV.1475
Commit 51e8db487b* (2023-06-14 07:42 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × AMD FX(tm)-8350 Eight-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, bdver1)
  Threads: 1 on 8 virtual cores

I will try to reproduce on macOS tomorrow.

jonniediegelman commented 1 week ago

Every so often this exact error comes up for me and it takes a lot of messing around until it just seems to go away. Is there maybe a better way to handle this libhdf5 variable so this doesn't happen anymore? It seems like it's just being spawned out of thin air (it's not defined in the code) and I can't tell what conditions make it appear or not.

mkitti commented 1 week ago

I think the issue is probably due to an old HDF5_jll being installed. Check the HDF5_jll version.