JuliaInterop / CxxWrap.jl

Package to make C++ libraries available in Julia
Other
416 stars 67 forks source link

`.../libcxxwrap_julia.so: undefined symbol: small_typeof, version JL_LIBJULIA_1.10` #450

Open jmuchovej opened 1 month ago

jmuchovej commented 1 month ago

I trigger this specifically when trying to use VegaLite, which depends on OpenCV. I was originally using 1.10.0, but am now using 1.10.4 – I get the same errors there, that I'm reporting here.

I'm executing this in a Linux Dev Container on an M1 Macbook. Specifically, the base imagd I'm using is from Jupyter's Docker Stacks: quay.io/jupyer/datascience-notebook:2024-08-05 (previously it was the 2024-01-29 tag).

The main error I'm getting is (it repeats multiple times in the "Full Error" section below because I triggered it by attempting to precompile OpenCV. I'm unable to precompile CxxWrap OpenCV OpenCV_jll – which all trigger this error.

Not sure if this is helpful to know – but, I'm typically in a conda environment when running Julia, though Julia was installed by downloading the binary (vs using juliaup). Deactivating conda entirely doesn't appear to fix anything, though.

ERROR: LoadError: InitError: could not load library "/opt/julia/artifacts/fafe9ce52b0f6569c8d86fbb62e9d285ca9f044f/lib/libcxxwrap_julia.so"
/opt/julia/artifacts/fafe9ce52b0f6569c8d86fbb62e9d285ca9f044f/lib/libcxxwrap_julia.so: undefined symbol: small_typeof, version JL_LIBJULIA_1.10
Full Error ```julia pkg> precompile OpenCV Precompiling OpenCV Info Given OpenCV was explicitly requested, output will be shown live ERROR: LoadError: InitError: could not load library "/opt/julia/artifacts/fafe9ce52b0f6569c8d86fbb62e9d285ca9f044f/lib/libcxxwrap_julia.so" /opt/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 @ /opt/julia/packages/JLLWrappers/pG9bm/src/products/library_generators.jl:63 [inlined] [4] __init__() @ libcxxwrap_julia_jll /opt/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:1134 [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String) @ Base ./loading.jl:1122 [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any}) @ Base ./loading.jl:1067 [8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128) @ Base ./loading.jl:1581 [9] _require(pkg::Base.PkgId, env::String) @ Base ./loading.jl:1938 [10] __require_prelocked(uuidkey::Base.PkgId, env::String) @ Base ./loading.jl:1812 [11] #invoke_in_world#3 @ ./essentials.jl:926 [inlined] [12] invoke_in_world @ ./essentials.jl:923 [inlined] [13] _require_prelocked(uuidkey::Base.PkgId, env::String) @ Base ./loading.jl:1803 [14] macro expansion @ ./loading.jl:1790 [inlined] [15] macro expansion @ ./lock.jl:267 [inlined] [16] __require(into::Module, mod::Symbol) @ Base ./loading.jl:1753 [17] #invoke_in_world#3 @ ./essentials.jl:926 [inlined] [18] invoke_in_world @ ./essentials.jl:923 [inlined] [19] require(into::Module, mod::Symbol) @ Base ./loading.jl:1746 [20] include(mod::Module, _path::String) @ Base ./Base.jl:495 [21] top-level scope @ /opt/julia/packages/JLLWrappers/pG9bm/src/toplevel_generators.jl:192 [22] include @ ./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:2222 [24] top-level scope @ stdin:3 during initialization of module libcxxwrap_julia_jll in expression starting at /opt/julia/packages/OpenCV_jll/Hfsh1/src/wrappers/aarch64-linux-gnu-cxx11-julia_version+1.10.0.jl:6 in expression starting at /opt/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 "/opt/julia/compiled/v1.10/OpenCV_jll/jl_IbYvhS". 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:2468 [3] compilecache @ ./loading.jl:2340 [inlined] [4] (::Base.var"#968#969"{Base.PkgId})() @ Base ./loading.jl:1974 [5] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool}) @ FileWatching.Pidfile /opt/julia-1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93 [6] #mkpidlock#6 @ /opt/julia-1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined] [7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64}) @ FileWatching.Pidfile /opt/julia-1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111 [8] #invokelatest#2 @ ./essentials.jl:894 [inlined] [9] invokelatest @ ./essentials.jl:889 [inlined] [10] maybe_cachefile_lock(f::Base.var"#968#969"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64) @ Base ./loading.jl:2983 [11] maybe_cachefile_lock @ ./loading.jl:2980 [inlined] [12] _require(pkg::Base.PkgId, env::String) @ Base ./loading.jl:1970 [13] __require_prelocked(uuidkey::Base.PkgId, env::String) @ Base ./loading.jl:1812 [14] #invoke_in_world#3 @ ./essentials.jl:926 [inlined] [15] invoke_in_world @ ./essentials.jl:923 [inlined] [16] _require_prelocked(uuidkey::Base.PkgId, env::String) @ Base ./loading.jl:1803 [17] macro expansion @ ./loading.jl:1790 [inlined] [18] macro expansion @ ./lock.jl:267 [inlined] [19] __require(into::Module, mod::Symbol) @ Base ./loading.jl:1753 [20] #invoke_in_world#3 @ ./essentials.jl:926 [inlined] [21] invoke_in_world @ ./essentials.jl:923 [inlined] [22] require(into::Module, mod::Symbol) @ Base ./loading.jl:1746 [23] include @ ./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:2222 [25] top-level scope @ stdin:3 in expression starting at /opt/julia/packages/OpenCV/2FyNG/src/OpenCV.jl:1 in expression starting at stdin:3 ✗ CxxWrap ✗ OpenCV_jll ✗ OpenCV 0 dependencies successfully precompiled in 7 seconds. 43 already precompiled. ERROR: The following 3 direct dependencies failed to precompile: OpenCV [f878e3a2-a245-4720-8660-60795d644f2a] Failed to precompile OpenCV [f878e3a2-a245-4720-8660-60795d644f2a] to "/opt/julia/compiled/v1.10/OpenCV/jl_WJ9BZK". ERROR: LoadError: InitError: could not load library "/opt/julia/artifacts/fafe9ce52b0f6569c8d86fbb62e9d285ca9f044f/lib/libcxxwrap_julia.so" /opt/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 @ /opt/julia/packages/JLLWrappers/pG9bm/src/products/library_generators.jl:63 [inlined] [4] __init__() @ libcxxwrap_julia_jll /opt/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:1134 [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String) @ Base ./loading.jl:1122 [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any}) @ Base ./loading.jl:1067 [8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128) @ Base ./loading.jl:1581 [9] _require(pkg::Base.PkgId, env::String) @ Base ./loading.jl:1938 [10] __require_prelocked(uuidkey::Base.PkgId, env::String) @ Base ./loading.jl:1812 [11] #invoke_in_world#3 @ ./essentials.jl:926 [inlined] [12] invoke_in_world @ ./essentials.jl:923 [inlined] [13] _require_prelocked(uuidkey::Base.PkgId, env::String) @ Base ./loading.jl:1803 [14] macro expansion @ ./loading.jl:1790 [inlined] [15] macro expansion @ ./lock.jl:267 [inlined] [16] __require(into::Module, mod::Symbol) @ Base ./loading.jl:1753 [17] #invoke_in_world#3 @ ./essentials.jl:926 [inlined] [18] invoke_in_world @ ./essentials.jl:923 [inlined] [19] require(into::Module, mod::Symbol) @ Base ./loading.jl:1746 [20] include(mod::Module, _path::String) @ Base ./Base.jl:495 [21] top-level scope @ /opt/julia/packages/JLLWrappers/pG9bm/src/toplevel_generators.jl:192 [22] include @ ./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:2222 [24] top-level scope @ stdin:3 during initialization of module libcxxwrap_julia_jll in expression starting at /opt/julia/packages/OpenCV_jll/Hfsh1/src/wrappers/aarch64-linux-gnu-cxx11-julia_version+1.10.0.jl:6 in expression starting at /opt/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 "/opt/julia/compiled/v1.10/OpenCV_jll/jl_IbYvhS". 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:2468 [3] compilecache @ ./loading.jl:2340 [inlined] [4] (::Base.var"#968#969"{Base.PkgId})() @ Base ./loading.jl:1974 [5] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool}) @ FileWatching.Pidfile /opt/julia-1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93 [6] #mkpidlock#6 @ /opt/julia-1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined] [7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64}) @ FileWatching.Pidfile /opt/julia-1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111 [8] #invokelatest#2 @ ./essentials.jl:894 [inlined] [9] invokelatest @ ./essentials.jl:889 [inlined] [10] maybe_cachefile_lock(f::Base.var"#968#969"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64) @ Base ./loading.jl:2983 [11] maybe_cachefile_lock @ ./loading.jl:2980 [inlined] [12] _require(pkg::Base.PkgId, env::String) @ Base ./loading.jl:1970 [13] __require_prelocked(uuidkey::Base.PkgId, env::String) @ Base ./loading.jl:1812 [14] #invoke_in_world#3 @ ./essentials.jl:926 [inlined] [15] invoke_in_world @ ./essentials.jl:923 [inlined] [16] _require_prelocked(uuidkey::Base.PkgId, env::String) @ Base ./loading.jl:1803 [17] macro expansion @ ./loading.jl:1790 [inlined] [18] macro expansion @ ./lock.jl:267 [inlined] [19] __require(into::Module, mod::Symbol) @ Base ./loading.jl:1753 [20] #invoke_in_world#3 @ ./essentials.jl:926 [inlined] [21] invoke_in_world @ ./essentials.jl:923 [inlined] [22] require(into::Module, mod::Symbol) @ Base ./loading.jl:1746 [23] include @ ./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:2222 [25] top-level scope @ stdin:3 in expression starting at /opt/julia/packages/OpenCV/2FyNG/src/OpenCV.jl:1 in expression starting at stdin:3 OpenCV_jll [33b9d88c-85f9-5d73-bd91-4e2b95a9aa0b] Failed to precompile OpenCV_jll [33b9d88c-85f9-5d73-bd91-4e2b95a9aa0b] to "/opt/julia/compiled/v1.10/OpenCV_jll/jl_cAB6m6". ERROR: LoadError: InitError: could not load library "/opt/julia/artifacts/fafe9ce52b0f6569c8d86fbb62e9d285ca9f044f/lib/libcxxwrap_julia.so" /opt/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 @ /opt/julia/packages/JLLWrappers/pG9bm/src/products/library_generators.jl:63 [inlined] [4] __init__() @ libcxxwrap_julia_jll /opt/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:1134 [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String) @ Base ./loading.jl:1122 [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any}) @ Base ./loading.jl:1067 [8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128) @ Base ./loading.jl:1581 [9] _require(pkg::Base.PkgId, env::String) @ Base ./loading.jl:1938 [10] __require_prelocked(uuidkey::Base.PkgId, env::String) @ Base ./loading.jl:1812 [11] #invoke_in_world#3 @ ./essentials.jl:926 [inlined] [12] invoke_in_world @ ./essentials.jl:923 [inlined] [13] _require_prelocked(uuidkey::Base.PkgId, env::String) @ Base ./loading.jl:1803 [14] macro expansion @ ./loading.jl:1790 [inlined] [15] macro expansion @ ./lock.jl:267 [inlined] [16] __require(into::Module, mod::Symbol) @ Base ./loading.jl:1753 [17] #invoke_in_world#3 @ ./essentials.jl:926 [inlined] [18] invoke_in_world @ ./essentials.jl:923 [inlined] [19] require(into::Module, mod::Symbol) @ Base ./loading.jl:1746 [20] include(mod::Module, _path::String) @ Base ./Base.jl:495 [21] top-level scope @ /opt/julia/packages/JLLWrappers/pG9bm/src/toplevel_generators.jl:192 [22] include @ ./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::Nothing) @ Base ./loading.jl:2222 [24] top-level scope @ stdin:3 during initialization of module libcxxwrap_julia_jll in expression starting at /opt/julia/packages/OpenCV_jll/Hfsh1/src/wrappers/aarch64-linux-gnu-cxx11-julia_version+1.10.0.jl:6 in expression starting at /opt/julia/packages/OpenCV_jll/Hfsh1/src/OpenCV_jll.jl:2 in expression starting at stdin:3 CxxWrap [1f15a43c-97ca-5a2a-ae31-89f07a497df4] Failed to precompile CxxWrap [1f15a43c-97ca-5a2a-ae31-89f07a497df4] to "/opt/julia/compiled/v1.10/CxxWrap/jl_Wsjmbg". ERROR: LoadError: InitError: could not load library "/opt/julia/artifacts/fafe9ce52b0f6569c8d86fbb62e9d285ca9f044f/lib/libcxxwrap_julia.so" /opt/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 @ /opt/julia/packages/JLLWrappers/pG9bm/src/products/library_generators.jl:63 [inlined] [4] __init__() @ libcxxwrap_julia_jll /opt/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:1134 [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String) @ Base ./loading.jl:1122 [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any}) @ Base ./loading.jl:1067 [8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128) @ Base ./loading.jl:1581 [9] _require(pkg::Base.PkgId, env::String) @ Base ./loading.jl:1938 [10] __require_prelocked(uuidkey::Base.PkgId, env::String) @ Base ./loading.jl:1812 [11] #invoke_in_world#3 @ ./essentials.jl:926 [inlined] [12] invoke_in_world @ ./essentials.jl:923 [inlined] [13] _require_prelocked(uuidkey::Base.PkgId, env::String) @ Base ./loading.jl:1803 [14] macro expansion @ ./loading.jl:1790 [inlined] [15] macro expansion @ ./lock.jl:267 [inlined] [16] __require(into::Module, mod::Symbol) @ Base ./loading.jl:1753 [17] #invoke_in_world#3 @ ./essentials.jl:926 [inlined] [18] invoke_in_world @ ./essentials.jl:923 [inlined] [19] require(into::Module, mod::Symbol) @ Base ./loading.jl:1746 [20] include @ ./Base.jl:495 [inlined] [21] 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:2222 [22] top-level scope @ stdin:3 during initialization of module libcxxwrap_julia_jll in expression starting at /opt/julia/packages/CxxWrap/aXNBY/src/CxxWrap.jl:1 in expression starting at stdin:3 ```
versioninfo ```julia julia> versioninfo() Julia Version 1.10.4 Commit 48d4fd48430 (2024-06-04 10:41 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: Linux (aarch64-linux-gnu) CPU: 10 × unknown WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-15.0.7 (ORCJIT, generic) Threads: 10 default, 0 interactive, 5 GC (on 10 virtual cores) Environment: JULIA_PROJECT = /project JULIA_CONDAPKG_BACKEND = Current JULIA_DEPOT_PATH = /opt/julia JULIA_NUM_THREADS = auto JULIA_PKGDIR = /opt/julia ```
/etc/os-release ```shell $ cat /etc/os-release PRETTY_NAME="Ubuntu 22.04.4 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.4 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy ```

I wasn't sure whether to report here on on libcxxwrap-julia. 😅

MendeBadra commented 4 weeks ago

Yup I can't use Opencv in julia because of this exact error.

barche commented 4 weeks ago

This is an OpenCV bug, the fix is to rebuild OpenCV_jll, there are some pointers here if someone wants to take a stab: https://github.com/JuliaPackaging/Yggdrasil/pull/8820#issuecomment-2144044576