Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precompile error on Julia 1.10 #36

Closed
cdsousa opened this issue Jan 2, 2024 · 9 comments
Closed

Precompile error on Julia 1.10 #36

cdsousa opened this issue Jan 2, 2024 · 9 comments

Comments

@cdsousa
Copy link

cdsousa commented Jan 2, 2024

I'm getting an error during precompilation when installing OpenCV.jl in a pristine environment with Julia 1.10
It happens equally in Linux/arm64, WSL/amd64 and Windows/amd64.
It seems somehow related to CxxWrap.

    Updating `~/Desktop/tmp/Project.toml`
  [f878e3a2] + OpenCV v4.5.3
    Updating `~/Desktop/tmp/Manifest.toml`
⌅ [1f15a43c] + CxxWrap v0.13.4
  [692b3bcd] + JLLWrappers v1.5.0
  [1914dd2f] + MacroTools v0.5.12
  [f878e3a2] + OpenCV v4.5.3
  [21216c6a] + Preferences v1.4.1
  [6e34b625] + Bzip2_jll v1.0.8+0
  [2702e6a9] + EpollShim_jll v0.0.20230411+0
  [2e619515] + Expat_jll v2.5.0+0
  [a3f928ae] + Fontconfig_jll v2.13.93+0
  [d7e528f0] + FreeType2_jll v2.13.1+0
  [78b55507] + Gettext_jll v0.21.0+0
  [7746bdde] + Glib_jll v2.76.5+0
⌅ [e9f186c6] + Libffi_jll v3.2.2+1
  [d4300ac3] + Libgcrypt_jll v1.8.7+0
  [7e76a0d4] + Libglvnd_jll v1.6.0+0
  [7add5ba3] + Libgpg_error_jll v1.42.0+0
  [94ce4f54] + Libiconv_jll v1.17.0+0
  [4b2f31a3] + Libmount_jll v2.35.0+0
  [38a345b3] + Libuuid_jll v2.36.0+0
  [33b9d88c] + OpenCV_jll v4.6.0+2
⌅ [458c3c95] + OpenSSL_jll v1.1.23+0
  [ea2cea3b] + Qt5Base_jll v5.15.3+2
  [a2964d1f] + Wayland_jll v1.21.0+1
  [2381bf8a] + Wayland_protocols_jll v1.31.0+0
  [02c8fc9c] + XML2_jll v2.12.2+0
  [aed1982a] + XSLT_jll v1.1.34+0
  [4f6342f7] + Xorg_libX11_jll v1.8.6+0
  [0c0b7dd1] + Xorg_libXau_jll v1.0.11+0
  [a3789734] + Xorg_libXdmcp_jll v1.1.4+0
  [1082639a] + Xorg_libXext_jll v1.3.4+4
  [14d82f49] + Xorg_libpthread_stubs_jll v0.1.1+0
  [c7cfdc94] + Xorg_libxcb_jll v1.15.0+0
  [cc61e674] + Xorg_libxkbfile_jll v1.1.2+0
  [12413925] + Xorg_xcb_util_image_jll v0.4.0+1
  [2def613f] + Xorg_xcb_util_jll v0.4.0+1
  [975044d2] + Xorg_xcb_util_keysyms_jll v0.4.0+1
  [0d47668e] + Xorg_xcb_util_renderutil_jll v0.3.9+1
  [c22f9ab0] + Xorg_xcb_util_wm_jll v0.4.1+1
  [35661453] + Xorg_xkbcomp_jll v1.4.6+0
  [33bec58e] + Xorg_xkeyboard_config_jll v2.39.0+0
  [c5fb5394] + Xorg_xtrans_jll v1.5.0+0
⌅ [3eaa8342] + libcxxwrap_julia_jll v0.9.7+3
  [d8fb68d0] + xkbcommon_jll v1.4.1+1
  [0dad84c5] + ArgTools v1.1.1
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching
  [b77e0a4c] + InteractiveUtils
  [b27032c2] + LibCURL v0.6.4
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.10.0
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll v1.0.5+1
  [deac9b47] + LibCURL_jll v8.4.0+0
  [e37daf67] + LibGit2_jll v1.6.4+0
  [29816b5a] + LibSSH2_jll v1.11.0+1
  [c8ffd9c3] + MbedTLS_jll v2.28.2+1
  [14a3606d] + MozillaCACerts_jll v2023.1.10
  [efcefdf7] + PCRE2_jll v10.42.0+1
  [83775a58] + Zlib_jll v1.2.13+1
  [8e850ede] + nghttp2_jll v1.52.0+1
  [3f19e933] + p7zip_jll v17.4.0+2
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
Precompiling project...
  ✗ CxxWrap
  ✗ OpenCV_jll
  ✗ OpenCV
  41 dependencies successfully precompiled in 35 seconds. 2 already precompiled.
  3 dependencies errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`
julia> err
PkgPrecompileError: The following 1 direct dependency failed to precompile:

OpenCV [f878e3a2-a245-4720-8660-60795d644f2a]

Failed to precompile OpenCV [f878e3a2-a245-4720-8660-60795d644f2a] to "/home/someuser/.julia/compiled/v1.10/OpenCV/jl_zfVQUQ".
ERROR: LoadError: InitError: could not load library "/home/someuser/.julia/artifacts/fafe9ce52b0f6569c8d86fbb62e9d285ca9f044f/lib/libcxxwrap_julia.so"
/home/someuser/.julia/artifacts/fafe9ce52b0f6569c8d86fbb62e9d285ca9f044f/lib/libcxxwrap_julia.so: undefined symbol: small_typeof, version JL_LIBJULIA_1.10
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__()
    @ libcxxwrap_julia_jll ~/.julia/packages/libcxxwrap_julia_jll/zmDeI/src/wrappers/aarch64-linux-gnu-cxx11-julia_version+1.10.0.jl:9
  [5] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1128
  [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1116
  [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1061
  [8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1575
  [9] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1932
 [10] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1806
 [11] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [12] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [13] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1797
 [14] macro expansion
    @ Base ./loading.jl:1784 [inlined]
 [15] macro expansion
    @ Base ./lock.jl:267 [inlined]
 [16] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1747
 [17] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [18] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [19] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1740
 [20] include(mod::Module, _path::String)
    @ Base ./Base.jl:495
 [21] top-level scope
    @ ~/.julia/packages/JLLWrappers/pG9bm/src/toplevel_generators.jl:192
 [22] include
    @ Base ./Base.jl:495 [inlined]
 [23] 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:2216
 [24] top-level scope
    @ stdin:3
during initialization of module libcxxwrap_julia_jll
in expression starting at /home/someuser/.julia/packages/OpenCV_jll/Hfsh1/src/wrappers/aarch64-linux-gnu-cxx11-julia_version+1.10.0.jl:6
in expression starting at /home/someuser/.julia/packages/OpenCV_jll/Hfsh1/src/OpenCV_jll.jl:2
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile OpenCV_jll [33b9d88c-85f9-5d73-bd91-4e2b95a9aa0b] to "/home/someuser/.julia/compiled/v1.10/OpenCV_jll/jl_e8uCB3".
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:2462
  [3] compilecache
    @ Base ./loading.jl:2334 [inlined]
  [4] (::Base.var"#968#969"{Base.PkgId})()
    @ Base ./loading.jl:1968
  [5] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile /home/someuser/.julia/juliaup/julia-1.10.0+0.aarch64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
  [6] #mkpidlock#6
    @ FileWatching.Pidfile /home/someuser/.julia/juliaup/julia-1.10.0+0.aarch64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
  [7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile /home/someuser/.julia/juliaup/julia-1.10.0+0.aarch64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
  [8] #invokelatest#2
    @ Base ./essentials.jl:889 [inlined]
  [9] invokelatest
    @ Base ./essentials.jl:884 [inlined]
 [10] maybe_cachefile_lock(f::Base.var"#968#969"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base ./loading.jl:2977
 [11] maybe_cachefile_lock
    @ Base ./loading.jl:2974 [inlined]
 [12] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1964
 [13] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1806
 [14] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [15] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [16] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1797
 [17] macro expansion
    @ Base ./loading.jl:1784 [inlined]
 [18] macro expansion
    @ Base ./lock.jl:267 [inlined]
 [19] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1747
 [20] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [21] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [22] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1740
 [23] include
    @ Base ./Base.jl:495 [inlined]
 [24] 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::Nothing)
    @ Base ./loading.jl:2216
 [25] top-level scope
    @ stdin:3
in expression starting at /home/someuser/.julia/packages/OpenCV/2FyNG/src/OpenCV.jl:1
in expression starting at stdin:

julia>
@cdsousa
Copy link
Author

cdsousa commented Jan 5, 2024

I'm trying to understand what the issue is and, as far as I understand, this may be solved with a recompilation of OpenCV_jll.
Is there anything I can do to try to solve this?

@timholy
Copy link
Member

timholy commented Jan 10, 2024

Maybe contact the folks at BinaryWrappers? https://github.com/JuliaBinaryWrappers

@cdsousa
Copy link
Author

cdsousa commented Jan 11, 2024

I forgot to say that in the released OpenCV.jl there are upgradable but held dependencies, especially CxxWrap and libcxxwrap_julia_jll :

(tmp) pkg> st 
Status `~/tmp/Project.toml`
  [f878e3a2] OpenCV v4.5.3
(tmp) pkg> st -m -o
Status `~/tmp/Manifest.toml`
⌅ [1f15a43c] CxxWrap v0.13.4 (<v0.14.2): OpenCV
⌅ [e9f186c6] Libffi_jll v3.2.2+1 (<v3.4.4+0): Glib_jll, Wayland_jll
⌅ [458c3c95] OpenSSL_jll v1.1.23+0 (<v3.0.12+0): Qt5Base_jll
⌅ [3eaa8342] libcxxwrap_julia_jll v0.9.7+3 (<v0.11.2+0): CxxWrap

So I had tried with #28, where those two dependencies get to the last version. However, the error is the same.

@cdsousa
Copy link
Author

cdsousa commented Jan 13, 2024

I can confirm that using a new build of OpenCV_jll.jl (JuliaPackaging/Yggdrasil#7941) and OpenCV.jl from #28 seems to fix the issue reported at #36, although it gives an error during precompilation:

  1 dependency had output during precompilation:
┌ OpenCV
│  ┌ Error: Calling `@wrapmodule` with the path of the library to load is no longer supported.
│  │ Pass the name of a function returning the path instead, e.g. use `libfoo_jll.get_libfoo_path` instead of `libfoo_jll.libfoo`.
│  └ @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/5IZvn/src/CxxWrap.jl:729

@dsryu0822
Copy link

Exactly same issue here. I tried downgrading to OpenCV@4.5.2 with julia v1.10 but failed, and there is no version under 4.5.2... One could test downgrading julia.

@cdsousa
Copy link
Author

cdsousa commented Feb 12, 2024

One could test downgrading julia.

Using Julia 1.9 has been working on my side. (I don't downgrade, but instead use juliaup to launch 1.9 when needed)

@likanzhan
Copy link

Is there an update to this problem, without downgrading Julia?

@linkret
Copy link

linkret commented Sep 27, 2024

I'm also having this issue on Windows and I don't know how to fix it. I can't precompile my system image because of it

@ViralBShah
Copy link
Contributor

Dup of #39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants