CxxWrap.jl
CxxWrap.jl copied to clipboard
Can't run from master, `libcxxwrap_julia_path not defined`
Hi. I have a project based on CxxWrap, a library I need to install in many different machines. I always could get away with installing CxxWrap and libcxxwrap from the repos. This time I'm hitting an issue I just can't figure out. Every package seems to be installed fine, and I can compile everything. Yet, when I try using CxxWrap
I'm getting this error message.
https://github.com/JuliaInterop/CxxWrap.jl/blob/7ceaed583f7628348efaf27d55d44e978e2b1618/src/CxxWrap.jl#L17
I cannot find anywhere in libcxxwrap where that attribute could ever be defined. Is this something missing in my build process perhaps?
What is the error message you get, then? You don't say, please copy & paste it here. You do reference a line in the code, though; perhaps you are saying that the error is in that line?
Perhaps it says that libcxxwrap_julia_path
is not defined? Well, that is generated in the JLL by some macro magic (from JLLWrappers.jl
).
Why exactly are you install CxxWrap "from this repo" and not simply via the Julia package manager?
I get the message in the line below, "libcxxwrap_julia_jll not available on this platform".
I'm not trying to do anything fancy, I would be happy I could get things working just doing "add/using CxxWrap". I always struggle to figure out exactly how to proceed, and I didn't manage to learn how to use BinaryBuilder yet... At some point I manage to find matching versions that work for me. I just hope reporting issues I meet in the way may help somehow...
Considering that is the error message: what platform are you working on?
Could you please post the output of the Julia command versioninfo()
?
here it is
julia> versioninfo()
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
JULIA_NUM_THREADS = 6
@barche I think this can be closed whatever issue there was, it was 1.5 years ago... if @nlw0 still is interested in a solution, they can either reopen or refile (sorry for not getting back to you back then, but I never noticed this comment :-(
I never figured out a handy way to make it work, but I'm not working on this project anymore... I'm still curious to know what's the best way to use CxxWrap, maybe later I can hake another look. Feel free to close.
Weird.
Hmm, I notice we also never asked you for the CxxWrap version you used, etc. All I can say is: lots of packages use CxxWrap without running into this fatal error, so I would carefully double check your setup if I were you, and e.g. make sure that it's really the latest CxxWrap being used (so it is not being held back by some pinned version somewhere).
@nlw0 I have never seen this, if you can provide an example on how to reproduce this I'd be happy to look into it.
I actually got the same error right now when I'm trying to install the Alligator.jl package : https://github.com/ahumenberger/Aligator.jl
@jiawenliu details then,please:
- output of
versioninfo()
- Which version of CxxWrap?
- Copy and paste the input & output (including the full error message) from your terminal
julia> versioninfo()
Julia Version 1.9.0-DEV.1363
Commit c6abccf2c3 (2022-09-14 19:40 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin21.5.0)
CPU: 8 × Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.5 (ORCJIT, skylake)
Threads: 1 on 8 virtual cores
CxxWrap
ERROR: UndefVarError: CxxWrap not defined
julia> using CxxWrap
[ Info: Precompiling CxxWrap [1f15a43c-97ca-5a2a-ae31-89f07a497df4]
ERROR: LoadError: libcxxwrap_julia_jll not available on this platform
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] top-level scope
@ ~/.julia/packages/CxxWrap/OcN1Z/src/CxxWrap.jl:18
[3] include
@ ./Base.jl:439 [inlined]
[4] 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:1651
[5] top-level scope
@ stdin:1
in expression starting at /Users/admin/.julia/packages/CxxWrap/OcN1Z/src/CxxWrap.jl:1
in expression starting at stdin:1
ERROR: Failed to precompile CxxWrap [1f15a43c-97ca-5a2a-ae31-89f07a497df4] to /Users/admin/.julia/compiled/v1.9/CxxWrap/jl_XMyQer.
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:1802
[3] compilecache
@ ./loading.jl:1746 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1434
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1298
[6] macro expansion
@ ./loading.jl:1278 [inlined]
[7] macro expansion
@ ./lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1241
Complete output:
ERROR: LoadError: InitError: could not load library "/Users/admin/.julia/artifacts/ba184dbd5af604b5d47b8b71e83efbf3bba4317d/lib/libsingular_julia.dylib"
dlopen(/Users/admin/.julia/artifacts/ba184dbd5af604b5d47b8b71e83efbf3bba4317d/lib/libsingular_julia.dylib, 0x0001): Library not loaded: @rpath/libcxxwrap_julia.0.dylib
Referenced from: /Users/admin/.julia/artifacts/ba184dbd5af604b5d47b8b71e83efbf3bba4317d/lib/libsingular_julia.dylib
Reason: tried: '/workspace/destdir/lib/libcxxwrap_julia.0.dylib' (no such file), '/workspace/destdir/lib/libcxxwrap_julia.0.dylib' (no such file), '/Users/admin/.julia/artifacts/ba184dbd5af604b5d47b8b71e83efbf3bba4317d/lib/./libcxxwrap_julia.0.dylib' (no such file), '/workspace/destdir/lib/libcxxwrap_julia.0.dylib' (no such file), '/workspace/destdir/lib/libcxxwrap_julia.0.dylib' (no such file), '/Users/admin/.julia/artifacts/ba184dbd5af604b5d47b8b71e83efbf3bba4317d/lib/./libcxxwrap_julia.0.dylib' (no such file), '/Users/admin/JiawenLiu/Applications/Julia/julia/usr/lib/libcxxwrap_julia.0.dylib' (no such file), '/Users/admin/JiawenLiu/Applications/Julia/julia/usr/bin/../lib/libcxxwrap_julia.0.dylib' (no such file), '/usr/local/lib/libcxxwrap_julia.0.dylib' (no such file), '/usr/lib/libcxxwrap_julia.0.dylib' (no such file)
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/QpMQW/src/products/library_generators.jl:54 [inlined]
[4] __init__()
@ libsingular_julia_jll ~/.julia/packages/libsingular_julia_jll/ZkM5t/src/wrappers/x86_64-apple-darwin.jl:10
[5] _include_from_serialized(pkg::Base.PkgId, path::String, depmods::Vector{Any})
@ Base ./loading.jl:928
[6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
@ Base ./loading.jl:1136
[7] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1412
[8] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1298
[9] macro expansion
@ ./loading.jl:1278 [inlined]
[10] macro expansion
@ ./lock.jl:267 [inlined]
[11] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1241
[12] include
@ ./Base.jl:439 [inlined]
[13] 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::String)
@ Base ./loading.jl:1651
[14] top-level scope
@ stdin:1
during initialization of module libsingular_julia_jll
in expression starting at /Users/admin/.julia/packages/Singular/FXMTj/src/Singular.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile Singular [bcd08a7b-43d2-5ff7-b6d4-c458787f915c] to /Users/admin/.julia/compiled/v1.9/Singular/jl_Wd3bCq.
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:1802
[3] compilecache
@ ./loading.jl:1746 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1434
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1298
[6] macro expansion
@ ./loading.jl:1278 [inlined]
[7] macro expansion
@ ./lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1241
[9] include
@ ./Base.jl:439 [inlined]
[10] 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::String)
@ Base ./loading.jl:1651
[11] top-level scope
@ stdin:1
in expression starting at /Users/admin/.julia/packages/AlgebraicDependencies/IlvjI/src/AlgebraicDependencies.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile AlgebraicDependencies [df504336-4c6f-11e9-304d-b3facd222262] to /Users/admin/.julia/compiled/v1.9/AlgebraicDependencies/jl_wmA6ji.
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:1802
[3] compilecache
@ ./loading.jl:1746 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1434
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1298
[6] macro expansion
@ ./loading.jl:1278 [inlined]
[7] macro expansion
@ ./lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1241
[9] include
@ ./Base.jl:439 [inlined]
[10] 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:1651
[11] top-level scope
@ stdin:1
in expression starting at /Users/admin/.julia/packages/Aligator/sfQHE/src/Aligator.jl:1
in expression starting at stdin:1
ERROR: Failed to precompile Aligator [5ed869e0-1a60-11e9-29ae-17f02fe22408] to /Users/admin/.julia/compiled/v1.9/Aligator/jl_0HcrEH.
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:1802
[3] compilecache
@ ./loading.jl:1746 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1434
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1298
[6] macro expansion
@ ./loading.jl:1278 [inlined]
[7] macro expansion
@ ./lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1241
You can solve this by using a released Julia version, not a development snapshot
You can solve this by using a released Julia version, not a development snapshot
Or build libcxxwrap-julia
from source and set up an Overrides.toml
file if using 1.9 is essential.
Close this then?
Hi fingolfin
I had the same issue and tried to follow the instructions at https://github.com/JuliaInterop/libcxxwrap-julia to build libcxxwrap-julia from source with an Overrides.toml. I managed to build the library from the source and set up the Overrides.toml file in the ~/.julia/artifacts. When I try to use import CxxWrap in julia 1.9, I received the followings:
[ Info: Precompiling CxxWrap [1f15a43c-97ca-5a2a-ae31-89f07a497df4] ERROR: LoadError: libcxxwrap_julia_jll not available on this platform Stacktrace: [1] error(s::String) @ Base ./error.jl:35 [2] top-level scope @ ~/.julia/packages/CxxWrap/OcN1Z/src/CxxWrap.jl:18 [3] include @ ./Base.jl:457 [inlined] [4] 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:2010 [5] top-level scope @ stdin:2 in expression starting at /home/zhus/.julia/packages/CxxWrap/OcN1Z/src/CxxWrap.jl:1 in expression starting at stdin:2 ERROR: Failed to precompile CxxWrap [1f15a43c-97ca-5a2a-ae31-89f07a497df4] to "/home/zhus/.julia/compiled/v1.9/CxxWrap/jl_QAc9pA". 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:2260 [3] compilecache @ ./loading.jl:2127 [inlined] [4] _require(pkg::Base.PkgId, env::String) @ Base ./loading.jl:1770 [5] _require_prelocked(uuidkey::Base.PkgId, env::String) @ Base ./loading.jl:1625 [6] macro expansion @ ./loading.jl:1613 [inlined] [7] macro expansion @ ./lock.jl:267 [inlined] [8] require(into::Module, mod::Symbol) @ Base ./loading.jl:1576
I am not sure what went wrong, any suggestions will be greatly appreciated.
Jie
Not sure why this happens. One thing to try would be to dev the JLL (develop libcxxwrap_julia_jll
in PKG mode) and then call libcxxwrap_julia_jll.dev_jll()
and copy the library files to the overrides dir in the libcxxwrap_julia_jll
override directory.
Hi Barche,
Would you be able to give some specific instructions as I not 100% sure about how to proceed with "dev the JLL (develop libcxxwrap_julia_jll in PKG mode) and then call libcxxwrap_julia_jll.dev_jll()".
For the second half of your suggestion on "copy the library files to the overrides dir in the libcxxwrap_julia_jll override directory", just simply copy the libcxxwrap_julia_jll.dev_jll() to the override directory?
Thank you. Shuang
Hi, I have updated the README with more detailed instructions here: https://github.com/JuliaInterop/libcxxwrap-julia#preparing-the-install-location
Thank you Bart