google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.29k stars 5.13k forks source link

HelloWorld on M1 Mac #2329

Closed pseudo-jay closed 3 years ago

pseudo-jay commented 3 years ago

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 -FBAZEL_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 '-DDATE="redacted"' '-DTIMESTAMP="redacted"' '-DTIME__="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 && idlecallback) { ^ 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.

sgowroji commented 3 years ago

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!

pseudo-jay commented 3 years ago

Thank you @sgowroji for pointing out. Cleaning Bazel cache and running Bazel again solved 404 error. But other errors still persist

LOG

Starting local Bazel server and connecting to it...
INFO: SHA256 (https://github.com/bazelbuild/rules_foreign_cc/archive/0.1.0.zip) = c2cdcf55ffaf49366725639e45dedd449b8c3fe22b54e31625eb80ce3a240f1e
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 <toplevel>
Repository rule http_archive defined at:
  /private/var/tmp/_bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
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.
INFO: SHA256 (https://github.com/bazelbuild/rules_cc/archive/main.zip) = 02413e4a077107711ecc21458432e7c9ba63e75e63f3fa84ae4da2d6b2c82700
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 <toplevel>
Repository rule http_archive defined at:
  /private/var/tmp/_bazel_jaykumarpatel/62b609b07bd6c5023ae21d4442fcc03e/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: Analyzed target //mediapipe/examples/desktop/hello_world:hello_world (61 packages loaded, 1527 targets configured).
INFO: Found 1 target...
INFO: From Linking external/com_google_absl/absl/types/libbad_optional_access.a:
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: bazel-out/darwin_arm64-fastbuild/bin/external/com_google_absl/absl/types/libbad_optional_access.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_absl/absl/types/libbad_variant_access.a:
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: bazel-out/darwin_arm64-fastbuild/bin/external/com_google_absl/absl/types/libbad_variant_access.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_absl/absl/flags/libflag.a:
warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: bazel-out/darwin_arm64-fastbuild/bin/external/com_google_absl/absl/flags/libflag.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From ProtoCompile mediapipe/calculators/internal/callback_packet_calculator.pb.h:
bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/src: warning: directory does not exist.
INFO: From ProtoCompile mediapipe/framework/tool/calculator_graph_template.pb.h:
bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/src: warning: directory does not exist.
INFO: From ProtoCompile mediapipe/framework/calculator.pb.h:
bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/src: warning: directory does not exist.
INFO: From ProtoCompile mediapipe/framework/calculator_profile.pb.h:
bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/src: warning: directory does not exist.
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/537/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:/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 \
    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/537/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: 73.456s, Critical Path: 32.62s
INFO: 716 processes: 182 internal, 534 darwin-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
sgowroji commented 3 years ago

@pseudo-jay it seems like your xcode command line tools is not installed. Can you verify it once.

pseudo-jay commented 3 years ago

@sgowroji Xcode command line tools are installed.

pseudo-jay commented 3 years ago

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.

jiuqiant commented 3 years ago

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. I personally don't have any devices to test. Apologize that I can't provide more useful information to address this issue.

pseudo-jay commented 3 years ago

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. I personally don't have any devices to test. Apologize that I can't provide more useful information to address this issue.

Thank You @jiuqiant. This Worked. I am closing this issue.

google-ml-butler[bot] commented 3 years ago

Are you satisfied with the resolution of your issue? Yes No

homuler commented 2 years ago

This error occurs because scheduler_queue.cc is not compiled as an Objective-C++ source file. That is, it does not match //mediapipe:apple but //conditions:default. https://github.com/google/mediapipe/blob/cf101e62a9d49a51be76836b2b8e5ba5c06b5da0/mediapipe/framework/BUILD#L974-L977

The following patch will make it meet //mediapipe:apple (cf. https://github.com/google/mediapipe/issues/1514#issuecomment-972786159).

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 = {