Running on Apple M1

Congratulations and thanks for sharing! :slight_smile:

8 months later and I’m reading elsewhere that the support should already be included.

However, when trying to run the current template (using RNDR version 0.4.1), I’m getting the following error. Since I’m running this program on M1 chip, I need the org.lwjgl library built for aarch64 architecture but my classpath apparently has only macos/x64 available.

[LWJGL] Platform/architecture mismatch detected for module: org.lwjgl
	JVM platform:
		macOS aarch64 16.0.2
		OpenJDK 64-Bit Server VM v16.0.2+7 by Azul Systems, Inc.
	Platform available on classpath:
		macos/x64
[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.

│  TemplateProgramKt.main(TemplateProgram.kt:-1)
├─ TemplateProgramKt.main(TemplateProgram.kt:9)
│  org.openrndr.ApplicationBuilderKt.application(ApplicationBuilder.kt:86)
│  org.openrndr.ApplicationBuilderJVM.<init>(ApplicationBuilder.kt:110)
│  org.openrndr.ApplicationBase.Companion.initialize(ApplicationBase.kt:22)
├─ java.lang.reflect.Constructor.newInstance(Constructor.java:480)
├─ java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
├─ jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
├─ jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
│  jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:-2)
│
↑ null (InvocationTargetException) 
├─ org.lwjgl.system.Library.loadSystem(Library.java:164)
Exception in thread "main" java.lang.IllegalStateException: unreachable?
	at org.openrndr.ApplicationBuilderKt.application(ApplicationBuilder.kt:94)
	at TemplateProgramKt.main(TemplateProgram.kt:9)
	at TemplateProgramKt.main(TemplateProgram.kt)

The support for aarch64 was apparently added to LWJGL in v3.3.0.

I’ve tried to build RNDR v0.5.1-SNAPSHOT and thought I would update the LWJGL library but noticed it already uses the latest version (3.3.1).

Does anyone else get this issue on Apple silicon?
Can you advise on where to get LWJGL as a “shared library” as the hints suggest, or LWJGL built for aarch64 directly, please?

Maybe this PR is related? Change arm64 to aarch64 by Vechro · Pull Request #274 · openrndr/orx · GitHub

Thanks for the tip @abe, it looked so promising but it didn’t do the trick for me.

What I did was I

  1. Checked out the orx repo on the suggested branch (Vechro:aarch-fix)
  2. Built the orx project and published it to local maven as -SNAPSHOT
  3. Built the template project with snapshot version of orx

But the template project is still failing with the exact same error.

I’ll try to look around the internet for some more hints on how to include the LWJGL library built for the right architecture.

There was a problem with the template project. It’s going to be fixed by this PR.

As of Oct 12, about noon Eastern time, Edwin updated the template. It downloaded and runs OK on my M1 Mac. Well done, Edwin and the team! Ten points to OPENRNDR.

Thanks!

1 Like