-
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
HelloWorld on M1 Mac #2329
Comments
The error is a 404 Not Found issue during downloading the external dependencies. Please check your network connection and retry. And also try the same steps with VPN if you have any gateway blocked while downloading the dependencies. Thanks! |
Thank you @sgowroji for pointing out. Cleaning Bazel cache and running Bazel again solved 404 error. But other errors still persist LOG
|
@pseudo-jay it seems like your xcode command line tools is not installed. Can you verify it once. |
@sgowroji Xcode command line tools are installed. |
I came across a similar question posted on StackOverflow (https://stackoverflow.com/questions/67660034/how-to-run-mediapipe-with-c-on-m1-mac) a month ago. No solutions yet. |
Looks like @autoreleasepool is not correctly expanded. Maybe you can hack https://github.com/google/mediapipe/blob/master/mediapipe/framework/scheduler_queue.cc#L29 to be "#define AUTORELEASEPOOL " to see if the error can be solved. MediaPipe currently doesn't have the official support of apple silicon devices. |
Thank You @jiuqiant. This Worked. I am closing this issue. |
This error occurs because The following patch will make it meet diff --git a/mediapipe/BUILD b/mediapipe/BUILD
index 1171ea6..72e4208 100644
--- a/mediapipe/BUILD
+++ b/mediapipe/BUILD
@@ -74,6 +74,7 @@ alias(
name = "macos",
actual = select({
":macos_i386": ":macos_i386",
+ ":macos_arm64": ":macos_arm64",
":macos_x86_64": ":macos_x86_64",
"//conditions:default": ":macos_i386", # Arbitrarily chosen from above.
}),
@@ -110,6 +111,15 @@ config_setting(
visibility = ["//visibility:public"],
)
+config_setting(
+ name = "macos_arm64",
+ values = {
+ "apple_platform_type": "macos",
+ "cpu": "darwin_arm64",
+ },
+ visibility = ["//visibility:public"],
+)
+
config_setting(
name = "macos_x86_64",
values = { |
SYSTEM INFORMATION
PROBLEM:
After installing all the required dependencies on M1 Mac, build fails when trying to build HelloWorld example.
STEPS TO REPRODUCE:
$ export GLOG_logtostderr=1
$ bazel run --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hello_world:hello_world --sandbox_debug --verbose_failures
LOG:
DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "c2cdcf55ffaf49366725639e45dedd449b8c3fe22b54e31625eb80ce3a240f1e"
DEBUG: Repository rules_foreign_cc instantiated at:
/Users/jaykumarpatel/development/mediapipe-0.8.6/WORKSPACE:42:13: in
Repository rule http_archive defined at:
/private/var/tmp/_bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in
WARNING: Download from http://mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/cf1e44edb908e9616030cc83d085989b8e6cd6df.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
WARNING: Download from http://mirror.tensorflow.org/github.com/tensorflow/runtime/archive/44c890cd46fd9aad2b3bf4b13c5f36d8cff795c3.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
DEBUG: /private/var/tmp/_bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: /private/var/tmp/_bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: /private/var/tmp/_bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: /private/var/tmp/_bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: /private/var/tmp/_bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: /private/var/tmp/_bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists.
DEBUG: /private/var/tmp/_bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'build_bazel_apple_support' because it already exists.
DEBUG: /private/var/tmp/_bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'bazel_skylib' because it already exists.
DEBUG: /private/var/tmp/bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/external/org_tensorflow/third_party/repo.bzl:108:14:
Warning: skipping import of repository 'pybind11' because it already exists.
DEBUG: /private/var/tmp/bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/external/tf_runtime/third_party/cuda/dependencies.bzl:51:10: The following command will download NVIDIA proprietary software. By using the software you agree to comply with the terms of the license agreement that accompanies the software. If you do not agree to the terms of the license agreement, do not use the software.
DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "02413e4a077107711ecc21458432e7c9ba63e75e63f3fa84ae4da2d6b2c82700"
DEBUG: Repository rules_cc instantiated at:
/Users/jaykumarpatel/development/mediapipe-0.8.6/WORKSPACE:36:13: in
Repository rule http_archive defined at:
/private/var/tmp/bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in
INFO: Analyzed target //mediapipe/examples/desktop/hello_world:hello_world (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /Users/jaykumarpatel/development/mediapipe-0.8.6/mediapipe/framework/BUILD:974:11: Compiling mediapipe/framework/scheduler_queue.cc failed: (Aborted): sandbox-exec failed: error executing command
(cd /private/var/tmp/bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/sandbox/darwin-sandbox/629/execroot/mediapipe &&
exec env -
APPLE_SDK_PLATFORM=MacOSX
APPLE_SDK_VERSION_OVERRIDE=11.3
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
PATH=/Users/jaykumarpatel/Library/Caches/bazelisk/downloads/bazelbuild/bazel-4.1.0-darwin-arm64/bin:/opt/homebrew/opt/opencv@3/bin:/Users/jaykumarpatel/opt/anaconda3/bin:/Users/jaykumarpatel/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/opt/homebrew/bin:/Users/jaykumarpatel/development/flutter/bin:/Users/jaykumarpatel/Library/Android/sdk/platform-tools:/opt/homebrew/bin:/Users/jaykumarpatel/development/flutter/bin:/Users/jaykumarpatel/Library/Android/sdk/platform-tools
SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk
TMPDIR=/var/folders/v4/qvmf09d14n7b9fy362850sx80000gp/T/
XCODE_VERSION_OVERRIDE=12.5.1.12E507
/usr/bin/sandbox-exec -f /private/var/tmp/bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/sandbox/darwin-sandbox/629/sandbox.sb /var/tmp/bazel_jaykumarpatel/install/d0b631b3e5a643567f221e133629d965/process-wrapper '--timeout=0' '--kill_delay=15' external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -O0 -DDEBUG '-std=c++11' 'DEBUG_PREFIX_MAP_PWD=.' -g -iquote . -iquote bazel-out/darwin_arm64-fastbuild/bin -iquote external/com_github_glog_glog -iquote bazel-out/darwin_arm64-fastbuild/bin/external/com_github_glog_glog -iquote external/com_github_gflags_gflags -iquote bazel-out/darwin_arm64-fastbuild/bin/external/com_github_gflags_gflags -iquote external/com_google_absl -iquote bazel-out/darwin_arm64-fastbuild/bin/external/com_google_absl -iquote external/com_google_protobuf -iquote bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf -iquote external/zlib -iquote bazel-out/darwin_arm64-fastbuild/bin/external/zlib -Ibazel-out/darwin_arm64-fastbuild/bin/external/com_github_glog_glog/virtual_includes/default_glog_headers -Ibazel-out/darwin_arm64-fastbuild/bin/external/com_github_gflags_gflags/virtual_includes/gflags -isystem external/com_google_protobuf/src -isystem bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/src -isystem external/zlib -isystem bazel-out/darwin_arm64-fastbuild/bin/external/zlib -MD -MF bazel-out/darwin_arm64-fastbuild/bin/mediapipe/framework/objs/scheduler_queue/scheduler_queue.d -DMEDIAPIPE_PROFILER_AVAILABLE '-DMEDIAPIPE_DISABLE_GPU=1' '-frandom-seed=bazel-out/darwin_arm64-fastbuild/bin/mediapipe/framework/objs/scheduler_queue/scheduler_queue.o' -isysroot BAZEL_XCODE_SDKROOT -F__BAZEL_XCODE_SDKROOT/System/Library/Frameworks -F__BAZEL_XCODE_DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/Library/Frameworks '-mmacosx-version-min=11.3' -w '-std=c++17' -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE="redacted"' '-D__TIMESTAMP="redacted"' '-D__TIME="redacted"' -target arm64-apple-macosx -c mediapipe/framework/scheduler_queue.cc -o bazel-out/darwin_arm64-fastbuild/bin/mediapipe/framework/objs/scheduler_queue/scheduler_queue.o)
mediapipe/framework/scheduler_queue.cc:212:3: error: expected expression
AUTORELEASEPOOL {
^
mediapipe/framework/scheduler_queue.cc:29:25: note: expanded from macro 'AUTORELEASEPOOL'
#define AUTORELEASEPOOL @autoreleasepool
^
mediapipe/framework/scheduler_queue.cc:226:5: error: use of undeclared identifier 'is_idle'
is_idle = IsIdle();
^
mediapipe/framework/scheduler_queue.cc:228:7: error: use of undeclared identifier 'is_idle'
if (is_idle && idle_callback) {
^
3 errors generated.
Error in child process '/usr/bin/xcrun'. 1
Target //mediapipe/examples/desktop/hello_world:hello_world failed to build
INFO: Elapsed time: 1.495s, Critical Path: 1.39s
INFO: 14 processes: 8 internal, 6 darwin-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
Please let me know if you need any more details regarding the installed dependencies.
The text was updated successfully, but these errors were encountered: