JuliaInterop / Cxx.jl

The Julia C++ Interface
Other
755 stars 107 forks source link

[Julia 1.4.3] when building, find a error occured by libllvm #477

Open nesteiner opened 4 years ago

nesteiner commented 4 years ago
(v1.4) pkg> build Cxx
   Building Cxx → `~/.julia/packages/Cxx/1RaOv/deps/build.log`
┌ Error: Error building `Cxx`: 
│ ERROR: LoadError: could not load library "libLLVM-8.0.1"
│ libLLVM-8.0.1.so:  Unable to open shared object file: No file or directory
│ Stacktrace:
│  [1] dlopen(::String, ::UInt32; throw_error::Bool) at /home/steiner/disk/disk1/Download/images/julia-1.4.2/usr/share/julia/stdlib/v1.4/Libdl/src/Libdl.jl:109
│  [2] dlopen at /home/steiner/disk/disk1/Download/images/julia-1.4.2/usr/share/julia/stdlib/v1.4/Libdl/src/Libdl.jl:109 [inlined] (repeats 2 times)
│  [3] dlpath(::String) at /home/steiner/disk/disk1/Download/images/julia-1.4.2/usr/share/julia/stdlib/v1.4/Libdl/src/Libdl.jl:232
│  [4] top-level scope at /home/steiner/.julia/packages/Cxx/1RaOv/deps/build.jl:23
│  [5] include(::String) at ./client.jl:439
│  [6] top-level scope at none:5
│ in expression starting at /home/steiner/.julia/packages/Cxx/1RaOv/deps/build.jl:23
│ writing path.jl file
│ Tuning for julia installation at /home/steiner/julia-1.4.2/bin with sources possibly at /home/steiner/
└ @ Pkg.Operations ~/disk/disk1/Download/images/julia-1.4.2/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:899
nesteiner commented 4 years ago

by the way, it's useless after install some package about libllvm

a-r-n-o-l-d commented 4 years ago

I have the same problem. I think maybe the problem come from that linux is not take into account in builds.jl at line 20 : it looks for a shared library "libLLVM-8.0.1", but the file name is actually "libLLVM.so" in /opt/julia-1.4.2/lib/julia/.

Source of builds.jl :

# try to autodetect C++ ABI in use
llvm_path = Sys.iswindows() ? "LLVM" :
            Sys.isapple() ? "libLLVM" : "libLLVM-$(Base.libllvm_version)"
llvm_lib_path = Libdl.dlpath(llvm_path)
old_cxx_abi = findfirst("_ZN4llvm3sys16getProcessTripleEv", String(open(read, llvm_lib_path))) !== nothing
old_cxx_abi && (ENV["OLD_CXX_ABI"] = "1")
Gnimuc commented 4 years ago

https://github.com/JuliaInterop/Cxx.jl/issues/464#issuecomment-622226826