-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Let me bring up the following issue again. MWE: In a fresh environment with julia --project=., do
julia> using Pkg
julia> Pkg.add(["MPIPreferences", "P4est_jll"])
[...]
julia> using MPIPreferences
julia> MPIPreferences.use_system_binary()
┌ Info: MPI implementation identified
│ libmpi = "libmpi"
│ version_string = "Open MPI v4.1.0, package: Debian OpenMPI, ident: 4.1.0, repo rev: v4.1.0, Dec 18, 2020\0"
│ impl = "OpenMPI"
│ version = v"4.1.0"
└ abi = "OpenMPI"
┌ Info: MPIPreferences changed
│ binary = "system"
│ libmpi = "libmpi"
│ abi = "OpenMPI"
│ mpiexec = "mpiexec"
│ preloads = Any[]
└ preloads_env_switch = nothing
julia> using P4est_jll
julia> P4est_jll.libp4est
"~/.julia/artifacts/3a2ff5d867b2d3d729a84fb3f736761ae336fcbf/lib/libp4est.so"but after leaving and restarting the REPL julia --project=.:
julia> using P4est_jll
julia> P4est_jll.libp4est
ERROR: UndefVarError: `libp4est` not defined
Stacktrace:
[1] getproperty(x::Module, f::Symbol)
@ Base ./Base.jl:31
[2] top-level scope
@ REPL[2]:1After deleting the LocalPreferences.toml, of course, this works again.
This has not been a real issue as one usually wants to use a custom p4est version (and not the one from P4est_jll) when using a system MPI anyway, but the reason I come up with this again is that the exact same steps as above, but with HDF5_jll and libhdf5 does not give any UndefVarError for me, as I would also expect. If this would work for P4est_jll, we can think about adding a convenience function set_libraries! (or similar) that sets the preferences for P4est.jl as it is done in JuliaIO/HDF5.jl#1115. However, with the error above using P4est does not work as long as we have MPIPreferences set and so the convenience function could not be called. Do we know why this happens with P4est_jll in the first place? Does it also happen with a local MPICH version (which is the default for P4est_jll.jl)? And even better: Can we fix this for P4est_jll?
This would also make https://trixi-framework.github.io/P4est.jl/stable/troubleshooting/ obsolete.