Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem running Clojure example on Ubuntu 20.04 #68

Closed
oakmac opened this issue Dec 3, 2020 · 5 comments
Closed

problem running Clojure example on Ubuntu 20.04 #68

oakmac opened this issue Dec 3, 2020 · 5 comments

Comments

@oakmac
Copy link
Contributor

oakmac commented Dec 3, 2020

Hello! I am trying to run the Clojure example on Ubuntu 20.04 and running into an error:

oakmac@oakmac-desktop:~/skija/examples/clojure$ java -version
openjdk version "14.0.2" 2020-07-14
OpenJDK Runtime Environment (build 14.0.2+12-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 14.0.2+12-Ubuntu-120.04, mixed mode, sharing)

oakmac@oakmac-desktop:~/skija/examples/clojure$ clj -M -m lwjgl.main
[LWJGL] Failed to load a library. Possible solutions:
	a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
	b) Add the JAR that contains the shared library to the classpath.
[LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
[LWJGL] Enable the SharedLibraryLoader debug mode with -Dorg.lwjgl.util.DebugLoader=true for better diagnostics.
Execution error (UnsatisfiedLinkError) at org.lwjgl.system.Library/loadSystem (Library.java:162).
Failed to locate library: liblwjgl.so

Full report at:
/tmp/clojure-10182201394873438874.edn

The full clojure error report can be found here.

Some searching leads me to believe this is not specific to skija, but rather something related to including a library path on the CLI or via deps.edn (I am not exactly sure though).

I thought I would make an issue for help and also to document this in case anyone else runs into a similar problem.

@tonsky
Copy link
Collaborator

tonsky commented Dec 3, 2020

Have you built local skija locally?

Alternatively, you can replace org.jetbrains.skija/skija-native {:mvn/version "0.0.0-SNAPSHOT"} in deps.edn with org.jetbrains.skija/skija-macos {:mvn/version "0.6.21"}

@oakmac
Copy link
Contributor Author

oakmac commented Dec 3, 2020

Have you built local skija locally?

I have not. I was running into trouble with that as well.

Alternatively, you can replace ... in deps.edn

This is the approach I tried. My deps.edn is:

{:deps {
        ; org.jetbrains.skija/skija-native {:mvn/version "0.0.0-SNAPSHOT"}
        org.jetbrains.skija/skija-linux {:mvn/version "0.6.21"}
        org.lwjgl/lwjgl {:mvn/version "3.2.3"}
        org.lwjgl/lwjgl$natives-macos {:mvn/version "3.2.3"}
        org.lwjgl/lwjgl-glfw {:mvn/version "3.2.3"}
        org.lwjgl/lwjgl-glfw$natives-macos {:mvn/version "3.2.3"}
        org.lwjgl/lwjgl-opengl {:mvn/version "3.2.3"}
        org.lwjgl/lwjgl-opengl$natives-macos {:mvn/version "3.2.3"}
        nrepl/nrepl {:mvn/version "0.8.3"}}

 :mvn/repos {"space-maven" {:url "https://packages.jetbrains.team/maven/p/skija/maven"}}}

@oakmac
Copy link
Contributor Author

oakmac commented Dec 3, 2020

I am able to run examples/lwjgl/scripts/exec.sh and the window pops up with examples working. Not sure if that is relevant / related or not.

@tonsky
Copy link
Collaborator

tonsky commented Dec 3, 2020

Looks like you need to change natives-macos to natives-linux for all lwjgl dependencies. I’ll add that to the README

tonsky added a commit that referenced this issue Dec 3, 2020
@oakmac
Copy link
Contributor Author

oakmac commented Dec 3, 2020

Oh my gosh - duh! That flew right over my head last night 🤣

Yes - that works perfectly. For anyone finding this thread changing my deps.edn to this worked:

{:deps {
        ; org.jetbrains.skija/skija-native {:mvn/version "0.0.0-SNAPSHOT"}
        org.jetbrains.skija/skija-linux {:mvn/version "0.6.21"}
        org.lwjgl/lwjgl {:mvn/version "3.2.3"}
        org.lwjgl/lwjgl$natives-linux {:mvn/version "3.2.3"}
        org.lwjgl/lwjgl-glfw {:mvn/version "3.2.3"}
        org.lwjgl/lwjgl-glfw$natives-linux {:mvn/version "3.2.3"}
        org.lwjgl/lwjgl-opengl {:mvn/version "3.2.3"}
        org.lwjgl/lwjgl-opengl$natives-linux {:mvn/version "3.2.3"}
        nrepl/nrepl {:mvn/version "0.8.3"}}

 :mvn/repos {"space-maven" {:url "https://packages.jetbrains.team/maven/p/skija/maven"}}}

Then I run clj -M -m lwjgl.main and see a rotating square.

Thank you for the help @tonsky !

@oakmac oakmac closed this as completed Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants