JuliaIO / HDF5.jl

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

libhdf5 not found when importing a package that depends on HDF5 #1033

Closed rkube closed 1 year ago

rkube commented 1 year ago

Hi, HDF5.jl fails to load when I'm importing a package that depends on HDF5 from another package. The situation is like this:

repos/package_A  <-- Depends on HDF5.jl
repos/package_B

Importing and using package_Aby itself is fine. However, loading package_A from within package_B raises an error:

ERROR: LoadError: UndefVarError: libhdf5 not defined

My workflow is like this:

$ julia
julia> push!(LOAD_PATH, "../package_A")
julia> using package_A
ERROR: LoadError: UndefVarError: libhdf5 not defined

A workaround is this:

$ julia
julia> import Pkg; Pkg.add("HDF5")
julia> push!(LOAD_PATH, "../package_A")
julia> using package_A
julia>

Why is it necessary to add HDF5.jl to package_B?

mkitti commented 1 year ago

Can you provide the stack trace?

mkitti commented 1 year ago

Also we should consider alternatives other than LOAD_PATH manipulation. For example, could you use Pkg.dev instead?

simonbyrne commented 1 year ago

It's hard to understand exactly what is going on: can you give the Project.toml and Manifest.toml, or a simple way to reproduce the error?