Code Monkey home page Code Monkey logo

Comments (12)

stephengold avatar stephengold commented on May 20, 2024 1

I discovered a 3rd-party plugin that might help: https://docs.nokee.dev

from libbulletjme.

stephengold avatar stephengold commented on May 20, 2024

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.

from libbulletjme.

riccardobl avatar riccardobl commented on May 20, 2024

Do you know one that does?

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.

from libbulletjme.

stephengold avatar stephengold commented on May 20, 2024

That's fine for building natives, but I also want to test them.

from libbulletjme.

stephengold avatar stephengold commented on May 20, 2024

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...

from libbulletjme.

stephengold avatar stephengold commented on May 20, 2024

Got stuck on a Gradle crash:

A problem occurred configuring root project 'Libbulletjme'.
> Exception thrown while executing model rule: NativeBinaryRules#assignTools(NativeBinarySpec, NativeToolChainRegistryInternal, ProjectLayout)
   > A problem occurred starting process 'command 'xcrun''

Will try migrating to the "cpp-library" plugin...

from libbulletjme.

stephengold avatar stephengold commented on May 20, 2024

Apparently Gradle v7.3.3 only knows 2 values for class MachineArchitecture: X86 and X86_64!

from libbulletjme.

riccardobl avatar riccardobl commented on May 20, 2024

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 ?

from libbulletjme.

stephengold avatar stephengold commented on May 20, 2024

Thanks for the link to issue 989.

I'm still pursuing multiple approaches. I've been using Xcode 13.2.1.

from libbulletjme.

stephengold avatar stephengold commented on May 20, 2024

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.

from libbulletjme.

stephengold avatar stephengold commented on May 20, 2024

I've found a mechanism

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.

from libbulletjme.

stephengold avatar stephengold commented on May 20, 2024

Native libraries for MacOSX_ARM64 became available on 2 March 2022, with the release of Libbulletjme 14.0.0 .
They were added to Minie at 04178cf5cd15e8200088e4cd4390d90723567c01 .
Support for Minie on MacOSX_ARM64 platforms became generally available on 20 March 2022, with the release of Minie v4.8.0 .
Note that, for native physics to work on JME, v3.5.1-stable (or later) is required.

from libbulletjme.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.