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.79k stars 5.18k forks source link

Build unsuccessful when I run build_desktop_examples.sh #2624

Closed Thushar-marvel closed 3 years ago

Thushar-marvel commented 3 years ago

Unable to build mediapipe in linux (ubuntu) I get error while running build_desktop_examples.sh file

/build_desktop_examples.sh app_dir: mediapipe/examples/desktop out_dir: . === Target: mediapipe/examples/desktop/face_detection:face_detection_cpu Starting local Bazel server and connecting to it... ... still trying to connect to local Bazel server after 10 seconds ... DEBUG: /home/thushar/.cache/bazel/_bazel_thushar/fea302e8c8b93ec8c2ae770cdccdcb8b/external/org_tensorflow/third_party/repo.bzl:109:14: Warning: skipping import of repository 'com_google_absl' because it already exists. DEBUG: /home/thushar/.cache/bazel/_bazel_thushar/fea302e8c8b93ec8c2ae770cdccdcb8b/external/org_tensorflow/third_party/repo.bzl:109:14: Warning: skipping import of repository 'com_google_protobuf' because it already exists. DEBUG: /home/thushar/.cache/bazel/_bazel_thushar/fea302e8c8b93ec8c2ae770cdccdcb8b/external/org_tensorflow/third_party/repo.bzl:109:14: Warning: skipping import of repository 'com_google_googletest' because it already exists. DEBUG: /home/thushar/.cache/bazel/_bazel_thushar/fea302e8c8b93ec8c2ae770cdccdcb8b/external/org_tensorflow/third_party/repo.bzl:109:14: Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists. DEBUG: /home/thushar/.cache/bazel/_bazel_thushar/fea302e8c8b93ec8c2ae770cdccdcb8b/external/org_tensorflow/third_party/repo.bzl:109:14: Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists. DEBUG: /home/thushar/.cache/bazel/_bazel_thushar/fea302e8c8b93ec8c2ae770cdccdcb8b/external/org_tensorflow/third_party/repo.bzl:109:14: Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists. DEBUG: /home/thushar/.cache/bazel/_bazel_thushar/fea302e8c8b93ec8c2ae770cdccdcb8b/external/org_tensorflow/third_party/repo.bzl:109:14: Warning: skipping import of repository 'build_bazel_apple_support' because it already exists. DEBUG: /home/thushar/.cache/bazel/_bazel_thushar/fea302e8c8b93ec8c2ae770cdccdcb8b/external/org_tensorflow/third_party/repo.bzl:109:14: Warning: skipping import of repository 'bazel_skylib' because it already exists. DEBUG: /home/thushar/.cache/bazel/_bazel_thushar/fea302e8c8b93ec8c2ae770cdccdcb8b/external/org_tensorflow/third_party/repo.bzl:109:14: Warning: skipping import of repository 'pybind11' because it already exists. INFO: Analyzed target //mediapipe/examples/desktop/face_detection:face_detection_cpu (118 packages loaded, 6504 targets configured). INFO: Found 1 target... INFO: Deleting stale sandbox base /home/thushar/.cache/bazel/_bazel_thushar/fea302e8c8b93ec8c2ae770cdccdcb8b/sandbox ERROR: /home/thushar/mediapipe/mediapipe/framework/formats/BUILD:190:11: C++ compilation of rule '//mediapipe/framework/formats:location' failed (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 56 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 56 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox In file included from ./mediapipe/framework/formats/location.h:44, from mediapipe/framework/formats/location.cc:15: ./mediapipe/framework/port/opencv_core_inc.h:18:10: fatal error: opencv2/core/version.hpp: No such file or directory 18 | #include <opencv2/core/version.hpp> | ^~~~~~ compilation terminated. Target //mediapipe/examples/desktop/face_detection:face_detection_cpu failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 1879.314s, Critical Path: 1734.01s INFO: 262 processes: 126 internal, 136 linux-sandbox. FAILED: Build did NOT complete successfully

sgowroji commented 3 years ago

Hi @Thushar-marvel, Could you please confirm this is duplicate of https://github.com/google/mediapipe/issues/496. If not can you share the system information details to investigate further. Thanks!

Thushar-marvel commented 3 years ago

@sgowroji I tried to the issue #496 .Even after altering ./mediapipe/third_party/opencv_linux.BUILD it didn't work for me.

Thushar-marvel commented 3 years ago

Device name LAPTOP-4P7IBL6V Processor Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz 2.40 GHz Installed RAM 8.00 GB (7.85 GB usable) Device ID E593A1D8-AE75-4009-BF6F-9E437572701F Product ID 00327-35852-62270-AAOEM System type 64-bit operating system, x64-based processor Pen and touch No pen or touch input is available for this display

Thushar-marvel commented 3 years ago

I have used Oracle VM virtual box manager to build virtual machine with ubuntu 20.04

I ran all the steps mentioned here Run the Hello World! in C++ example was successful

only the problem is when I run /build_desktop_examples.sh

tomleader commented 3 years ago

Well I had met some errors like yours... I think the key to solve is you should make sure your opencv should be installed successfully AND your environment variables should be set properly.

And the build_desktop_examples.sh is too much complicated and I suggest you can build single example(face_detection ,eg) to begin, if ok, then go to the other examples.

sgowroji commented 3 years ago

Hi @Thushar-marvel, Could you please confirm your opencv is installed and linked correctly!

Thushar-marvel commented 3 years ago

Thank you, I re installed OpenCV, its working fine for me now.

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

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