-
Notifications
You must be signed in to change notification settings - Fork 9
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
Mac M1 support #15
Comments
Indeed, I was planning to investigate this after JME 3.5.0 is done. A solution to this issue should ideally include continuous integration to build and test the native libraries, but none of my current CI providers (GitHub Actions, TravisCI, Appveyor) offers Mac-on-ARM hosts. Do you know one that does? (Preferably one that's free for open-source projects.) Upgrading the project to Gradle 7 will be tricky. I tried once before and gave up, so I hope it's not necessary. |
I don't, but x86_64 mac can crosscompile to arm64 (aarch64) if the target platform is provided, so i guess it will just work if configured in gradle. |
That's fine for building natives, but I also want to test them. |
I started my investigation in the new "gradle7" branch. Gradle 7 builds work fine (aside from some Gradle warnings) for all platforms except MacOSX_ARM64, which was skipped when I expected it to be built. I suspect that's because this project still uses the "cpp" plugin (incubated in Gradle 4) instead of the "cpp-library" plugin (from Gradle 5+). Probably the "cpp" plugin hasn't been updated to cross-compile using XCode. Perhaps I can work around this without switching plugins... |
Got stuck on a Gradle crash:
Will try migrating to the "cpp-library" plugin... |
Apparently Gradle v7.3.3 only knows 2 values for |
It seems cpp-library doesn't have support for cross compilation to arm: gradle/gradle-native#989 Is it possible to inject "-arch arm64" for clang using the old cpp plugin ? Maybe that could work? Also i guess you are testing this on the CI, is it using the last xcode version ? |
Thanks for the link to issue 989. I'm still pursuing multiple approaches. I've been using Xcode 13.2.1. |
I've found a mechanism in the "cpp" plugin to inject command-line args into Gcc and Clang toolchains, like so: clangArm64(Clang) {
target('MacOS_ARM64') {
cppCompiler.arguments('-arch arm64')
linker.arguments('-arch arm64')
}
} The catch is that the "cpp" plugin doesn't allow the macOS hosts I'm using to build for target platforms with "arm64" or "aarch64" architecture, though it allows them to build for both "x86" and "x86_64". "cpp" doesn't place such restrictions on Linux hosts. |
Actually that doesn't work. Cross-compiling in Gradle is hard, especially for me with my ignorance of the Groovy language. I'll add a target to "build.gradle" so you can try building your own natives on a Mac M1. However, I can't guess when pre-built native libraries will be available. |
I discovered a 3rd-party plugin that might help: https://docs.nokee.dev |
Native libraries for MacOSX_ARM64 became available on 2 March 2022, with the release of Libbulletjme 14.0.0 . |
M1 support should be available in gradle since version 7.
Bullet should compile and work, since it is already compatible with linux arm64, my understanding is that the build script needs to be modified to include a target for
I don't know how to do it, but if someone does i can test.
The text was updated successfully, but these errors were encountered: