Closed sunayana closed 1 year ago
This kind of error can happen when mixing JLL binaries with self-compiled binaries. Do you still have the Overrides.toml
active for libcxxwrap-julia
when testing?
Thanks @barche, I had Overrides.toml
active so I removed it but still get the same error, these are my steps:
julia --project
from folder richdem/wrappers/RichDEM.jl
import Pkg
Pkg.instantiate()
using RichDEM
and get the following error:
julia> using RichDEM
[ Info: Precompiling RichDEM [94a1c18c-0d95-461b-994e-5c3447d2ff66]
C++ exception while wrapping module common: invalid subtyping in definition of Array2D with supertype AbstractArray
ERROR: LoadError: invalid subtyping in definition of Array2D with supertype AbstractArray
Stacktrace:
[1] register_julia_module
@ ~/.julia/packages/CxxWrap/25c5A/src/CxxWrap.jl:393 [inlined]
[2] readmodule(so_path::String, funcname::Symbol, m::Module, flags::UInt32)
@ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/25c5A/src/CxxWrap.jl:722
[3] wrapmodule(so_path::String, funcname::Symbol, m::Module, flags::UInt32)
@ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/25c5A/src/CxxWrap.jl:726
[4] include
@ ./Base.jl:419 [inlined]
[5] 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, UInt64}}, source::Nothing)
@ Base ./loading.jl:1554
in expression starting at /workspaces/richdem/wrappers/RichDEM.jl/src/RichDEM.jl:3
in expression starting at stdin:1
ERROR: Failed to precompile RichDEM [94a1c18c-0d95-461b-994e-5c3447d2ff66] to /root/.julia/compiled/v1.8/RichDEM/jl_r2JgbZ.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
@ Base ./loading.jl:1707
[3] compilecache
@ ./loading.jl:1651 [inlined]
[4] _require(pkg::Base.PkgId)
@ Base ./loading.jl:1337
[5] _require_prelocked(uuidkey::Base.PkgId)
@ Base ./loading.jl:1200
[6] macro expansion
@ ./loading.jl:1180 [inlined]
[7] macro expansion
@ ./lock.jl:223 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1144
The other thing is that this error will disappear if I copy the self build .so
libraries into the expected place:
/root/.julia/artifacts/b717953327b36aae1607d17f1f4a4c7b3cdfdb87/lib/
so not sure what I do wrong in build_tarballs.jl
file to generate the binaries correctly.
I just tried it myself on my Linux machine and I can reproduce your observations perfectly. No idea yet why this happens.
I think this may be because we need to build against the correct libjulia version now, I have created a new Yggdrasil PR at https://github.com/JuliaPackaging/Yggdrasil/pull/6152
Hopefully that will fix it.
Thanks a lot @barche for looking into this. I am keeping a close watch on the Yggdrasil build, I will test it out once the binaries are available.
From the GDAL_jll
page : https://github.com/JuliaBinaryWrappers/GDAL_jll.jl I see the supported platforms:
would something similar : https://github.com/JuliaPackaging/Yggdrasil/blob/master/G/GDAL/build_tarballs.jl#L97
be helpful in this case since GDAL is one of the dependencies.
Here is another PR I opened around GDAL related changes to build_tarballs.jl https://github.com/JuliaPackaging/Yggdrasil/pull/6154
Thanks for the comments. I think there is a lot of overlap between our PRs, so we should decide which one we want to go through. The libcurl error is related to the specific version of the library, which depends on the Julia version since it is a library that is bundled with Julia. I'll ask the Yggdrasil maintainers how to fix this, since I have no idea.
Would you be fine if I opened a PR in your branch, I would prefer to keep yours active. Thanks again for your help. Also if it helps at the moment I am fine with the build working for version 1.8.x of Julia.
Just to keep you informed, I closed my PR.
I invited you as collaborator to my Yggdrasil fork, so you should be able to edit the PR.
Thank you @barche . I have figured out why I am having the issue, it is because of the version of GDAL. It works fine in my local testing when I use GDAL version 3.2.2
. I am not sure what would be the corresponding GDAL_jll
version, I tried with v3.2.1
and it worked. I have opened a PR now with the pinned version : https://github.com/barche/Yggdrasil/pull/1
It seems to work mostly, see comment in the PR.
Thanks @barche . As per your comments I have added OpenMP LLVM package for mac and dropped armv6 from the list of platforms as it was the only one failing in the last commit. Here is the latest PR to your branch : https://github.com/barche/Yggdrasil/pull/2
I filtered out the remaining failing platforms. There are compile errors on Mac, library errors on FreeBSD and for the new M1 macs GDAL isn't built. Up to you if you want to try to fix all that or just disable the platforms, I can help if needed.
Thanks a lot @barche . I saw the errors too on Mac, I think some were because of stricter compiler checks in Mac. I already saw your changes for disabling those platforms. I am fine with that for the time being. Thanks again.
It all works at my end so I will go ahead and close this issue. Thank you.
Hello, I have been working on wrapping some C++ code using libcxxwrap-julia library. Here is the link to the C++ code: https://github.com/Cervest/richdem/tree/feature/sc-40452/add_richdem_jll/src The wrapper C++ code sits in : https://github.com/Cervest/richdem/tree/feature/sc-40452/add_richdem_jll/src/jlrichdem I was also able to deploy this on Yggdrasil and have RichDEM_jll.jl package My local development environment works absolutely fine using
@wrapmodule
calls like e.g.,@wrapmodule("/workspaces/richdem/build/lib/libjlrichdem.so", :define_julia_module, Libdl.RTLD_GLOBAL)
I have done this following the juliacon 2020 tutorial by @barche .Now I am at the stage when I change the
@wrapmodule
call to this:@wrapmodule(RichDEM_jll.libjlrichdem_path, :define_julia_module, Libdl.RTLD_GLOBAL)
see this file : https://github.com/Cervest/richdem/blob/feature/sc-40452/add_richdem_jll/wrappers/RichDEM.jl/src/RichDEM.jlBut get an error:
Pkg.add(PackageSpec(url="https://github.com/Cervest/richdem.git", subdir="wrappers/RichDEM.jl"))
Not sure whether this is somehow associated with the C++ compiler. But not sure how to debug this. Any help would be much appreciated. Thanks!