-
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
Failing to build macos dylib #2324
Comments
@sgowroji this looks like it is for building hand tracking on mac, not objectron. |
Yes I am trying to build it for mac which is where the issue lies. |
Any success with this @matthewn4444 ? I'm trying to do something similar right now and am having the same issue. |
This might be unrelated to For reference, I get the same issue building with The commented out line breaks the build.
Note: same result with My test.h/test.mm are really simple Obj-C files - a class with an NSString property. They work on their own. Adding the face_mesh calculator dependency busts the whole thing. Same error output as Matthew. For more info, from the face_mesh desktop example I can get a binary that runs with:
But adding |
@JacobMuchow I had met the same problem...I try to modify the --cpu option to darwin/darwin_x86_64 but still same error occur |
Think I am having the same issue on MacOS for both IOS and Mac targets |
Hi, From the issue on tensorflow (here), it's a problem with the cpuinfo. I managed to get my build compiling by adding a patch to tensorflow and manually editing XNNPack/cpuinfo.BUILD (when the error showed up). However simply renaming to 'darwin_x86_64' did not work (since setting cpu to either makes no difference), so I just removed the cpu dependency like below. This obviously isn't a good solution but I am unsure how the cpu variable is different being global in bazel when the cpuinfo build file is executed.
|
Hi @matthewn4444 , |
I am not anymore, I gave up and moved onto another project because I didnt think it was possible |
I'm hoping the mediapipe team addresses this issue soon. Until then, I wrote this article on how you can patch tensorflow so you can use |
Hello @matthewn4444, You can continue to use those legacy solutions in your applications if you choose. Though, we would request you to check new MediaPipe solutions which can help you more easily build and customize ML solutions for your applications. These new solutions will provide a superset of capabilities available in the legacy solutions. |
This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you. |
Hello @kuaashish , Your response has appeared in many older mediapipe issues. Although there may be a new MediaPipe API, unless the MediaPipe team plans to remove tensorflow and bazel from MediaPipe, this issue will remain. The full problem is described in the linked issue above. TL;DR FixAdd the diff --git a/apple/internal/transition_support.bzl b/apple/internal/transition_support.bzl
index 65f51b89..7da7ade3 100644
--- a/apple/internal/transition_support.bzl
+++ b/apple/internal/transition_support.bzl
@@ -102,6 +102,9 @@ def _cpu_string(*, cpu, platform_type, settings = {}):
return "ios_sim_arm64"
return "ios_x86_64"
if platform_type == "macos":
+ host_cpu = settings["//command_line_option:host_cpu"]
+ if host_cpu == "darwin":
+ return "darwin"
if cpu:
return "darwin_{}".format(cpu)
macos_cpus = settings["//command_line_option:macos_cpus"]
@@ -342,6 +345,7 @@ _apple_rule_common_transition_inputs = [
"//command_line_option:apple_crosstool_top",
]
_apple_rule_base_transition_inputs = _apple_rule_common_transition_inputs + [
+ "//command_line_option:host_cpu",
"//command_line_option:cpu",
"//command_line_option:ios_multi_cpus",
"//command_line_option:macos_cpus", |
I am not able to reproduce the issue with the given BUILD file. I do however have to change the minimum iOS version to 11.x to get the build to succeed. I am using XCode 14.2. That being said, the fix mentioned in #2324 (comment). I will follow up on bazelbuild/rules_apple#1954 Edit: I see that this only affects x86 Macs. I can try to repro this via our CI (which still has some Intel Macs). |
This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you. |
This issue was closed due to lack of activity after being marked stale for past 7 days. |
System information (Please provide as much relevant information as possible)
Describe the problem:
I am trying to build a dylib of mediapipe for external use on MacOS platform. I am trying to build the framework and a cpu calculator from tensorflow, you can see my BUILD snippet below
I am not sure why it doesnt work but then i get a message on top of tree master when building
I have also tried tensorflow/tensorflow#41039 to change the darwin value. Sometimes if i modify the cpuinfo bazel file I get errors to XNNPack not having dependencies on line 4278.
/private/var/tmp/_bazel_me/b39a9c2497bafb052e53d56396554a9a/external/XNNPACK/BUILD.bazel:4278:26: Configurable attribute "deps" doesn't match this configuration (would a default condition help?).
I believe it has something to do with XNNPack. I dont think I need XNNPack (or is it even supported?) on MacOS. This might be an issue with TensorFlow trying to build MacOS with XNNPack.
I also tried to change the
macos_dylib
tocc_binary
to build a ".dylib" and it builts but I cannot test it because I built with a newer version of MacOS and I get linking issues related to using this library built with the newest version of MacOS (not even sure it works anyways) because I cannot set the minimum macos version unless I usemacos_dylib
or evenapple_binary
.Any reason why this doesn't work?
**[Provide the exact sequence of commands / steps that you executed before running into the problem]
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --copt -fvisibility=hidden --linkopt -s --strip always --cxxopt=-std=c++17 --apple_platform_type=macos mediapipe/external:mediapipe_framework.dylib
The text was updated successfully, but these errors were encountered: