-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
I have a version of TFLite v1.13.1 built for Android:
$ ck install package --tags=lib,tflite,v1.13.1 --target_os=android24-arm64
...
$ ck show env --tags=lib,tflite,target-os-android24-arm64,compiled-by-llvm-android-ndk-3.8.256229
Env UID: Target OS: Bits: Name: Version: Tags:
8caa447331219f22 android24-arm64 64 TensorFlow Lite API (from sources, static) 1.13.1 64bits,channel-stable,compiled-by-llvm-android-ndk,compiled-by-llvm-android-ndk-3.8.256229,host-os-linux-64,lib,lite,target-os-android24-arm64,tensorflow,tensorflow-lite,tensorflow-static,tflite,v1,v1.13,v1.13.1,vsrc,vstatic
As indicated by the tags, it's compiled with Clang 3.8 in Android NDK (r13b):
$ ck show env --tags=compiler,lang-cpp,llvm,target-os-android24-arm64,v3.8.256229
Env UID: Target OS: Bits: Name: Version: Tags:
9d67d461bb5e069d android24-arm64 64 Android NDK LLVM compiler 3.8.256229 64bits,android,compiler,host-os-linux-64,lang-c,lang-cpp,llvm,ndk,target-os-android24-arm64,v3,v3.8,v3.8.256229
Cross-compiling program:image-classification-tflite for Android fails:
$ ck compile program:image-classification-tflite --target_os=android24-arm64 --deps.compiler=9d67d461bb5e069d
...
clang++ -c -fPIE -pie -target aarch64-linux-android -gcc-toolchain /home/anton/data/android-ndk-r13b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 --sysroot=/home/anton/data/android-ndk-r13b
/platforms/android-24/arch-arm64 -I../ -DCK_HOST_OS_NAME2_LINUX=1 -DCK_HOST_OS_NAME_LINUX=1 -DCK_TARGET_OS_NAME2_ANDROID=1 -DCK_TARGET_OS_NAME_LINUX=1 -std=c++11 -DTF_LITE_1_13 -Wall -Wno-sign-compare -
I/home/anton/data/android-ndk-r13b/toolchains/llvm/prebuilt/linux-x86_64/include -I/home/anton/CK_TOOLS/lib-rtl-xopenme-0.3-android-ndk-4.9.x-android24-arm64/include -I/home/anton/data/android-ndk-r13b/so
urces/cxx-stl/gnu-libstdc++/include -I/home/anton/data/android-ndk-r13b/sources/cxx-stl/gnu-libstdc++/libs/arm64-v8a/include -I/home/anton/CK_TOOLS/lib-tflite-src-static-1.13.1-llvm-android-ndk-3.8.256229
-android24-arm64/src -I/home/anton/CK_TOOLS/lib-tflite-src-static-1.13.1-llvm-android-ndk-3.8.256229-android24-arm64/src/tensorflow/lite/tools/make/downloads/flatbuffers/include ../classification.cpp -o
classification.o
clang++: warning: argument unused during compilation: '-pie'
In file included from ../classification.cpp:9:
../benchmark.h:14:10: fatal error: 'chrono' file not found
#include <chrono>
^
1 error generated.
Inspecting the environment reveals what the problem is:
$ ck cat env --tags=compiler,lang-cpp,llvm,target-os-android24-arm64,v3.8.256229 | grep INCLUDE
export CK_ENV_COMPILER_LLVM_INCLUDE=/home/anton/data/android-ndk-r13b/toolchains/llvm/prebuilt/linux-x86_64/include
export CK_ENV_LIB_STDCPP_INCLUDE=/home/anton/data/android-ndk-r13b/sources/cxx-stl/gnu-libstdc++/include
export CK_ENV_LIB_STDCPP_INCLUDE_EXTRA=/home/anton/data/android-ndk-r13b/sources/cxx-stl/gnu-libstdc++/libs/arm64-v8a/include
export CK_FLAG_PREFIX_INCLUDE=-I
The include paths should be prefixed by /home/anton/data/android-ndk-r13b/sources/cxx-stl/gnu-libstdc++/4.9. It looks that the ver variable here is now empty after some changes to support NDK >= 17:
ndk_path=p5
ver=ndk_gcc.get('ver', '')[:-2]
abi=target_d.get('abi','')
env[ep]=pi
env[ep+'_BIN']=p1
if ndk_iver>=17:
Reactions are currently unavailable