google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://mediapipe.dev
Apache License 2.0
26.8k stars 5.09k forks source link

C++ compilation error when building mp_multi_hand_aar #863

Closed AlexYiningLiu closed 4 years ago

AlexYiningLiu commented 4 years ago

I followed the instructions on building custom AAR found at https://google.github.io/mediapipe/getting_started/android_archive_library.html I modified the BUILD file in mediapipe/graph/hand_tracking to include a gpu_buffer_to_image_frame_calculator, and I'm trying to compile a new AAR file to put in the libs directory of the multi_hand_tracking AAR example app found here: https://github.com/jiuqiant/mediapipe_multi_hands_tracking_aar_example.

However, when I ran the bazel build command, I received this error which terminated compilation after nearly 2 hours.

ERROR: /home/alex715/mediapipe/mediapipe/calculators/tflite/BUILD:269:11: C++ compilation of rule '//mediapipe/calculators/tflite:tflite_converter_calculator' failed (Exit 1) clang failed: error executing command external/androidndk/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -gcc-toolchain external/androidndk/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 -target ... (remaining 138 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
Target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/aar_example:mp_multi_hand_aar failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 6692.317s, Critical Path: 6020.05s
INFO: 1621 processes: 1565 linux-sandbox, 56 worker.
FAILED: Build did NOT complete successfully

I am running this on a Ubuntu virtual machine. Please let me know if this problem can be fixed. Thank you.

jiuqiant commented 4 years ago

Can you show the full log? From you comment, we only see that it's caused by mediapipe/calculators/tflite:tflite_converter_calculator.

I guess the slowness of the build process is caused by downloading dependency libraries such as opencv android sdk and tensorflow repo?

AlexYiningLiu commented 4 years ago

A fuller log is found here. Sorry for the poor quality. I have been able to compile apk in Linux and decided to go with that instead of creating AAR files for use in Windows. However, if there is a solution to this AAR compilation problem it would be appreciated too. Thanks.

image

jiuqiant commented 4 years ago

Unfortunately, the log doesn't show the error details. If you have time, could you append --verbose_failures to the build command to let it print the full command line for commands that failed and report back?