-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
How to build for macOS x86_64 from M1 #3932
Comments
Hi @joliveraortega, |
I finally managed to build for the two macOS archs (x86_64 and arm64) from my M1. Not sure the way I did is the correct one (or the one you should follow when trying this). Long story short; I used Some context; I am building Mediapipe
diff --git a/BUILD.bazel b/BUILD.bazel
index 2e71597..1c0e2e2 100755
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -13979,7 +13979,7 @@ config_setting(
name = "macos_x86_64",
values = {
"apple_platform_type": "macos",
- "cpu": "darwin",
+ "cpu": "darwin_x86_64",
},
)
Without these patches you get the "Configurable attribute "srcs" doesn't match this configuration (would a default condition help?)." error. I would love to hear from you guys what's the "official" way to build for the two macOS archs from a M1. IMO the way I managed to build them is a bit tricky and guess there has to be another straightforward way. |
Hi @joliveraortega, |
I guess you mean it is not officially supported building for macOS x86_64 from M1. If anyone follows https://google.github.io/mediapipe/getting_started/install.html#installing-on-macos the build process has no problems for M1 as a host/execution/target platform. Glad this could help others. Thanks for following up on this with me. I appreciate it. You can close the issue. I will reopen it in case it is needed because any other issue from my end about this. Cheers. |
Congratulations!!! Could you tell us details how you did this? Eg: What was the command? How did you extract the library & use it to Xcode macOS project? It'll be helpful for us. Thanks. |
Hi there!
I am sorry I am asking this here this silly question but I am new to Bazel and how Bazel works when building Mediapipe. I have a M1 so any sample gets build for arm64. I wonder how to build for x86_64 from M1. I have tried a bunch of command line combinations and read here and there but I am not able to see the final binary built for x86_64. I am not actually interested on building samples but a library in a form of a universal binary for macOS.
Looking forward to hear from you guys. Thanks in advance.
The text was updated successfully, but these errors were encountered: