Re: JOGL for Mac ARM Silicon
Posted by CharlieBoy on Nov 13, 2022; 10:30am
URL: https://forum.jogamp.org/JOGL-for-Mac-ARM-Silicon-tp4040887p4041930.html
Hi all,
I decided to cut out the jReality layer.
I was able to compile and run the JOGL version of the GL gears demo successfully under both the JDK 8 Oracle-Intel and JDK 8 Azul-Zulu-ARM.
I did this in an Eclipse project. Then I took the Java package containing this standalone Gears demo from this project and copied it into my jreality Eclipse project. There, when I tried to run it I got a link error involving the file libgluegen_rt.dylib.
Exception in thread "main" java.lang.UnsatisfiedLinkError: /private/var/folders/58/88404tjn5696y7m6tz6npjr80000gn/T/jogamp_0000/file_cache/jln2905774039431097195/jln3642190880566679013/natives/macosx-universal/libgluegen_rt.dylib: dlopen(/private/var/folders/58/88404tjn5696y7m6tz6npjr80000gn/T/jogamp_0000/file_cache/jln2905774039431097195/jln3642190880566679013/natives/macosx-universal/libgluegen_rt.dylib, 0x0001): tried: '/private/var/folders/58/88404tjn5696y7m6tz6npjr80000gn/T/jogamp_0000/file_cache/jln2905774039431097195/jln3642190880566679013/natives/macosx-universal/libgluegen_rt.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1950)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1832)
at java.lang.Runtime.load0(Runtime.java:783)
at java.lang.System.load(System.java:1100)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:604)
at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:64)
at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:107)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:488)
at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:427)
at com.jogamp.common.os.Platform$1.run(Platform.java:321)
at java.security.AccessController.doPrivileged(Native Method)
at com.jogamp.common.os.Platform.<clinit>(Platform.java:290)
at com.jogamp.opengl.GLProfile.<clinit>(GLProfile.java:154)
at demo.gears.JGears.<clinit>(JGears.java:53)
According to the Mac search tool, there are only two files named libgluegen_rt.dylib on my machine and they are identical (I copied the original from the SweetHome3D website mentioned in this thread):
% file libgluegen_rt.dylib
% Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64Mach-O 64-bit dynamically linked shared library x86_64] [arm64:Mach-O 64-bit dynamically linked shared library arm64Mach-O 64-bit dynamically linked shared library arm64]
Furthermore, when I click on the above stack trace, for example the second entry, at GLProfile.java:154, the class file is displayed with the error message that that "the line number 154 is not a valid line number in GLProfile.java". That seems to imply that I may be loading the wrong jogl-all.jar file. There are several old ones cluttering up the system.
Please let me know if I should take this problem to another forum, it doesn't seem to be specifically jogl-based, since the Gears demo does run properly when I put it into its own Eclipse project.
Otherwise, any help appreciated. For example are there VM flags that force verbose printing of which jar files are actually loaded by the loading process? It seems that the wrong jogl-all.jar is getting loaded.
Thanks for your help.
Charlie