SimonDanisch / GLPlot.jl

Plotting for Julia with OpenGL
Other
74 stars 8 forks source link

Using GLPlot.jl: Inexact Error (Julia v0.4.0-dev OSX 10.9.5) #17

Closed maxruby closed 9 years ago

maxruby commented 9 years ago

When trying to simply load GLPlot with using, I get the following error:

julia> using GLPlot
ERROR: InexactError()
 in include at ./boot.jl:242
 in include_from_node1 at ./loading.jl:128
 in include at ./boot.jl:242
 in include_from_node1 at ./loading.jl:128

. . . very long ERROR message (see Full ERROR ). It seems that this stems from the many calls e.g., convert(GLenum, 0x0DD1) in glConstants.jl.

Any thoughts on what I should do to get through?

SimonDanisch commented 9 years ago

I should really tag new versions... You need to checkout master: Pkg.checkout("GLPlot"); Pkg.checkout("GLWindow"); Pkg.checkout("GLAbstraction"); Pkg.checkout("ModernGL")

Cheers and sorry for the inconvenience, Simon On 10 Dec 2014 01:41, "Maximiliano Suster" notifications@github.com wrote:

When trying to simply load GLPlot with using, I get the following error:

julia> using GLPlot ERROR: InexactError() in include at ./boot.jl:242 in include_from_node1 at ./loading.jl:128 in include at ./boot.jl:242 in include_from_node1 at ./loading.jl:128

. . . very long ERROR message (see Full ERROR https://gist.github.com/maxruby/77f7b76f3a0de282a9b6 ). It seems that this stems from the many calls e.g., convert(GLenum, 0x0DD1) in glConstants.jl.

Any thoughts on what I should do to get through?

— Reply to this email directly or view it on GitHub https://github.com/SimonDanisch/GLPlot.jl/issues/17.

maxruby commented 9 years ago

Thanks. Now, when I try the simple demo Image viewing, I get a lot of warnings and a fatal ERROR: stack overflow. In addition, the window seems to be stuck and I am unable to close it manually. The entire process took several seconds to complete, is this normal?

julia> using GLPlot, GLAbstraction
100 x {
WARNING: deprecated syntax "{}" at /Users/maximilianosuster/.julia/Calculus/src/symbolic.jl:108.
Use "[]" instead.
 . . . }
julia> window = createdisplay()
50x { 
    WARNING: apply(f, x) is deprecated, use `f(x...)` instead
}

name: display2
children: 0
Inputs:
  hasfocus => Reactive.Input{Bool}
  insidewindow => Reactive.Input{Bool}
  scroll_x => Reactive.Input{Int64}
  windowposition => Reactive.Input{ImmutableArrays.Vector2{Int64}}
  scroll_y => Reactive.Input{Int64}
  framebuffer_size => Reactive.Input{ImmutableArrays.Vector2{Int64}}
  mousereleased => Reactive.Input{Int64}
  buttonreleased => Reactive.Input{Int64}
  open => Reactive.Input{Bool}
  mousebuttonspressed => Reactive.Input{IntSet}
  mouseposition_glfw_coordinates => Reactive.Input{ImmutableArrays.Vector2{Float64}}
  unicodeinput => Reactive.Input{Array{Char,1}}
  mouseposition => Reactive.Lift{ImmutableArrays.Vector2{Float64}}
  mousedown => Reactive.Input{Int64}
  window_size => Reactive.Input{ImmutableArrays.Vector4{Int64}}
  buttondown => Reactive.Input{Int64}
  buttonspressed => Reactive.Input{IntSet}

julia> a = Texture(Vec4[Vec4(i/512,j/512,0,1)for i=1:512, j=1:512])
Texture2D: 
                  ID: 3
                Size: [ColorDim: 4]x512x512
    Julia pixel type: ImmutableArrays.Vector4{Float32}
   OpenGL pixel type: GL_FLOAT
              Format: GL_RGBA
     Internal format: GL_RGBA32F

julia> b = Texture(Float32[(i*j)/512^2 for i=1:512, j=1:512], 1)
ERROR: stack overflow
SimonDanisch commented 9 years ago

That must be still old code...Did you do Pkg.update() recently? WARNING: apply(f, x) is deprecated, usef(x...)instead Should be fixed in the newest tagged version of Reactive. This is how the image example in master should look like: https://github.com/SimonDanisch/GLPlot.jl/blob/master/example/image.jl So I assume that you're still not on master with GLPlot...

maxruby commented 9 years ago

I did Pkg.checkout exactly as you told me. Now I will do Pkg.update(). . .

maxruby commented 9 years ago

Uhmm, this is going to be fun. The Pkg.update() broke my Cairo installation with a new ERROR - that is exactly why I hesitate to update too often while developing my own package. . .
Meanwhile, I still get the ERROR from Reactive.jl so I guess I need to build it again separately?
I did both Pkg.checkout and Pkg.update as you said - still I get the warnings and messages and its all slow.

SimonDanisch commented 9 years ago

How painful... :( Didn't expect that to be an issue. Could Reactive be dirty and that's why it didn't update? You can also just checkout Reactive as well ;) And if this all doesn't work, you can always just go into the folders and do git pull origin master and if this fails due to the package being dirty, just do a git reset --hard HEAD. Or just delete all the folders and install it with checkout ;)

maxruby commented 9 years ago

OK. Now it worked after Pkg.build("Reactive") and then restarting Julia once more. The WARNING: apply(f, x) is deprecated, usef(x...)instead is still there though and the entire process to plot the image takes over 10s?

SimonDanisch commented 9 years ago

Well then just do a Pkg.checkout("Reactive"). The package is admittedly very slow to load, but plotting itself should be very fast ;)

maxruby commented 9 years ago

OK. Now it works as I would have expected - as you said, it is just the package loading time that is quite long. . . However, I am aware that this is a challenge for all packages. I will close the issue then?

SimonDanisch commented 9 years ago

Was there a single issue that I could fix, to make this less painful? In other words, will tagging GLPlot, GLAbstraction, ModernGL, GLWindow make the installation run smooth?

maxruby commented 9 years ago

I think you should definitely tag those, and at least indicate the changes necessary to get it to work smoothly with v0.4.0-dev. Currently, you definitely need the following for it to work:

Pkg.checkout("GLPlot");
Pkg.checkout("GLWindow");
Pkg.checkout("GLAbstraction");
Pkg.checkout("ModernGL");
Pkg.checkout("Reactive");

A polite reminder to do Pkg.update() after that is worthwhile too.

SimonDanisch commented 9 years ago

Okay thanks!