# HDF5 error: MPIExt cannot find libmpi\_usempif08.40.dylib

**URL:** <https://discourse.julialang.org/t/hdf5-error-mpiext-cannot-find-libmpi-usempif08-40-dylib/115900>\
**Category:** General Usage\
**Tags:** hdf5, mpi, mpipreferences\
**Created:** [June 20, 2024, 3:47am UTC](https://discourse.julialang.org/t/hdf5-error-mpiext-cannot-find-libmpi-usempif08-40-dylib/115900 "2024-06-20T03:47:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 20, 2024, 3:47am UTC](https://discourse.julialang.org/t/hdf5-error-mpiext-cannot-find-libmpi-usempif08-40-dylib/115900/1 "2024-06-20T03:47:46Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/4/2/42143a09871a61724006b99e78d673be2b66ab56.png)  
Missing /.julia/artifacts/69e85a392db842d919cf5759941f8f3e8a0e569e/lib/libhdf5\_fortran.so"  
libmpi\_usempif08.so.40: cannot open shared object file: No such file or directory  
? Any idea what that is about?

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 20, 2024, 3:50am UTC](https://discourse.julialang.org/t/hdf5-error-mpiext-cannot-find-libmpi-usempif08-40-dylib/115900/2 "2024-06-20T03:50:44Z")

</div>

The missing library was found for a different artifact:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/e/3e20165fd20d5491da58b229119e31a2618b1f3d.png)  
So there is such a library in circulation, but for some reason MPIExt fails to install/ find it?

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [June 20, 2024, 1:14pm UTC](https://discourse.julialang.org/t/hdf5-error-mpiext-cannot-find-libmpi-usempif08-40-dylib/115900/3 "2024-06-20T13:14:59Z")

</div>

What operating system and platform is this? The output of `versioninfo()` should suffice.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 20, 2024, 1:16pm UTC](https://discourse.julialang.org/t/hdf5-error-mpiext-cannot-find-libmpi-usempif08-40-dylib/115900/4 "2024-06-20T13:16:16Z")

</div>

This happens both on a Mac and on Linux. Julia 1.10.0 (Mac) and 1.10.3 (Linux).

```julia
julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 24 × Apple M2 Ultra
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
  Threads: 1 on 16 virtual cores

```

Now upgraded to 1.10.4, erased the depot. Still the same error.

```julia
julia> err
PkgPrecompileError: The following 7 direct dependencies failed to precompile:

FinEtoolsHeatDiff [972d1c22-8bdd-11e9-11cf-cdcb7577b041]

Failed to precompile FinEtoolsHeatDiff [972d1c22-8bdd-11e9-11cf-cdcb7577b041] to "/Users/pkrysl/.julia/compiled/v1.10/FinEtoolsHeatDiff/jl_GN5XKf".
ERROR: LoadError: InitError: could not load library "/Users/pkrysl/.julia/artifacts/1ca9a5d2ef01daeca735b28c3ce62406fc87e2ab/lib/libhdf5_fortran.310.dylib"
dlopen(/Users/pkrysl/.julia/artifacts/1ca9a5d2ef01daeca735b28c3ce62406fc87e2ab/lib/libhdf5_fortran.310.dylib, 0x0001): Library not loaded: @rpath/libmpi_usempif08.40.dylib
  Referenced from: <2DED3716-8217-3BFA-898A-DB658BC608DA> /Users/pkrysl/.julia/artifacts/1ca9a5d2ef01daeca735b28c3ce62406fc87e2ab/lib/libhdf5_fortran.310.dylib
  Reason: tried: '/Users/pkrysl/.julia/artifacts/1ca9a5d2ef01daeca735b28c3ce62406fc87e2ab/lib/./libmpi_usempif08.40.dylib' (no such file), '/Users/pkrysl/.julia/artifacts/1ca9a5d2ef01daeca735b28c3ce62406fc87e2ab/lib/./libmpi_usempif08.40.dylib' (no such file), '/Users/pkrysl/julia-1.10.4/lib/julia/libmpi_usempif08.40.dylib' (no such file), '/Users/pkrysl/julia-1.10.4/lib/julia/../libmpi_usempif08.40.dylib' (no such file), '/Users/pkrysl/julia-1.10.4/lib/libmpi_usempif08.40.dylib' (no such file), '/usr/local/lib/libmpi_usempif08.40.dylib' (no such file), '/usr/lib/libmpi_usempif08.40.dylib' (no such file, not in dyld cache)
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl ./libdl.jl:117
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl ./libdl.jl:116
  [3] macro expansion
    @ ~/.julia/packages/JLLWrappers/pG9bm/src/products/library_generators.jl:63 [inlined]
  [4] __init__ ()
    @ HDF5_jll ~/.julia/packages/HDF5_jll/pjOXH/src/wrappers/aarch64-apple-darwin-libgfortran5-mpi+openmpi.jl:48
  [5] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1134
  [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1122
  [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1067
  [8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1581
  [9] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1938
 [10] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1812
 [11] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [12] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [13] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1803
 [14] macro expansion
    @ ./loading.jl:1790 [inlined]
 [15] macro expansion
    @ ./lock.jl:267 [inlined]
 [16] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1753
 [17] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [18] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [19] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1746
 [20] top-level scope
    @ ~/.julia/packages/HDF5/Z859u/src/api/api.jl:11
 [21] include(mod::Module, _path::String)
    @ Base ./Base.jl:495
 [22] include(x::String)
    @ HDF5 ~/.julia/packages/HDF5/Z859u/src/HDF5.jl:1
 [23] top-level scope
    @ ~/.julia/packages/HDF5/Z859u/src/HDF5.jl:68
 [24] include
    @ ./Base.jl:495 [inlined]
 [25] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base ./loading.jl:2222
 [26] top-level scope
    @ stdin:3
during initialization of module HDF5_jll
in expression starting at /Users/pkrysl/.julia/packages/HDF5/Z859u/src/api/api.jl:1
in expression starting at /Users/pkrysl/.julia/packages/HDF5/Z859u/src/HDF5.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile HDF5 [f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f] to "/Users/pkrysl/.julia/compiled/v1.10/HDF5/jl_hVlw7e".

```

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 20, 2024, 1:41pm UTC](https://discourse.julialang.org/t/hdf5-error-mpiext-cannot-find-libmpi-usempif08-40-dylib/115900/5 "2024-06-20T13:41:30Z")

</div>

I can’t find any mention of this lib in MPIExt, so perhaps MPI.jl is at fault?

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 20, 2024, 1:48pm UTC](https://discourse.julialang.org/t/hdf5-error-mpiext-cannot-find-libmpi-usempif08-40-dylib/115900/6 "2024-06-20T13:48:17Z")

</div>

It was MPIPreferences. I had it in the environment, I removed it and the errors went away.

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [June 20, 2024, 1:50pm UTC](https://discourse.julialang.org/t/hdf5-error-mpiext-cannot-find-libmpi-usempif08-40-dylib/115900/7 "2024-06-20T13:50:27Z")

</div>

I see. Perhaps you got caught in a transition to package extensions with regard to MPI and HDF5?

---

<div class="post-metadata">

**Author:** ![Azurezaber](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/azurezaber/32/44713_2.png) [@Azurezaber](https://discourse.julialang.org/u/Azurezaber)\
**Post date:** [November 9, 2024, 6:51pm UTC](https://discourse.julialang.org/t/hdf5-error-mpiext-cannot-find-libmpi-usempif08-40-dylib/115900/8 "2024-11-09T18:51:58Z")

</div>

I am currently facing the exact same issue trying to build HDF5 on an MPI-enabled system. When you said you removed it from the environment, do you mean you completely removed MPIPreferneces from your project? or is there a specific setting in MPIPreferences that you removed in order for it to build correctly?

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [November 9, 2024, 8:27pm UTC](https://discourse.julialang.org/t/hdf5-error-mpiext-cannot-find-libmpi-usempif08-40-dylib/115900/9 "2024-11-09T20:27:26Z")

</div>

I updated the environment, and now I have no troubles from that quarter. Sorry I cannot be more help.
