Search code examples
bazelmediapipe

Where can I find the generated binaries when building MediaPipe from source?


I'm trying to build MediaPipe 0.8.5 from source on Ubuntu 20.04.6 LTS with Google Colab. Here are the detailed steps I tried

!git clone https://github.com/google/mediapipe.git
%cd mediapipe
!git checkout tags/v0.8.5
!bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1

The build command appeared to execute successfully, as indicated by the output logging.

enter image description here

However, I noticed that the 'bazel-bin' directory is empty. Where can I find the generated binaries?

I also tried

!bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 //mediapipe/examples/desktop/face_detection:face_detection_cpu

Analyzing: target //mediapipe/examples/desktop/face_detection:face_detection_c\ pu (1 packages loaded, 0 targets configured) currently loading: @bazel_tools//tools/cpp Fetching @rules_cc; fetching Fetching ...les_cc; Extracting /root/.cache/bazel/_bazel_root/847126637216\ ERROR: An error occurred during the fetch of repository 'rules_cc': Traceback (most recent call last): File "/root/.cache/bazel/_bazel_root/84712663721631c6211d09ab74d72aa8/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl download_info = ctx.download_and_extract( Error in download_and_extract: java.io.IOException: Error extracting /root/.cache/bazel/_bazel_root/84712663721631c6211d09ab74d72aa8/external/rules_cc/temp9801135472723615924/master.zip to /root/.cache/bazel/_bazel_root/84712663721631c6211d09ab74d72aa8/external/rules_cc/temp9801135472723615924: Prefix "rules_cc-master" was given, but not found in the archive. Here are possible prefixes for this archive: "rules_cc-main". Analyzing: target //mediapipe/examples/desktop/face_detection:face_detection_c
pu (1 packages loaded, 0 targets configured) currently loading: @bazel_tools//tools/cpp Fetching ...les_cc; Extracting /root/.cache/bazel/_bazel_root/847126637216\ ERROR: While resolving toolchains for target //mediapipe/examples/desktop/face_detection:face_detection_cpu: com.google.devtools.build.lib.packages.RepositoryFetchException: no such package '@rules_cc//cc': java.io.IOException: Error extracting /root/.cache/bazel/_bazel_root/84712663721631c6211d09ab74d72aa8/external/rules_cc/temp9801135472723615924/master.zip to /root/.cache/bazel/_bazel_root/84712663721631c6211d09ab74d72aa8/external/rules_cc/temp9801135472723615924: Prefix "rules_cc-master" was given, but not found in the archive. Here are possible prefixes for this archive: "rules_cc-main". Analyzing: target //mediapipe/examples/desktop/face_detection:face_detection_c
pu (1 packages loaded, 0 targets configured) currently loading: @bazel_tools//tools/cpp Fetching ...les_cc; Extracting /root/.cache/bazel/_bazel_root/847126637216\ ERROR: Analysis of target '//mediapipe/examples/desktop/face_detection:face_detection_cpu' failed; build aborted: com.google.devtools.build.lib.packages.RepositoryFetchException: no such package '@rules_cc//cc': java.io.IOException: Error extracting /root/.cache/bazel/_bazel_root/84712663721631c6211d09ab74d72aa8/external/rules_cc/temp9801135472723615924/master.zip to /root/.cache/bazel/_bazel_root/84712663721631c6211d09ab74d72aa8/external/rules_cc/temp9801135472723615924: Prefix "rules_cc-master" was given, but not found in the archive. Here are possible prefixes for this archive: "rules_cc-main". Analyzing: target //mediapipe/examples/desktop/face_detection:face_detection_c
pu (1 packages loaded, 0 targets configured) currently loading: @bazel_tools//tools/cpp Fetching ...les_cc; Extracting /root/.cache/bazel/_bazel_root/847126637216\ INFO: Elapsed time: 1.433s Analyzing: target //mediapipe/examples/desktop/face_detection:face_detection_c\ pu (1 packages loaded, 0 targets configured) currently loading: @bazel_tools//tools/cpp Fetching ...les_cc; Extracting /root/.cache/bazel/_bazel_root/847126637216\ INFO: 0 processes. Analyzing: target //mediapipe/examples/desktop/face_detection:face_detection_c\ pu (1 packages loaded, 0 targets configured) currently loading: @bazel_tools//tools/cpp Fetching ...les_cc; Extracting /root/.cache/bazel/_bazel_root/847126637216\ FAILED: Build did NOT complete successfully (1 packages loaded, 0 targets conf\ igured) currently loading: @bazel_tools//tools/cpp Fetching ...les_cc; Extracting /root/.cache/bazel/_bazel_root/847126637216\ FAILED: Build did NOT complete successfully (1 packages loaded, 0 targets conf\ igured) currently loading: @bazel_tools//tools/cpp Fetching ...les_cc; Extracting /root/.cache/bazel/_bazel_root/847126637216
31c6211d09ab74d72aa8/external/rules_cc/temp9801135472723615924/master.zip


Solution

  • You did not provide any target for Bazel to build, and therefore it successfully built nothing. Try building an example: bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 //mediapipe/examples/desktop/face_detection:face_detection_cpu.