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

Support macOS apple silicon #1

Merged
merged 7 commits into from
Mar 9, 2024
Merged

Conversation

TotemaT
Copy link

@TotemaT TotemaT commented Mar 7, 2024

Hello !

First of all, thanks for the project; it's exactly what I needed for a project :)

I tweaked your scripts to allow building for macOS with arm64/apple silicon chips.

I then built it locally using the commands I found in your github workflow and tested it by running the example provided. (I also changed the URL for the pre-built binaries in setup.dart to fetch from my localhost while I was testing 👍)

Tested on a MacBook pro with an Apple M1 Pro running macOS Sonoma 14.3.1

Hope that can be merged/released soon, keep me updated if you need more info for this pull request or if you want me to test more stuff on macOS 👍

@rainyl
Copy link
Owner

rainyl commented Mar 8, 2024

Great! Thanks for your PR, I will test it as soon as possible.
BTW, I am not familiar with Apple development, so I want to know whether it is possible to build a arm64 library on x64 macos?

@TotemaT
Copy link
Author

TotemaT commented Mar 8, 2024

I don't know, but I guess it should be possible.

On the other hand, I can tell you that building (and running, through Rosetta) a x64 library on an Apple silicon device is possible - which is good since intel/x64 macs have been (or are being) discontinued by Apple

@rainyl rainyl merged commit d3eae02 into rainyl:main Mar 9, 2024
@rainyl
Copy link
Owner

rainyl commented Mar 9, 2024

Finally, I didn't managed to compile arm64 libraries on x86_64 macos, but fortunately, github provided arm-based macos image, with macos-14 image, arm64-based library was successfully compiled.

Thanks for your contributions, I have published v0.6.3 to pub.dev, note the setup.dart was also refactored, now update opencv_dart to v0.6.3 and run dart run opencv_dart:setup macos --arch arm64 to download prebuilt binary and test it.

If you have any problems, you can open an issue or try to fix it and open a new PR.

@TotemaT
Copy link
Author

TotemaT commented Mar 9, 2024

The install and setup went flawlessly, my app built and ran as expected with the new version !

Thanks a lot, I'll let you know if I encounter any issue while using your library 😁

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants