This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-04
Channels
- # announcements (6)
- # babashka (7)
- # beginners (2)
- # biff (5)
- # calva (2)
- # cherry (17)
- # cider (3)
- # clj-kondo (8)
- # clojure (202)
- # clojure-brasil (8)
- # clojure-europe (20)
- # clojure-norway (23)
- # clojure-uk (4)
- # clojuredesign-podcast (5)
- # conjure (1)
- # cursive (9)
- # eastwood (22)
- # events (8)
- # fulcro (3)
- # hyperfiddle (22)
- # introduce-yourself (7)
- # lsp (67)
- # malli (1)
- # matrix (1)
- # meander (6)
- # off-topic (76)
- # pedestal (8)
- # polylith (17)
- # quil (12)
- # re-frame (2)
- # reagent (8)
- # releases (3)
- # shadow-cljs (67)
- # sql (93)
- # squint (39)
- # tools-deps (46)
- # vim (7)
Hi Everyone, I am interested in trying to use Quil in some of my personal dataviz projects. I have sucessfully gotten some of the Quil sketches working on my Linux AMD64 system, however I am running into issues with the OpenGL ones. I am going to post more detail in a reply to myself, to ensure I do not bomb this Slack channel with large blocks of text.
I have installed Quil with the following deps.edn
configuration:
...
quil/quil {:mvn/version "4.0.0-SNAPSHOT-1"}
org.jogamp.gluegen/gluegen-rt {:mvn/version "2.4.0-rc-20230201"}
org.jogamp.gluegen/gluegen-rt$natives-linux-amd64 {:mvn/version "2.4.0-rc-20230201"}
org.jogamp.jogl/jogl-all {:mvn/version "2.4.0-rc-20230201"}
org.jogamp.jogl/jogl-all$natives-linux-amd64 {:mvn/version "2.4.0-rc-20230201"}
org.jogamp.jogl/jogl-all$natives-macosx-universal {:mvn/version "2.4.0-rc-20230201"}
...
:mvn/repos
{"jitpack" {:url ""}
"jogl" {:url " "}}
This works with basic sketches. But when running OpenGL related examples, like the Sphere
I had this error:
Execution error (UnsatisfiedLinkError) at java.lang.ClassLoader/loadLibrary (ClassLoader.java:2422).
Can't load library: /home/dave/Projects/clojure/graph/natives/linux-amd64/libgluegen_rt.so
I decided to try to find these libraries and manually extract and place them in the correct location. Here is a half finished build.clj
function I use for this.
(defn extract-native-libs []
(let [basis (b/create-basis {})
jar-path (-> basis
:libs
(get 'org.jogamp.gluegen/gluegen-rt$natives-linux-amd64)
:paths
first)
jar-path2 (-> basis
:libs
(get 'org.jogamp.jogl/jogl-all$natives-linux-amd64)
:paths
first)
dest-dir "natives"]
(b/delete {:path dest-dir})
(b/unzip {:zip-file jar-path :target-dir dest-dir})
(b/unzip {:zip-file jar-path2 :target-dir dest-dir})))
This seems to have made progress, however I now seem to have issues with more display driver issues. I am getting the feeling that I am using the project incorrectly. Does anyone have any ideas?
Execution error (NoSuchMethodError) at jogamp.newt.driver.x11.DisplayDriver/initIDs0 (DisplayDriver.java:-2).
sizePosMaxInsetsVisibleChanged
Syntax error macroexpanding at (learning.clj:32:1).
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3719)
java.lang.RuntimeException: com.jogamp.nativewindow.NativeWindowException: Failed to find or initialize class <.x11.DisplayDriver> -> <jogamp.newt.driver.x11.DisplayDriver>: sizePosMaxInsetsVisibleChanged
at jogamp.newt.DisplayImpl.create(DisplayImpl.java:311)
com.jogamp.nativewindow.NativeWindowException: Failed to find or initialize class <.x11.DisplayDriver> -> <jogamp.newt.driver.x11.DisplayDriver>: sizePosMaxInsetsVisibleChanged
at com.jogamp.newt.NewtFactory.getCustomClass(NewtFactory.java:114)
java.lang.NoSuchMethodError: sizePosMaxInsetsVisibleChanged
at jogamp.newt.driver.x11.DisplayDriver.initIDs0(Native Method)
at jogamp.newt.driver.x11.DisplayDriver.<clinit>(DisplayDriver.java:55)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:421)
at java.base/java.lang.Class.forName(Class.java:412)
at com.jogamp.newt.NewtFactory.getCustomClass(NewtFactory.java:112)
at jogamp.newt.DisplayImpl.getDisplayClass(DisplayImpl.java:276)
at jogamp.newt.DisplayImpl.create(DisplayImpl.java:282)
at com.jogamp.newt.NewtFactory.createDisplay(NewtFactory.java:170)
at com.jogamp.newt.NewtFactory.createDisplay(NewtFactory.java:152)
at processing.opengl.PSurfaceJOGL.initDisplay(PSurfaceJOGL.java:230)
at processing.opengl.PSurfaceJOGL.initFrame(PSurfaceJOGL.java:216)
at processing.core.PApplet.initSurface(PApplet.java:10329)
at quil.Applet.initSurface(Unknown Source)
at processing.core.PApplet.runSketch(PApplet.java:10237)
at quil.applet$applet_run.invokeStatic(applet.clj:81)
at quil.applet$applet_run.invoke(applet.clj:78)
at quil.applet$applet.invokeStatic(applet.clj:329)
at quil.applet$applet.doInvoke(applet.clj:269)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3714)
at clojure.lang.Compiler$DefExpr.eval(Compiler.java:457)
at clojure.lang.Compiler.eval(Compiler.java:7199)
at clojure.lang.Compiler.eval(Compiler.java:7149)
at clojure.core$eval.invokeStatic(core.clj:3215)
at clojure.core$eval.invoke(core.clj:3211)
at nrepl.middleware.interruptible_eval$evaluate$fn__968$fn__969.invoke(interruptible_eval.clj:87)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1990)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1990)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at nrepl.middleware.interruptible_eval$evaluate$fn__968.invoke(interruptible_eval.clj:87)
at clojure.main$repl$read_eval_print__9206$fn__9209.invoke(main.clj:437)
at clojure.main$repl$read_eval_print__9206.invoke(main.clj:437)
at clojure.main$repl$fn__9215.invoke(main.clj:458)
at clojure.main$repl.invokeStatic(main.clj:458)
at clojure.main$repl.doInvoke(main.clj:368)
at clojure.lang.RestFn.invoke(RestFn.java:1523)
at nrepl.middleware.interruptible_eval$evaluate.invokeStatic(interruptible_eval.clj:84)
at nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:56)
at nrepl.middleware.interruptible_eval$interruptible_eval$fn__999$fn__1003.invoke(interruptible_eval.clj:152)
at clojure.lang.AFn.run(AFn.java:22)
at nrepl.middleware.session$session_exec$main_loop__1067$fn__1071.invoke(session.clj:202)
at nrepl.middleware.session$session_exec$main_loop__1067.invoke(session.clj:201)
at clojure.lang.AFn.run(AFn.java:22)
at java.base/java.lang.Thread.run(Thread.java:1583)
So ... I'm not quite sure what that release of quil 4.0 snapshot is from? The current official release is 3.1, which will likely throw open gl errors if the version of the JVM is wrong for that build (I think it requires java 8 still?). We are working on a new 4.3 build that depends on up to date processing 4 jars along with a version of JOGL that works on M1 arch, and more modern JVMs however that's just a prerelease. The snapshot you listed I'm not familiar with, so it likely has a different set of problems. I would say for this week it might be best to rollback to quil 3.1 and rollback to an older JVM. However, if you want to stay bleeding edge you can try the prerelease jar that Jack posted above, that should work on newer JVMs and across architectures, but may have other problems. Apologies that the project is in flux right now, that's what we are trying to fix, but it's taking some time!
I'm on Java 21, so I'm very interested in the 4.x releases. I will see if I can get them working today.
@UMGAMGWF8 I got the SNAPSHOT version from the README.md here: https://github.com/quil/quil#requirements
Ah, I missed that. I'm still not quite sure how that jar is constructed or why it might fail for certain renderers though. Maybe try the jar that Jack posted above? I'm not sure all the renderers work for the 4.3 build that Jack posted, but I know at least some of them do as I did some manual testing on it for a couple examples. Sorry again that things are in this interstitial state!
I actually got the https://github.com/thi-ng/geom 3D rendering working now too thanks to these new deps. This was definitely having the same errors as Quil yesterday though. I can't be sure which dep it was specifically, I was changing too many variables at once, however results are looking good.
If you have the time, do you mind trying the new quil 4.3-SNAPSHOT we just released on Clojars to see if if that works for you?
I am away from my Linux desktop for the next 24 hours. Will testing on M1 Mac be helpful?
Either would be great, and no rush, just letting you know it was available. Looking forward to any feedback or bug reports though!
Thanks, no rush necessary at all, but certainly appreciate any feedback.