Bug: Library not found for Arch64
Version
1.86.9
What happened?
java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/~~aPFq1K5IGZtPglACKE1Dzw==/xyz.akatski.imguijni-G8FAKsF_TBczARNP_Fv6Hw==/lib/arm64/libimgui-java64.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
Reproduction
i just loaded the sample code is provided in repo and compiled dependency in my application
Relevant log output
No response
Unfortunately, binding doesn't provide builds for arm/arch architectures.
I would really like to have arm64 builds for macOS since that is a fairly common platform out there now.
I would also prefer to use this natively. In the meantime, you can install an x86 JVM which will run with Rosetta.
+1
some projects started using zig for easy cross-compilation of C code, eg. https://github.com/lmdbjava/lmdbjava/pull/217 I suspect this would work C++ as well, see https://zig.news/kristoff/cross-compile-a-c-c-project-with-zig-3599
+1
#190 should solve this, but for anyone who wants a quick and dirty solution for Apple Silicon:
- Clone this repository
- Go to
buildSrc/src/main/groovy/tool/generator/GenerateLibs.groovy - Apply the following changes so you can target arm64:
- def mac64 = BuildTarget.newDefaultTarget(BuildTarget.TargetOs.MacOsX, true)
+ def mac64 = BuildTarget.newDefaultTarget(BuildTarget.TargetOs.MacOsX, true, true)
- BuildExecutor.executeAnt(jniDir + '/build-macosx64.xml', commonParams)
+ BuildExecutor.executeAnt(jniDir + '/build-macosxarm64.xml', commonParams)
- From the repository root, build a native library for arm64: (you might have to install ant)
./gradlew imgui-binding:generateLibs -Denvs=macos -Dfreeetype=true -Dlocal
- You'll find the native library under
imgui-binding/build/libsNative/macosxarm64/libimgui-javaarm64.dylib - When starting your application pass the following JVM options:
-Dimgui.library.path=./path/to/library/folder -Dimgui.library.name=libimgui-javaarm64.dylib
- Don't forget to also add the LWJGL native librariess for arm64 to your classpath
Resolved #223 aarch64 support will be available in the next release