Cxx.jl icon indicating copy to clipboard operation
Cxx.jl copied to clipboard

Crash during qttest.jl... with llvm 3.7.1 and recent v0.5 julia sources

Open protogeezer opened this issue 9 years ago • 4 comments

It's unclear where to go from here. It would be helpful if the example could be updated for Qt 5.5 and presumably the latest Clang/LLVM?

Stephen

.... julia> app = @cxx QApplication(*(pointer(ac)),pointer(x)) Error showing value of type Cxx.CppValue{Cxx.CxxQualType{Cxx.CppBaseType{:QApplication},(false,false,false)},16}: ERROR: MethodError: no method matching stripmodifier(::Type{CxxStd.##1#2}) in #buildargexprs#19(::Bool, ::Any, ::Cxx.ClangCompiler, ::Tuple{DataType,DataType}) at /Users/sjbespa/.julia/v0.5/Cxx/src/codegen.jl:379 in #CallDNE#28(::Array{Any,1}, ::Any, ::Cxx.ClangCompiler, ::Cxx.CppPtr{Cxx.CxxQualType{Cxx.CppBaseType{symbol("clang::Expr")},(false,false,false)},(false,false,false)}, ::Tuple{DataType,DataType}) at /Users/sjbespa/.julia/v0.5/Cxx/src/cxxstr.jl:448 in (::Vararg{Any})() at /Users/sjbespa/.julia/v0.5/Cxx/src/cxxstr.jl:464 in (::Vararg{Any})() at /Users/sjbespa/.julia/v0.5/Cxx/src/show.jl:26 [inlined code] from ./show.jl:39 in showcompact(::Base.Terminals.TTYTerminal, ::Cxx.CppValue{Cxx.CxxQualType{Cxx.CppBaseType{:QApplication},(false,false,false)},16}) at ./show.jl:1432 in writemime(::Base.Terminals.TTYTerminal, ::MIME{symbol("text/plain")}, ::Cxx.CppValue{Cxx.CxxQualType{Cxx.CppBaseType{:QApplication},(false,false,false)},16}) at ./replutil.jl:4 [inlined code] from ./expr.jl:8 in display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::MIME{symbol("text/plain")}, ::Cxx.CppValue{Cxx.CxxQualType{Cxx.CppBaseType{:QApplication},(false,false,false)},16}) at ./REPL.jl:114 [inlined code] from ./expr.jl:8 in display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::Cxx.CppValue{Cxx.CxxQualType{Cxx.CppBaseType{:QApplication},(false,false,false)},16}) at ./REPL.jl:117 [inlined code] from ./multimedia.jl:151 in display(::Cxx.CppValue{Cxx.CxxQualType{Cxx.CppBaseType{:QApplication},(false,false,false)},16}) at ./multimedia.jl:163 in print_response(::Base.Terminals.TTYTerminal, ::Any, ::Void, ::Bool, ::Bool, ::Void) at ./REPL.jl:134 in print_response(::Base.REPL.LineEditREPL, ::Any, ::Void, ::Bool, ::Bool) at ./REPL.jl:121 in (::Base.REPL.##18#19{Bool,Base.#parse_input_line,Base.REPL.LineEditREPL,Base.LineEdit.Prompt})(::Base.LineEdit.MIState, ::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Bool) at ./REPL.jl:626 in run_interface(::Base.Terminals.TTYTerminal, ::Base.LineEdit.ModalInterface) at ./LineEdit.jl:1611 in run_frontend(::Base.REPL.LineEditREPL, ::Base.REPL.REPLBackendRef) at ./REPL.jl:859 in run_repl(::Base.REPL.LineEditREPL, ::Base.##475#476) at ./REPL.jl:167 in _start() at ./client.jl:360

protogeezer avatar Feb 18 '16 23:02 protogeezer

I haven't looked at this for a while, but you might want to check out my toy package Qt5.jl for comparisons sake. I used @Keno 's Qt code to get it working, but I think I might have taken a slightly different approach in the end. It probably won't run out of the box, but maybe you can get debugging ideas (for example looking at https://github.com/tbreloff/Qt5.jl/blob/master/src/core.jl#L57)

tbreloff avatar Feb 19 '16 15:02 tbreloff

Tom: thanks! I will indeed give it a whirl.

Even if I can get the sample code working, I'm not sure that this package ready to base a large scale development effort. I'm thinking that it would be worth the bother to implement enough of the Qt/VTK bindings I'd need to explore a Compose and Compose3D upgrade using different strategies to see which feels right. Perhaps, do enough to try a few small steps towards something like mayavi.mlab?

Three alternatives that come to mind would be Cxx.jl, Holy's CPP.jl and a "thin" binding to VTK and Qt which exposes the frameworks as a C interface. The advantage of the latter, if it's even possible, would be to do all the conversions from Julia datatypes into C++ types in the bindings.

The reason this is all relevant, is that my suspicion is that dealing with C++ in Julia (elegantly) would require a few C++ features being added to Julia.

If Cxx is the way to go, then I'll get more aggressive about getting it working.

protogeezer avatar Feb 19 '16 16:02 protogeezer

Try again now, I just updated Cxx.jl to support latest julia master.

Keno avatar Feb 22 '16 23:02 Keno

Huh. I thought I left you some feedback earlier in the week.

Cxx still didn't work with the commands in the qttest in the Cxx package. It did work with the method of creating the QApplication object in Tom's Qt5 package (also qttest).

In any event, I can't build a version of julia with the sources set back to the last version of julia that Gadfly/Compose works AND with the cxx configuration for llvm. (So working on a VTK-based Compose(3d) package is a bit in limbo for the time being).

protogeezer avatar Feb 29 '16 00:02 protogeezer