JetBrains / skija

Java bindings for Skia
Apache License 2.0
2.63k stars 127 forks source link

M1 Mac - Can't run Clojure examples #125

Open balloneij opened 3 years ago

balloneij commented 3 years ago

I'll preface this by saying that I am excited by the work done with this project, and I can't wait to play with it myself.

I'm having difficulty running the Clojure examples locally. I have followed the build instructions and tried to run the examples. There have been two issues.

The first, which I think I have solved, is in examples/clojure/deps.edn. It appears to link to an incorrect resource folder.

:paths ["src" "../../native/build" "../../shared/target/classes" ] After, building, I don't have a native folder, so it leads me to believe it's supposed to target platform: :paths ["src" "../../platform/build" "../../shared/target/classes" ]

The second issue, which I am stumped by, is when I try running examples/clojure/script/run.py:

Reflection warning, lwjgl/main.clj:26:5 - call to static method glfwGetWindowContentScale on org.lwjgl.glfw.GLFW can't be resolved (argument types: unknown, unknown, unknown).
[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.dylib

Full report at:
/var/folders/19/5kzk0q353659pn66g9nqc41r0000gn/T/clojure-2791627403017496819.edn

Traceback (most recent call last):
  File "/Users/balloneij/repos/skija/examples/clojure/script/run.py", line 12, in <module>
    sys.exit(main())
  File "/Users/balloneij/repos/skija/examples/clojure/script/run.py", line 8, in main
    subprocess.check_call(["clj", "-M:" + system, "-m", "lwjgl.main"])
  File "/opt/homebrew/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['clj', '-M:macos', '-m', 'lwjgl.main']' returned non-zero exit status 1.

I am missing the liblwjgl.dylib library. However, I believe it should have been pulled automagically from Maven. Is this an issue with LWJGL not providing dlylibs for Mac ARM64, or is there something I'm not understanding?

I would be happy to make a pull request for the deps.edn files if this is a mistake

tonsky commented 3 years ago

LWJGL has no M1 builds, unfortunately. We’ve started a new library, https://github.com/jetbrains/jwm, that is working on M1, but it’s very raw right now. Eventually we’ll migrate examples to it