遵循此article。在执行命令的第4步
bazel build --cxxopt='--std=c++11' -c opt \
--fat_apk_cpu=x86,x86_64,arm64-v8a,armeabi-v7a \
//tensorflow/lite/java:tensorflow-lite
我遇到错误。日志输出如下。
ERROR: /home/robertas/projects/tensorflow/tensorflow/lite/java/src/main/native/BUILD:57:1: C++ compilation of rule '//tensorflow/lite/java/src/main/native:native' failed (Exit 1): clang failed: error executing command
(cd /home/robertas/.cache/bazel/_bazel_robertas/fc35d006e87d344d01f9b09aa9faf335/execroot/org_tensorflow && \
exec env - \
ANDROID_BUILD_TOOLS_VERSION=28.0.3 \
ANDROID_NDK_API_LEVEL=21 \
ANDROID_NDK_HOME=/home/robertas/opt/android/android-ndk-r15c \
ANDROID_SDK_API_LEVEL=28 \
ANDROID_SDK_HOME=/home/robertas/opt/android/sdk \
PATH=/home/robertas/opt/jdk1.8.0/bin:/home/robertas/opt/android/sdk/platform-tools:/home/robertas/opt/android/sdk/tools:/home/robertas/opt/android/sdk:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin:/home/robertas/.local/bin \
PWD=/proc/self/cwd \
PYTHON_BIN_PATH=/usr/bin/python \
PYTHON_LIB_PATH=/usr/lib/python3.7/site-packages \
TF_CONFIGURE_IOS=0 \
TF_DOWNLOAD_CLANG=1 \
external/androidndk/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -gcc-toolchain external/androidndk/ndk/toolchains/x86_64-4.9/prebuilt/linux-x86_64 -target x86_64-none-linux-android -ffunction-sections -funwind-tables -fstack-protector-strong -fPIC -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes -isystemexternal/androidndk/ndk/sysroot/usr/include/x86_64-linux-android '-D__ANDROID_API__=21' -O2 -g -DNDEBUG -MD -MF bazel-out/android-x86_64-opt/bin/tensorflow/lite/java/src/main/native/_objs/native/builtin_ops_jni.pic.d '-frandom-seed=bazel-out/android-x86_64-opt/bin/tensorflow/lite/java/src/main/native/_objs/native/builtin_ops_jni.pic.o' -fPIC -DEIGEN_MPL2_ONLY '-DEIGEN_MAX_ALIGN_BYTES=64' '-DEIGEN_HAS_TYPE_TRAITS=0' -iquote . -iquote bazel-out/android-x86_64-opt/bin -iquote external/flatbuffers -iquote bazel-out/android-x86_64-opt/bin/external/flatbuffers -iquote external/gemmlowp -iquote bazel-out/android-x86_64-opt/bin/external/gemmlowp -iquote external/androidndk -iquote bazel-out/android-x86_64-opt/bin/external/androidndk -iquote external/eigen_archive -iquote bazel-out/android-x86_64-opt/bin/external/eigen_archive -iquote external/local_config_sycl -iquote bazel-out/android-x86_64-opt/bin/external/local_config_sycl -iquote external/arm_neon_2_x86_sse -iquote bazel-out/android-x86_64-opt/bin/external/arm_neon_2_x86_sse -iquote external/fft2d -iquote bazel-out/android-x86_64-opt/bin/external/fft2d -iquote external/farmhash_archive -iquote bazel-out/android-x86_64-opt/bin/external/farmhash_archive -isystem tensorflow/lite/schema -isystem bazel-out/android-x86_64-opt/bin/tensorflow/lite/schema -isystem external/flatbuffers/include -isystem bazel-out/android-x86_64-opt/bin/external/flatbuffers/include -isystem external/eigen_archive -isystem bazel-out/android-x86_64-opt/bin/external/eigen_archive -isystem external/farmhash_archive/src -isystem bazel-out/android-x86_64-opt/bin/external/farmhash_archive/src '--std=c++11' -DFARMHASH_NO_CXX_STRING -Wno-sign-compare -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK '--sysroot=external/androidndk/ndk/platforms/android-21/arch-x86_64' -isystem external/androidndk/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem external/androidndk/ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/include -isystem external/androidndk/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -isystemexternal/androidndk/ndk/sysroot/usr/include -c tensorflow/lite/java/src/main/native/builtin_ops_jni.cc -o bazel-out/android-x86_64-opt/bin/tensorflow/lite/java/src/main/native/_objs/native/builtin_ops_jni.pic.o)
Execution platform: @bazel_tools//platforms:host_platform
In file included from tensorflow/lite/java/src/main/native/builtin_ops_jni.cc:17:
./tensorflow/lite/java/src/main/native/normalize.h:28:10: fatal error: 'absl/strings/str_cat.h' file not found
#include "absl/strings/str_cat.h"
^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Target //tensorflow/lite/java:tensorflow-lite failed to build
环境:Linux,Manjaro Illyria 18.0.4
该如何解决?