gher-uliege / DIVAnd.jl

DIVAnd performs an n-dimensional variational analysis of arbitrarily located observations
GNU General Public License v2.0
70 stars 11 forks source link

Failed test #104

Closed jmburgos closed 2 years ago

jmburgos commented 2 years ago

Hello,

After running the test I get the following.

 0 dependencies successfully precompiled in 5 seconds (58 already precompiled)
  2 dependencies errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the packages
     Testing Running tests...
ERROR: LoadError: InitError: could not load library "/home/julian/.julia/artifacts/a990d3d23ca4ca4c1fcd1e42fc198f1272f7c49b/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/2PbeF/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/c8XyT/src/NCDatasets.jl:1
ERROR: LoadError: Failed to precompile NCDatasets [85f8d34a-cbdd-5861-8df4-14fed0d494ab] to /home/julian/.julia/compiled/v1.7/NCDatasets/jl_eaLAF1.
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: LoadError: Failed to precompile DIVAnd [efc8151c-67de-5a8f-9a35-d8f54746ae9d] to /home/julian/.julia/compiled/v1.7/DIVAnd/jl_VS2VTt.
Stacktrace:
 [1] include(fname::String)
   @ Base.MainInclude ./client.jl:451
 [2] top-level scope
   @ none:6
in expression starting at /home/julian/.julia/packages/DIVAnd/Mbj6v/test/runtests.jl:1
ERROR: Package DIVAnd errored during testing
Stacktrace:
 [1] test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage::Bool, julia_args::Cmd, test_args::Cmd, test_fn::Nothing, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)
   @ Pkg.Operations /usr/share/julia/stdlib/v1.7/Pkg/src/Operations.jl:1672
 [2] test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage::Bool, test_fn::Nothing, julia_args::Cmd, test_args::Cmd, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
   @ Pkg.API /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:421
 [3] test(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:149
 [4] test(pkgs::Vector{Pkg.Types.PackageSpec})
   @ Pkg.API /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:144
 [5] #test#87
   @ /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:142 [inlined]
 [6] test
   @ /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:142 [inlined]
 [7] #test#86
   @ /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:141 [inlined]
 [8] test(pkg::String)
   @ Pkg.API /usr/share/julia/stdlib/v1.7/Pkg/src/API.jl:141
 [9] top-level scope
   @ none:1

Could you advice what to do? Many thanks,

Julian

ctroupin commented 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
jmburgos commented 2 years ago

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.

jmburgos commented 2 years ago

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
ctroupin commented 2 years ago

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.

jmbeckers commented 2 years ago

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

jmburgos commented 2 years ago

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.

ctroupin commented 2 years ago

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")
jmbeckers commented 2 years ago

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

jmburgos commented 2 years ago

@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 DIVAndI 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.

jmbeckers commented 2 years ago

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)

ctroupin commented 2 years ago

What worked on my machine was:

  1. Enter the package mode (type ])
  2. Run
    (@v1.7) pkg> add https://github.com/JuliaBinaryWrappers/NetCDF_jll.jl

    This installed me v400.802.103+0.

jmbeckers commented 2 years ago

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.

jmburgos commented 2 years ago

Thank you guys. After updating NetCDF_jll to version v400.802.103+0 DIVAnd passed all tests, and precompilation works with no problems.

ctroupin commented 2 years ago

Thanks for letting us know!

Alexander-Barth commented 2 years ago

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! :-)