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

Ability to build Intel + M1 compatible plugin or at least Universal Plugin from M1 Mac? #611

Closed
ROBYER1 opened this issue Jun 16, 2022 · 4 comments · Fixed by #625
Closed
Assignees
Labels
host:macos Issue that occurs when host OS is macOS platform:standalone Issue that occurs when the target platform is PC standalone sect:plugin Issue about plugin's source code type:feature New feature or request

Comments

@ROBYER1
Copy link
Contributor

ROBYER1 commented Jun 16, 2022

Feature Description

Mentioned in this issue #501 I am struggling to make an Intel compatible build or a build which runs on both Intel and M1 macs from building on an M1 mac I have access to.

Is there a way to build both the Intel and M1 compatible plugins from the M1 mac or even a Universal plugin as mentioned in the issue linked above?

Current Behaviour/State

Requires use of a separate Intel and M1 Mac to build the separate plugins, then I assume use lipo -create -output libmediapipe_c.so libmediapipe_c_x86.so libmediapipe_c_arm.so to combine them into a Universal plugin?

@ROBYER1 ROBYER1 added the type:feature New feature or request label Jun 16, 2022
@homuler homuler added platform:standalone Issue that occurs when the target platform is PC standalone sect:plugin Issue about plugin's source code host:macos Issue that occurs when host OS is macOS labels Jun 17, 2022
@homuler
Copy link
Owner

homuler commented Jun 17, 2022

Is there a way to build both the Intel and M1 compatible plugins from the M1 mac or even a Universal plugin as mentioned in the issue linked above?

Theoretically, yes.
However, there is currently no way to cross-compile without changing the source files (i.e. both Intel mac and M1 mac are required).

@ROBYER1
Copy link
Contributor Author

ROBYER1 commented Jun 17, 2022

Is there a way to build both the Intel and M1 compatible plugins from the M1 mac or even a Universal plugin as mentioned in the issue linked above?

Theoretically, yes. However, there is currently no way to cross-compile without changing the source files (i.e. both Intel mac and M1 mac are required).

I spent over a week looking into why an M1 built Mediapipe plugin would work sometimes on an intel Mac - Can I request that in the Mac build section of the Wiki or somewhere else it could be mentioned that the build plugin will be intel/M1 only and that the Apple lipo -create -output libmediapipe_c.so libmediapipe_c_x86.so libmediapipe_c_arm.so command can be used on the two plugins if they are renamed appropriately (I assume rename the dylib file?) to put them together into a universal plugin for MacOS?

@homuler
Copy link
Owner

homuler commented Jun 27, 2022

Now we can build a universal library on M1 Mac or Intel Mac.

python build.py build --desktop cpu --opencv cmake --macos_universal -vv

Note that NEON will be disabled when building it on Intel Mac.

@ROBYER1
Copy link
Contributor Author

ROBYER1 commented Jun 27, 2022

Now we can build a universal library on M1 Mac or Intel Mac.

python build.py build --desktop cpu --opencv cmake --macos_universal -vv

Note that NEON will be disabled when building it on Intel Mac.

This is fantastic news, thanks for your hard work on this plugin as always! Mac development is a serious pain sometimes so this is a huge help ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host:macos Issue that occurs when host OS is macOS platform:standalone Issue that occurs when the target platform is PC standalone sect:plugin Issue about plugin's source code type:feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants