imgui-java icon indicating copy to clipboard operation
imgui-java copied to clipboard

Bug: Library not found for Arch64

Open FaultyxDx opened this issue 2 years ago • 7 comments

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

FaultyxDx avatar Mar 07 '23 07:03 FaultyxDx

Unfortunately, binding doesn't provide builds for arm/arch architectures.

SpaiR avatar Mar 09 '23 09:03 SpaiR

I would really like to have arm64 builds for macOS since that is a fairly common platform out there now.

ds58 avatar Apr 11 '23 22:04 ds58

I would also prefer to use this natively. In the meantime, you can install an x86 JVM which will run with Rosetta.

phraktle avatar Apr 15 '23 14:04 phraktle

+1

kles4enko avatar Apr 24 '23 11:04 kles4enko

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

phraktle avatar Apr 24 '23 11:04 phraktle

+1

LawrenceB5477 avatar Oct 06 '23 23:10 LawrenceB5477

#190 should solve this, but for anyone who wants a quick and dirty solution for Apple Silicon:

  1. Clone this repository
  2. Go to buildSrc/src/main/groovy/tool/generator/GenerateLibs.groovy
  3. 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)
  1. 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
  1. You'll find the native library under imgui-binding/build/libsNative/macosxarm64/libimgui-javaarm64.dylib
  2. When starting your application pass the following JVM options:
-Dimgui.library.path=./path/to/library/folder -Dimgui.library.name=libimgui-javaarm64.dylib
  1. Don't forget to also add the LWJGL native librariess for arm64 to your classpath

felouataoui avatar Jan 24 '24 17:01 felouataoui

Resolved #223 aarch64 support will be available in the next release

SpaiR avatar Aug 04 '24 21:08 SpaiR