-
Notifications
You must be signed in to change notification settings - Fork 1
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
macosx-arm64 support #3
Comments
Hello, Thanks for reporting this. I have not been tracking issues here. I do not have a Mac so it's hard for me to validate the Mac build. If you have a fix I'd love to see it! We might want to just ship libassimp and libpng in the jar. |
It's been a few months since I've looked at this. I wasn't able to get the build to run in github's CI, but I don't quite remember what steps are remaining. I'll have to look into it again once I get some free time.
Is there a more convenient place to discuss the project? clj-manifold3d is a really neat project and would be a great complement to clj-webgpu that I've been playing with. |
The new release (1.1.1) removed the need for libassimp and other shared object deps. Hopefully the osx support is better now. idk much about what would be required to compile for arm64. |
Very cool! Thanks! I'll try and see if I can make a github CI build working next week. |
@cartesian-theatrics, Ok, so I was able to build the latest locally. Several classes and field names changed, but after working through those issues it seemed to work ok locally. I tried building the library using github CI, but the shared libraries still aren't portable to non build machines. The install names for libfreetype, libassimp, and libpng are still hard coded to absolute paths. I think the following bash commands should fix the paths: install_name_tool -id '@rpath/libfreetype.6.16.0.dylib' libfreetype.6.16.0.dylib
install_name_tool -change /opt/homebrew/opt/libpng/lib/libpng16.16.dylib '@rpath/libpng16.16.dylib' libfreetype.6.16.0.dylib
install_name_tool -change /opt/homebrew/opt/harfbuzz/lib/libharfbuzz.0.dylib '@rpath/libharfbuzz.0.dylib' libfreetype.6.16.0.dylib
install_name_tool -change /opt/homebrew/opt/assimp/lib/libassimp.5.dylib '@rpath/libassimp.5.dylib' libmeshIO.dylib
install_name_tool -change /Users/runner/work/manifold/manifold/build/_deps/freetype2-build/libfreetype.6.dylib '@rpath/libfreetype.6.dylib' libmeshIO.dylib However, I'm not really sure how to run these commands inside the build process. One option might be to add a build step to |
Thanks for diving into this! I'm busy for the next couple days, but I'll try to get an MR up soon against the java bindings repo where we can debug this. We can add stages to inspect build artifacts and hopefully go from there. |
I decided to try a few more things. The above is not quite right, but with a few tweaks, I was able to set the rpath. However, setting the rpath doesn't seem to help much. In the past, that has been useful for other libraries 3rd party libraries that might be in other jars, but it doesn't seem to help for libraries that are expected to provided on the system path. I've been googling, but haven't found any way around this other than one of the following:
|
Another option that seems to work is to update the dependent paths in |
Hi y'all, I'm late to the party but also trying to build and run this on an M1 Mac. @cartesian-theatrics What's the intended way to build your fork? I didn't see much in the README and wasn't sure if the next stuff in the repo is necessary or not. (I know nothing about Nix.) FWIW in case anyone else comes along, here's what worked for me on SovereignShop/manifold@bb3d3e4:
Then I was able to fire up a REPL with this deps.edn: {:paths ["src/"]
:deps {org.clojure/clojure {:mvn/version "1.12.0"}
org.clojure/core.match {:mvn/version "1.0.1"}
org.clojars.cartesiantheatrics/clj-manifold3d {:mvn/version "1.1.1"}
org.clojars.cartesiantheatrics/manifold3d$mac-arm {:local/root "/Users/dev/software/manifold-jni/bindings/java/target/manifold3d-0.0.1-mac-arm.jar"}}
:aliases {:dev {:extra-paths ["dev/" "test/"]}}} And the full build log.txt |
@lynaghk That's essentially the same steps I used. The only thing I would add is that I believe you also need |
I've recently been playing with a wrapper for webgpu and the clj-manifold3d project seems like a natural complement for generating meshes. I was able to get it to work by compiling manifold locally, but it would be great have native jars for arm64.
I started work on updating the github workflow to work on mac osx, but I did run into some complications, https://github.com/phronmophobic/manifold.
I'm not sure how interested you would be in a pull request that fixes these issues, but I could send a cleaned up patch once I get it working if you are. Thanks for the library!
The text was updated successfully, but these errors were encountered: