Open cmcaine opened 4 years ago
So, is it solved? I encounter the same problem in MacOs
Have the same problem in MacOS catalina with LLVM installed using homebrew (version stable 10.0.0 (bottled), HEAD [keg-only]
)
Here is the full error:
julia> using Cxx
[ Info: Precompiling Cxx [a0b5b9ef-44b7-5148-a2d1-f6db19f3c3d2]
ERROR: LoadError: LoadError: could not load library "/Users/storopoli/.julia/packages/Cxx/1RaOv/src/../deps/usr/lib/libcxxffi"
dlopen(/Users/storopoli/.julia/packages/Cxx/1RaOv/src/../deps/usr/lib/libcxxffi.dylib, 9): Symbol not found: __ZN4llvm11raw_ostream6handleEv
Referenced from: /Users/storopoli/.julia/packages/Cxx/1RaOv/src/../deps/usr/lib/libcxxffi.dylib
Expected in: /Applications/Julia-1.4.app/Contents/Resources/julia/lib/julia/libLLVM.dylib
in /Users/storopoli/.julia/packages/Cxx/1RaOv/src/../deps/usr/lib/libcxxffi.dylib
Stacktrace:
[1] dlopen(::String, ::UInt32; throw_error::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Libdl/src/Libdl.jl:109
[2] dlopen at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Libdl/src/Libdl.jl:109 [inlined]
[3] init_libcxxffi() at /Users/storopoli/.julia/packages/Cxx/1RaOv/src/initialization.jl:23
[4] top-level scope at /Users/storopoli/.julia/packages/Cxx/1RaOv/src/initialization.jl:25
[5] include(::Module, ::String) at ./Base.jl:377
[6] include(::String) at /Users/storopoli/.julia/packages/Cxx/1RaOv/src/Cxx.jl:144
[7] top-level scope at /Users/storopoli/.julia/packages/Cxx/1RaOv/src/Cxx.jl:170
[8] include(::Module, ::String) at ./Base.jl:377
[9] top-level scope at none:2
[10] eval at ./boot.jl:331 [inlined]
[11] eval(::Expr) at ./client.jl:449
[12] top-level scope at ./none:3
in expression starting at /Users/storopoli/.julia/packages/Cxx/1RaOv/src/initialization.jl:25
in expression starting at /Users/storopoli/.julia/packages/Cxx/1RaOv/src/Cxx.jl:170
ERROR: Failed to precompile Cxx [a0b5b9ef-44b7-5148-a2d1-f6db19f3c3d2] to /Users/storopoli/.julia/compiled/v1.4/Cxx/ESGkI_rPtlm.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1272
[3] _require(::Base.PkgId) at ./loading.jl:1029
[4] require(::Base.PkgId) at ./loading.jl:927
[5] require(::Module, ::Symbol) at ./loading.jl:922
julia> using Cxx [ Info: Precompiling Cxx [a0b5b9ef-44b7-5148-a2d1-f6db19f3c3d2] ERROR: LoadError: LoadError: could not load library "C:\Users\Sannan.julia\packages\Cxx\1RaOv\src..\deps\usr\bin\libcxxffi" The specified procedure could not be found. Stacktrace: [1] dlopen(::String, ::UInt32; throw_error::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Libdl\src\Libdl.jl:109 [2] dlopen at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Libdl\src\Libdl.jl:109 [inlined] [3] init_libcxxffi() at C:\Users\Sannan.julia\packages\Cxx\1RaOv\src\initialization.jl:23 [4] top-level scope at C:\Users\Sannan.julia\packages\Cxx\1RaOv\src\initialization.jl:25 [5] include(::Function, ::Module, ::String) at .\Base.jl:380 [6] include at .\Base.jl:368 [inlined] [7] include(::String) at C:\Users\Sannan.julia\packages\Cxx\1RaOv\src\Cxx.jl:144 [8] top-level scope at C:\Users\Sannan.julia\packages\Cxx\1RaOv\src\Cxx.jl:170 [9] include(::Function, ::Module, ::String) at .\Base.jl:380 [10] include(::Module, ::String) at .\Base.jl:368 [11] top-level scope at none:2 [12] eval at .\boot.jl:331 [inlined] [13] eval(::Expr) at .\client.jl:467 [14] top-level scope at .\none:3 in expression starting at C:\Users\Sannan.julia\packages\Cxx\1RaOv\src\initialization.jl:25 in expression starting at C:\Users\Sannan.julia\packages\Cxx\1RaOv\src\Cxx.jl:170 ERROR: Failed to precompile Cxx [a0b5b9ef-44b7-5148-a2d1-f6db19f3c3d2] to C:\Users\Sannan.julia\compiled\v1.5\Cxx\ESGkI_JHcjR.ji. Stacktrace: [1] error(::String) at .\error.jl:33 [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1290 [3] _require(::Base.PkgId) at .\loading.jl:1030 [4] require(::Base.PkgId) at .\loading.jl:928 [5] require(::Module, ::Symbol) at .\loading.jl:923
I use Julia 1.50 64-bit on Windows 10 64-bit
I am also experiencing this issue on Window 10 (Julia v1.5.1 running on a jupyter notebook).
It seems that the path to libcxxffi is being incorrectly calculated within initialization.jl
(see below).
@static if Sys.iswindows()
const libcxxffi = joinpath(@__DIR__, "..", "deps", "usr", "bin", "libcxxffi"*lib_suffix)
else
const libcxxffi = joinpath(@__DIR__, "..", "deps", "usr", "lib", "libcxxffi"*lib_suffix)
end
For me, this results in the following path: C:\Users\Jacob\.julia\packages\Cxx\1RaOv\src\..\deps\usr\bin\libcxxffi
. However, I have libcxxffi.dll
located within C:\Users\Jacob\.julia\packages\Cxx\1RaOv\deps\usr\bin\
. The difference being \src\..\
. This leads me to believe that for some reason, the 'up-one-directory' symbol isn't being interpreted on Windows.
I wrote some hacky code to try to fix this path (see below), however eve with this corrected libcxxffi
is still failing to load.
@static if Sys.iswindows()
last_directory_index = findlast(isequal('\\'), @__DIR__) - 1
rootpath = @__DIR__
rootpath = rootpath[1 : last_directory_index]
const libcxxffi = joinpath(rootpath, "deps", "usr", "bin", "libcxxffi"*lib_suffix)
else
const libcxxffi = joinpath(@__DIR__, "..", "deps", "usr", "lib", "libcxxffi"*lib_suffix)
end
For clarity sake, I've also uploaded an image of the error, and the folder. I assume the file format isn't important, but this also fails when appending ".dll" to the path.
No idea what could be going wrong, but I do wanna point out you can use normpath(...)
to remove the ..
in the path :) https://docs.julialang.org/en/v1/base/file/#Base.Filesystem.normpath
I tried the same thing you did (but with normpath()) in Windows 10 with Julia 1.6.0-beta1 but no luck:
julia> using Cxx
[ Info: Precompiling Cxx [a0b5b9ef-44b7-5148-a2d1-f6db19f3c3d2]
ERROR: LoadError: LoadError: could not load library "C:\Users\QuantumBits\.julia\dev\Cxx\deps\usr\bin\libcxxffi"
The specified procedure could not be found.
Stacktrace:
[1] dlopen(s::String, flags::UInt32; throw_error::Bool)
@ Base.Libc.Libdl .\libdl.jl:114
[2] dlopen
@ .\libdl.jl:114 [inlined]
[3] init_libcxxffi()
@ Cxx.CxxCore ~\.julia\dev\Cxx\src\initialization.jl:23
[4] top-level scope
@ ~\.julia\dev\Cxx\src\initialization.jl:25
[5] include(mod::Module, _path::String)
@ Base .\Base.jl:386
[6] include(x::String)
@ Cxx.CxxCore ~\.julia\dev\Cxx\src\Cxx.jl:144
[7] top-level scope
@ ~\.julia\dev\Cxx\src\Cxx.jl:170
[8] include
@ .\Base.jl:386 [inlined]
[9] 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:1209
[10] top-level scope
@ none:1
[11] eval
@ .\boot.jl:360 [inlined]
[12] eval(x::Expr)
@ Base.MainInclude .\client.jl:446
[13] top-level scope
@ none:1
in expression starting at C:\Users\QuantumBits\.julia\dev\Cxx\src\initialization.jl:25
in expression starting at C:\Users\QuantumBits\.julia\dev\Cxx\src\Cxx.jl:142
ERROR: Failed to precompile Cxx [a0b5b9ef-44b7-5148-a2d1-f6db19f3c3d2] to C:\Users\QuantumBits\.julia\compiled\v1.6\Cxx\jl_7ED7.tmp.
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:33
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
@ Base .\loading.jl:1356
[3] compilecache(pkg::Base.PkgId, path::String)
@ Base .\loading.jl:1302
[4] _require(pkg::Base.PkgId)
@ Base .\loading.jl:1017
[5] require(uuidkey::Base.PkgId)
@ Base .\loading.jl:910
[6] require(into::Module, mod::Symbol)
@ Base .\loading.jl:897
I stumbled upon the same problem in my windows machine with julia versions 1.8.5 and 1.10.1.
Following up on trying to diagnose the problem with libcxxffi, I used "DLL Export Viewer" on libcxxffi.dll and got the following output: nothing. It seems like no functions are being exported.
In contrast, running the "DLL Export viewer" on all other libraries in the same directory shows a list of exported functions. For instance, this is the output for libdl.dll
Until this bug is fixed, you will have to install julia 1.3.1. As pointed out in the README, Cxx works out of the box in this julia version.
I get different errors to #464, so I thought I'd make a new issue.
The first exception is:
LoadError: could not load library "C:\Users\Colin\.julia\packages\Cxx\bZSeY\src\..\deps\usr\bin\libcxxffi"
Tested on Cxx.jl 0.4.0 and master