Problem linking HDF5.jl to system libhdf5

johnomotani
Fri, 13 Jan 2023 16:41:43 +0000
General Usage

I am trying to use HDF5.jl with the system-provided libhdf5 (in order to use MPI), following the instructions here: Home · HDF5.jl.

I get an error about ‘failing to find libhdf5’, even though the library is present in the directory pointed to by JULIA_HDF5_PATH - see below (ls at the top shows library exists, then the error message is at the bottom). Any suggestions to track down the problem?

$ ls /usr/lib/x86_64-linux-gnu/hdf5/openmpi/
include    libhdf5_cpp.a      libhdf5_fortran.so  libhdf5_hl_cpp.so     libhdf5_hl.so
lib        libhdf5_cpp.so     libhdf5_hl.a        libhdf5hl_fortran.a   libhdf5.settings
libhdf5.a  libhdf5_fortran.a  libhdf5_hl_cpp.a    libhdf5hl_fortran.so  libhdf5.so
$ julia --project
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.2 (2022-09-29)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using MPI

julia> ENV["JULIA_HDF5_PATH"] = "/usr/lib/x86_64-linux-gnu/hdf5/openmpi/"
"/usr/lib/x86_64-linux-gnu/hdf5/openmpi/"

(moment_kinetics) pkg> add HDF5
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `~/physics/moment_kinetics-test/Project.toml`
  [f67ccb44] + HDF5 v0.16.13
    Updating `~/physics/moment_kinetics-test/Manifest.toml`
  [f67ccb44] + HDF5 v0.16.13

(moment_kinetics) pkg> build
    Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/6e47d11ea2776bc5627421d59cdcc1296c058071/build.log`
    Building IJulia → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/98ab633acb0fe071b671f6c1785c46cd70bb86bd/build.log`
    Building PyCall → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/53b8b07b721b77144a0fbbbc2675222ebf40a02d/build.log`
    Building HDF5 ──→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/b5df7c3cab3a00c33c2e09c6bd23982a75e2fbb2/build.log`
ERROR: Error building `HDF5`:
[ Info: using system HDF5
ERROR: LoadError: libhdf5 could not be found
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] top-level scope
   @ ~/.julia/packages/HDF5/TcavY/deps/build.jl:49
 [3] include(fname::String)
   @ Base.MainInclude ./client.jl:476
 [4] top-level scope
   @ none:5
in expression starting at /home/john/.julia/packages/HDF5/TcavY/deps/build.jl:32

9 posts - 3 participants