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

Bug: Library not found for Arch64 #165

Open
FaultyxDx opened this issue Mar 7, 2023 · 7 comments
Open

Bug: Library not found for Arch64 #165

FaultyxDx opened this issue Mar 7, 2023 · 7 comments
Labels
3rd party Everything out of the Dear ImGui scope enhancement New feature or request

Comments

@FaultyxDx
Copy link

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 FaultyxDx added the bug Something isn't working label Mar 7, 2023
@FaultyxDx FaultyxDx changed the title Bug: Bug: Library not found for Arch64 Mar 7, 2023
@SpaiR
Copy link
Owner

SpaiR commented Mar 9, 2023

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

@SpaiR SpaiR added enhancement New feature or request api Connected with imgui-java API 3rd party Everything out of the Dear ImGui scope and removed bug Something isn't working api Connected with imgui-java API labels Mar 9, 2023
@ds58
Copy link

ds58 commented Apr 11, 2023

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

@phraktle
Copy link

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

@kles4enko
Copy link

+1

@phraktle
Copy link

phraktle commented Apr 24, 2023

some projects started using zig for easy cross-compilation of C code, eg. lmdbjava/lmdbjava#217
I suspect this would work C++ as well, see https://zig.news/kristoff/cross-compile-a-c-c-project-with-zig-3599

@LawrenceB5477
Copy link

+1

@felouataoui
Copy link

felouataoui commented Jan 24, 2024

#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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party Everything out of the Dear ImGui scope enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants