Closed jmburgos closed 2 years ago
Hello Julian,
can you indicate your OS, the DIVAnd version and the NCDatasets version?
Edit: also, can you check is this issue https://github.com/Alexander-Barth/NCDatasets.jl/issues/118 is relevant for your situation?
Could you test this command?
]add NetCDF_jll
using NetCDF_jll
I use Fedora 35. The package versions are as follows:
[efc8151c] DIVAnd v2.7.8 [85f8d34a] NCDatasets v0.11.9
I will examine the issue that you mentioned.
I installed NetCDF_jill:
[efc8151c] DIVAnd v2.7.8 [85f8d34a] NCDatasets v0.12.5 [7243133f] NetCDF_jll v400.702.400+0
But if I do "using NetCDF_jill" I get the following:
ERROR: InitError: could not load library "/home/julian/.julia/artifacts/0a7f440ba143b238cc3dd0def2956d34d76755f3/lib/libnetcdf.so"
libmbedtls.so.13: cannot open shared object file: No such file or directory
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/JLLWrappers/QpMQW/src/products/library_generators.jl:54 [inlined]
[2] __init__()
@ NetCDF_jll ~/.julia/packages/NetCDF_jll/xjKDT/src/wrappers/x86_64-linux-gnu.jl:14
during initialization of module NetCDF_jll
I think you need to install another version of NetCDF_jll
. Can you try
using Pkg
Pkg.update()
to update the packages, then
Pkg.status()
and put here the output of that command.
Maybe a stupid question; do you actually need the netCDF utilities ? Most likely the rest will work normally and you could use DIVAnd anyway while we try to solve the issue
Thank you guys. I have already the latest packages. Here is the the output of Pkg.status()
[efc8151c] DIVAnd v2.7.8
[85f8d34a] NCDatasets v0.12.5
[7243133f] NetCDF_jll v400.702.400+0
@jmbeckers, that is actually a very good question. I am planning to call DIVAnd from R using the JuliaCall package, so the data manipulation will happen in the R side. If the netCDF utilities are not needed to carry out the actual interpolations, then perhaps I do not need to worry much about his right now.
From an email exchange with @Alexander-Barth, I had to have the version v400.802.102+0
for
NetCDF_jll, instead of v400.702.400+0
, which the one you have.
I though that the update command would have solved that.
Maybe with
using Pkg
Pkg.add("NetCDF_jll")
Pkg.pin("NetCDF_jll", version="`v400.802.102")
Thank you guys. I have already the latest packages. Here is the the output of Pkg.status()
[efc8151c] DIVAnd v2.7.8 [85f8d34a] NCDatasets v0.12.5 [7243133f] NetCDF_jll v400.702.400+0
@jmbeckers, that is actually a very good question. I am planning to call DIVAnd from R using the JuliaCall package, so the data manipulation will happen in the R side. If the netCDF utilities are not needed to carry out the actual interpolations, then perhaps I do not need to worry much about his right now.
The interpolation does not depend on netCDF utilities but I do not know how the precompilation interacts with problems in the netCDF library. If that blocks the use of DIVAnd, maybe it would be interesting for us to split DIVAnd into two parts, the core interpolation and the climatology calculation/data manipulation part so that the core part is less package dependent (but that is a long term decision, not aimed at solving your current problem right now).
Just to try, are you able to run an example script in the "test" directory
test_1D_seminormed.jl
@ctroupin with Pkg.pin("NetCDF_jll", version="v400.802.102")
I get this:
ERROR: type Context has no field version
Stacktrace:
[1] #Context!#37
@ /usr/share/julia/stdlib/v1.7/Pkg/src/Types.jl:457 [inlined]
[2] pin(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; all_pkgs::Bool, kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:version, :io), Tuple{String, Base.TTY}}})
@ Pkg.API /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:344
[3] pin(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, String, Tuple{Symbol}, NamedTuple{(:version,), Tuple{String}}})
@ Pkg.API /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:149
[4] #pin#63
@ /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:142 [inlined]
[5] #pin#62
@ /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:141 [inlined]
[6] top-level scope
@ REPL[45]:1
@jmbeckers, I cannot run the test script because when loading the package with using DIVAnd
I get the following:
julia> using DIVAnd
[ Info: Precompiling DIVAnd [efc8151c-67de-5a8f-9a35-d8f54746ae9d]
ERROR: LoadError: InitError: could not load library "/home/julian/.julia/artifacts/0a7f440ba143b238cc3dd0def2956d34d76755f3/lib/libnetcdf.so"
libmbedtls.so.13: cannot open shared object file: No such file or directory
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/JLLWrappers/QpMQW/src/products/library_generators.jl:54 [inlined]
[2] __init__()
@ NetCDF_jll ~/.julia/packages/NetCDF_jll/xjKDT/src/wrappers/x86_64-linux-gnu.jl:14
[3] top-level scope (repeats 2 times)
@ none:1
during initialization of module NetCDF_jll
in expression starting at /home/julian/.julia/packages/NCDatasets/4ceso/src/NCDatasets.jl:1
ERROR: LoadError: Failed to precompile NCDatasets [85f8d34a-cbdd-5861-8df4-14fed0d494ab] to /home/julian/.julia/compiled/v1.7/NCDatasets/jl_FebwSX.
Stacktrace:
[1] top-level scope (repeats 2 times)
@ none:1
in expression starting at /home/julian/.julia/packages/DIVAnd/Mbj6v/src/DIVAnd.jl:1
ERROR: Failed to precompile DIVAnd [efc8151c-67de-5a8f-9a35-d8f54746ae9d] to /home/julian/.julia/compiled/v1.7/DIVAnd/jl_QqIYhv.
Apologies if I am missing something obvious. I am rather new using Julia.
No need to apologize, there is a real problem here and unfortunately the precompilation does seem to require netCDF to be precompiled even if potentially it is not used.
I hope Charles can find the right netcdf library.
If not, maybe we can deactivate precompilation by adding precompile(false) into the DIVAnd module (but that would just be a dirty workaround if it actually works)
What worked on my machine was:
]
)(@v1.7) pkg> add https://github.com/JuliaBinaryWrappers/NetCDF_jll.jl
This installed me v400.802.103+0
.
I wonder if you use a Julia version that was shipped with Fedora ? If that is the case, maybe the problem is similar to
https://github.com/Alexander-Barth/NCDatasets.jl/issues/126
and in general it is advised to reinstall a Julia version from the official Julia download to make sure all libraries are compatible.
Thank you guys. After updating NetCDF_jll to version v400.802.103+0
DIVAnd passed all tests, and precompilation works with no problems.
Thanks for letting us know!
In case, you are using the julia version from Fedora, please note, as @jmbeckers pointed out, this issue:
https://alexander-barth.github.io/NCDatasets.jl/dev/issues/#Using-non-official-julia-builds
The release cycle of julia (and the build tree Yggdrasil providing NetCDF_jll) is not aligned with Fedora (or any other Linux distribution or homebrew). So it is rather by chance that NetCDF_jll v400.802.103+0
(and its dependencies) are compatible with the Fedora version that you use. But if it works, great to know! :-)
Hello,
After running the test I get the following.
Could you advice what to do? Many thanks,
Julian