Issue geting started with Clang.jl

americast
Sat, 25 Feb 2017 18:52:19 +0000
New to Julia

Hi,
I was trying to follow the example given in http://nbviewer.jupyter.org/github/ihnorton/Clang.jl/blob/master/examples/parsing_c_with_clangjl/notebook.ipynb to get an idea of the working of Clang.jl. But I got the following error:

julia> using Clang.cindex
WARNING: symbol is deprecated, use Symbol instead.
 in depwarn(::String, ::Symbol) at ./deprecated.jl:64
 in symbol(::String, ::Vararg{String,N}) at ./deprecated.jl:30
 in macro expansion; at /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:270 [inlined]
 in anonymous at ./<missing>:?
 in include_from_node1(::String) at ./loading.jl:488 (repeats 3 times)
 in eval(::Module, ::Any) at ./boot.jl:234
 in require(::Symbol) at ./loading.jl:415
 in eval(::Module, ::Any) at ./boot.jl:234
 in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:64
 in macro expansion at ./REPL.jl:95 [inlined]
 in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:68
while loading /home/ss/.julia/v0.5/Clang/src/cindex/types.jl, in expression starting on line 267
WARNING: symbol is deprecated, use Symbol instead.
 in depwarn(::String, ::Symbol) at ./deprecated.jl:64
 in symbol(::String, ::Vararg{String,N}) at ./deprecated.jl:30
 in macro expansion; at /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:271 [inlined]
 in anonymous at ./<missing>:?
 in include_from_node1(::String) at ./loading.jl:488 (repeats 3 times)
 in eval(::Module, ::Any) at ./boot.jl:234
 in require(::Symbol) at ./loading.jl:415
 in eval(::Module, ::Any) at ./boot.jl:234
 in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:64
 in macro expansion at ./REPL.jl:95 [inlined]
 in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:68
while loading /home/ss/.julia/v0.5/Clang/src/cindex/types.jl, in expression starting on line 267
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:292
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:348
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:348
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:348
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:348
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:348
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:348
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:348
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:348
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:348
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:348
WARNING: Clang.cindex.CursorKind.(:AddrLabelExpr) is deprecated; use Clang.cindex.CursorKind.:AddrLabelExpr or getfield(Clang.cindex.CursorKind, :AddrLabelExpr) instead.
 in depwarn(::String, ::Symbol) at ./deprecated.jl:64
 in broadcast(::Module, ::Symbol) at ./deprecated.jl:378
 in macro expansion; at /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:376 [inlined]
 in anonymous at ./<missing>:?
 in include_from_node1(::String) at ./loading.jl:488 (repeats 3 times)
 in eval(::Module, ::Any) at ./boot.jl:234
 in require(::Symbol) at ./loading.jl:415
 in eval(::Module, ::Any) at ./boot.jl:234
 in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:64
 in macro expansion at ./REPL.jl:95 [inlined]
 in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:68
while loading /home/ss/.julia/v0.5/Clang/src/cindex/types.jl, in expression starting on line 374
WARNING: Clang.cindex.TypeKind.(:BlockPointer) is deprecated; use Clang.cindex.TypeKind.:BlockPointer or getfield(Clang.cindex.TypeKind, :BlockPointer) instead.
 in depwarn(::String, ::Symbol) at ./deprecated.jl:64
 in broadcast(::Module, ::Symbol) at ./deprecated.jl:378
 in macro expansion; at /home/ss/.julia/v0.5/Clang/src/cindex/types.jl:412 [inlined]
 in anonymous at ./<missing>:?
 in include_from_node1(::String) at ./loading.jl:488 (repeats 3 times)
 in eval(::Module, ::Any) at ./boot.jl:234
 in require(::Symbol) at ./loading.jl:415
 in eval(::Module, ::Any) at ./boot.jl:234
 in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:64
 in macro expansion at ./REPL.jl:95 [inlined]
 in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:68
while loading /home/ss/.julia/v0.5/Clang/src/cindex/types.jl, in expression starting on line 410
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/cindex.jl:88

WARNING: deprecated syntax "[a=>b for (a,b) in c]".
Use "Dict(a=>b for (a,b) in c)" instead.
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/cindex.jl:352
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/cindex.jl:381
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:44
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:44
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:44
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:44
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:44
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:49
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:49
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:49
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:49
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:49
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:49
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:49
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:49
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:49
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:49
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:49
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:49
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:49
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:49
WARNING: Method definition init() in module wrap_c at /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:73 overwritten at /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:94.
WARNING: Base.ByteString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:74
WARNING: Base.ByteString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:74
WARNING: Base.ByteString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:74
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:74
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_c.jl:74
WARNING: Method definition #init(Array{Any, 1}, Clang.wrap_c.#init) in module wrap_c overwritten.

WARNING: deprecated syntax "global context::WrapContext".
Use "typeassert" instead.

WARNING: deprecated syntax "global context::WrapContext".
Use "typeassert" instead.
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_cpp.jl:19
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_cpp.jl:19
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_cpp.jl:360
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_cpp.jl:402
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near /home/ss/.julia/v0.5/Clang/src/wrap_cpp.jl:435

julia> Pkg.checkout("Clang")
INFO: Checking out Clang master...
INFO: Pulling Clang latest master...
WARNING: unknown Clang commit c4d18994, metadata may be ahead of package cache
INFO: No packages to install, update or remove

julia> ing Clang
^XERROR: syntax: extra token "Clang" after end of expression

julia> ^C

julia> Using Clang
ERROR: syntax: extra token "Clang" after end of expression

julia> using Clang

julia> top = cindex.parse_header("example.h"
       )
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near no file:0
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near no file:0
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near no file:0
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near no file:0
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near no file:0
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near no file:0
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near no file:0
WARNING: Base.ASCIIString is deprecated, use String instead.
  likely near no file:0

signal (11): Segmentation fault
while loading no file, in expression starting on line 0
unknown function (ip: 0x7f47659a1036)
unknown function (ip: 0x7f497dbd331c)
unknown function (ip: 0x7f497dbd5890)
_ZNK4llvm10AsmPrinter13EmitInlineAsmENS_9StringRefERKNS_15MCSubtargetInfoERKNS_15MCTargetOptionsEPKNS_6MDNodeENS_9InlineAsm10AsmDialectE at /home/ss/Dropbox/Wriju/Codes/julia/usr/bin/../lib/libLLVM-3.7.1.so (unknown line)
_ZNK4llvm10AsmPrinter13EmitInlineAsmEPKNS_12MachineInstrE at /home/ss/Dropbox/Wriju/Codes/julia/usr/bin/../lib/libLLVM-3.7.1.so (unknown line)
_ZN4llvm10AsmPrinter16EmitFunctionBodyEv at /home/ss/Dropbox/Wriju/Codes/julia/usr/bin/../lib/libLLVM-3.7.1.so (unknown line)
unknown function (ip: 0x7f497d8c2085)
_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE at /home/ss/Dropbox/Wriju/Codes/julia/usr/bin/../lib/libLLVM-3.7.1.so (unknown line)
_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE at /home/ss/Dropbox/Wriju/Codes/julia/usr/bin/../lib/libLLVM-3.7.1.so (unknown line)
_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE at /home/ss/Dropbox/Wriju/Codes/julia/usr/bin/../lib/libLLVM-3.7.1.so (unknown line)
operator() at /home/ss/Dropbox/Wriju/Codes/julia/src/jitlayers.cpp:411 [inlined]
_M_invoke at /usr/include/c++/5/functional:1857
operator() at /usr/include/c++/5/functional:2267 [inlined]
addModuleSet<llvm::SmallVector<std::unique_ptr<llvm::Module>, 1u>, llvm::RTDyldMemoryManager*, std::unique_ptr<llvm::orc::LambdaResolver<JuliaOJIT::addModule(std::unique_ptr<llvm::Module>)::<lambda(const string&)>, JuliaOJIT::addModule(std::unique_ptr<llvm::Module>)::<lambda(const string&)> >, std::default_delete<llvm::orc::LambdaResolver<JuliaOJIT::addModule(std::unique_ptr<llvm::Module>)::<lambda(const string&)>, JuliaOJIT::addModule(std::unique_ptr<llvm::Module>)::<lambda(const string&)> > > > > at /home/ss/Dropbox/Wriju/Codes/julia/usr/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h:76 [inlined]
addModule at /home/ss/Dropbox/Wriju/Codes/julia/src/jitlayers.cpp:521
jl_finalize_function at /home/ss/Dropbox/Wriju/Codes/julia/src/jitlayers.cpp:769
jl_finalize_function at /home/ss/Dropbox/Wriju/Codes/julia/src/jitlayers.cpp:778
getAddressForFunction at /home/ss/Dropbox/Wriju/Codes/julia/src/codegen.cpp:933
jl_generate_fptr at /home/ss/Dropbox/Wriju/Codes/julia/src/codegen.cpp:966
jl_call_method_internal at /home/ss/Dropbox/Wriju/Codes/julia/src/julia_internal.h:186 [inlined]
jl_invoke at /home/ss/Dropbox/Wriju/Codes/julia/src/gf.c:29
#parse_header#1 at /home/ss/.julia/v0.5/Clang/src/cindex.jl:61
unknown function (ip: 0x7f4767f412f5)
parse_header at /home/ss/.julia/v0.5/Clang/src/cindex.jl:48
unknown function (ip: 0x7f4767f40c62)
jl_call_method_internal at /home/ss/Dropbox/Wriju/Codes/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /home/ss/Dropbox/Wriju/Codes/julia/src/gf.c:1950
do_call at /home/ss/Dropbox/Wriju/Codes/julia/src/interpreter.c:66
eval at /home/ss/Dropbox/Wriju/Codes/julia/src/interpreter.c:190
eval_body at /home/ss/Dropbox/Wriju/Codes/julia/src/interpreter.c:469
jl_interpret_call at /home/ss/Dropbox/Wriju/Codes/julia/src/interpreter.c:573
jl_toplevel_eval_flex at /home/ss/Dropbox/Wriju/Codes/julia/src/toplevel.c:572 [inlined]
jl_toplevel_eval at /home/ss/Dropbox/Wriju/Codes/julia/src/toplevel.c:580
jl_toplevel_eval_in_warn at /home/ss/Dropbox/Wriju/Codes/julia/src/builtins.c:590
eval at ./boot.jl:234
unknown function (ip: 0x7f49795dba5f)
jl_call_method_internal at /home/ss/Dropbox/Wriju/Codes/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /home/ss/Dropbox/Wriju/Codes/julia/src/gf.c:1950
eval_user_input at ./REPL.jl:64
unknown function (ip: 0x7f4767f02986)
jl_call_method_internal at /home/ss/Dropbox/Wriju/Codes/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /home/ss/Dropbox/Wriju/Codes/julia/src/gf.c:1950
macro expansion at ./REPL.jl:95 [inlined]
#3 at ./event.jl:68
unknown function (ip: 0x7f4767efbf1f)
jl_call_method_internal at /home/ss/Dropbox/Wriju/Codes/julia/src/julia_internal.h:189 [inlined]
jl_apply_generic at /home/ss/Dropbox/Wriju/Codes/julia/src/gf.c:1950
jl_apply at /home/ss/Dropbox/Wriju/Codes/julia/src/julia.h:1392 [inlined]
start_task at /home/ss/Dropbox/Wriju/Codes/julia/src/task.c:253
unknown function (ip: 0xffffffffffffffff)
Allocations: 9473592 (Pool: 9468858; Big: 4734); GC: 18
Segmentation fault (core dumped)

My Julia version:

julia> versioninfo()
Julia Version 0.5.1-pre+55
Commit 8d4ef37 (2017-02-13 09:11 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, sandybridge)

Any help regarding the matter would be appreciated.

Gramercy…

4 posts - 2 participants