首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用c++在M1 mac上运行mediapipe

如何使用c++在M1 mac上运行mediapipe
EN

Stack Overflow用户
提问于 2021-05-23 13:01:01
回答 1查看 1.9K关注 0票数 5

环境

Macbook M1 2020。

大南方11.3.1

我想做什么

我想成功运行下面的"mediapipe c++ hello_world“。https://google.github.io/mediapipe/getting_started/install.html#installing-on-macos

我尝试了以下尝试,但失败了。

try1

只要遵循指导方针

https://google.github.io/mediapipe/getting_started/install.html#installing-on-macos

  • 4. OpenCV和FFmpeg。=> I使用option1.

错误

在第6课中,我遇到了下面的一个错误。

代码语言:javascript
复制
// run lesson 6
mediapipe % bazel run --define MEDIAPIPE_DISABLE_GPU=1 \
    mediapipe/examples/desktop/hello_world:hello_world
2021/05/23 21:06:14 Downloading https://releases.bazel.build/3.7.2/release/bazel-3.7.2-darwin-arm64...
2021/05/23 21:06:16 could not download Bazel: HTTP GET https://releases.bazel.build/3.7.2/release/bazel-3.7.2-darwin-arm64 failed with error 404
mediapipe %

try2

bazel-3.7.2-darwin-arm64 bug”说bazel试图从github版本下载try1。

但是,发行版3.7.2没有达尔文-arm64的类型。

https://github.com/bazelbuild/bazel/releases/tag/3.7.2

幸运的是,版本4.1.0的类型为达尔文-arm64 64。

https://github.com/bazelbuild/bazel/releases/tag/4.1.0

然后我尝试下载bazel-4.1.0-darwin-arm64.

在根存储库"mediapipe“中,将".bazelversion”文件修复如下。

代码语言:javascript
复制
4.1.0

然后,重试第6课,开始下载。

错误

但是下载没有成功:我得到了另一个bug,如下所示。

代码语言:javascript
复制
// run lesson 6 again
mediapipe % bazel run --define MEDIAPIPE_DISABLE_GPU=1 \
    mediapipe/examples/desktop/hello_world:hello_world

~~download process~~

ERROR: /Users/<some_mid_path>/mediapipe/mediapipe/framework/BUILD:971:11: Compiling mediapipe/framework/scheduler_queue.cc failed: (Aborted): wrapped_clang failed: error executing command 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' ... (remaining 60 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
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
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.430s, Critical Path: 1.26s
INFO: 4 processes: 3 internal, 1 darwin-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

mediapipe % 

现在形势

然后我暂时放弃了,向你提问!

有人能解决这个问题吗?

提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2021-08-14 04:26:12

我成功地构建了HelloWorld.cc精细。

我还在M1 MAC上编译了Android。NDK版本和权限有一些问题,但最终它编译并在我的S8 +上运行。

我的圈套

  • MacBook Pro (13英寸,M1,2020)
  • macOS Big Sur 11.5.1
  • ndk版本: r20b (手动下载并编辑到ndk的工作区路径)

在第一次编译期间,您将得到许多权限错误问题,在构建过程中进入并保持打开状态>系统首选项>安全性和隐私>一般。

当出现错误时,允许继续并重新启动生成。在构建之前将获得大约8-10个权限。

下面的是构建过程的最后一部分.

代码语言:javascript
复制
Warning: skipping import of repository 
'build_bazel_apple_support' because it already exists.

DEBUG: /private/var/tmp/_bazel_jeranio/794c1b4078a0aeb97ae7a379447a99a6/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_jeranio/794c1b4078a0aeb97ae7a379447a99a6/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'pybind11' because it already exists.

DEBUG: /private/var/tmp/_bazel_jeranio/794c1b4078a0aeb97ae7a379447a99a6/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: Analyzed target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/handtrackinggpu:handtrackinggpu (0 packages loaded, 0 targets configured).
INFO: Found 1 target...

Target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/handtrackinggpu:handtrackinggpu up-to-date:
  bazel-bin/mediapipe/examples/android/src/java/com/google/mediapipe/apps/handtrackinggpu/handtrackinggpu_deploy.jar
  bazel-bin/mediapipe/examples/android/src/java/com/google/mediapipe/apps/handtrackinggpu/handtrackinggpu_unsigned.apk
  bazel-bin/mediapipe/examples/android/src/java/com/google/mediapipe/apps/handtrackinggpu/handtrackinggpu.apk
INFO: Elapsed time: 2.984s, Critical Path: 0.97s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action

jeranio at Jerrys-MacBook-Pro in ~/mediapipe on master [!?]
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67660034

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档