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

M1 Mac - Can't run Clojure examples #125

Open
balloneij opened this issue Aug 2, 2021 · 1 comment
Open

M1 Mac - Can't run Clojure examples #125

balloneij opened this issue Aug 2, 2021 · 1 comment

Comments

@balloneij
Copy link

  • Clojure CLI 1.10.3.933
  • OpenJDK 16.0.1

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/[email protected]/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
Copy link
Collaborator

tonsky commented Aug 2, 2021

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

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