AGL+Tensorflowlite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all-

I am trying to build Tensorflowlite using the gcc cross compiler setup during the SDK installation, aarch64-agl-linux-gcc.  I built the AGL demo for Raspberry Pi4 and installed it on my rpi.  I install the sdk, source the environment script and try "bazel build --config=elinux_aarch64 --cxxopt=--std=c++11 //tensorflow/lite:libtensorflowlite.so --verbose_failures".  Has anyone been able to build tensorflow that can run on AGL?  I have scoured the internet but cant find anything and my experience with cross compiling in general is limited.  Any help would be greatly appreciated!

Jon

AGL SDK Version 10.90 (latest as of a few weeks ago) and 9.0.3 so far
TF 2.3
Bazel 3.1.0
Docker Ubuntu 18.04 (setup with all TF dependencies)
aarch64-agl-linux-gcc 9.3

Steps to reproduce:

./poky-agl-glibc-x86_64-agl-demo-platform-crosssdk-aarch64-raspberrypi4-64-toolchain-10.90.0+snapshot.sh

. /opt/agl-sdk/10.90.0+snapshot-aarch64/environment-setup-aarch64-agl-linux

./configure (keep all default values in configure script)

bazel build --config=elinux_aarch64 --cxxopt=--std=c++11 //tensorflow/lite:libtensorflowlite.so --verbose_failures

Logs:

root@5eee478e0195:/nauto-third-party/tensorflow-2.3.0/tensorflow# bazel build --config=elinux_aarch64 --cxxopt=--std=c++11 //tensorflow/lite:libtensorflowlite.so --verbose_failures
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=193
INFO: Reading rc options for 'build' from /nauto-third-party/tensorflow-2.3.0/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /nauto-third-party/tensorflow-2.3.0/.bazelrc:
  'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --java_toolchain=//third_party/toolchains/java:tf_java_toolchain --host_java_toolchain=//third_party/toolchains/java:tf_java_toolchain --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --noincompatible_prohibit_aapt1 --enable_platform_specific_config --config=v2
INFO: Reading rc options for 'build' from /nauto-third-party/tensorflow-2.3.0/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/bin/python3 --action_env PYTHON_LIB_PATH=/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/lib/python3.8/site-packages --python_path=/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/bin/python3 --config=xla --action_env TF_CONFIGURE_IOS=0
INFO: Found applicable config definition build:v2 in file /nauto-third-party/tensorflow-2.3.0/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:xla in file /nauto-third-party/tensorflow-2.3.0/.bazelrc: --action_env=TF_ENABLE_XLA=1 --define=with_xla_support=true
INFO: Found applicable config definition build:elinux_aarch64 in file /nauto-third-party/tensorflow-2.3.0/.bazelrc: --config=elinux --cpu=aarch64
INFO: Found applicable config definition build:elinux in file /nauto-third-party/tensorflow-2.3.0/.bazelrc: --crosstool_top=@local_config_embedded_arm//:toolchain --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
INFO: Found applicable config definition build:linux in file /nauto-third-party/tensorflow-2.3.0/.bazelrc: --copt=-w --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 --config=dynamic_kernels
INFO: Found applicable config definition build:dynamic_kernels in file /nauto-third-party/tensorflow-2.3.0/.bazelrc: --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS
INFO: Analyzed target //tensorflow/lite:libtensorflowlite.so (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /root/.cache/bazel/_bazel_root/c98970e5863e2bb0e27536babd496e3c/external/flatbuffers/src/BUILD:40:1: C++ compilation of rule '@flatbuffers//src:flatc' failed (Exit 1): aarch64-agl-linux-gcc failed: error executing command
  (cd /root/.cache/bazel/_bazel_root/c98970e5863e2bb0e27536babd496e3c/execroot/org_tensorflow && \
  exec env - \
    PATH=/usr/local/lib:/root/.local/lib:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/bin:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/bin:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/sbin:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/bin:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/sbin:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/bin/../x86_64-aglsdk-linux/bin:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/bin/aarch64-agl-linux:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/bin/aarch64-agl-linux-musl:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/lib/python3.8/site-packages \
    PWD=/proc/self/cwd \
  /opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/bin/aarch64-agl-linux/aarch64-agl-linux-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 -fdata-sections '-std=c++0x' -MD -MF bazel-out/host/bin/external/flatbuffers/src/_objs/flatc/flatc_main.d '-frandom-seed=bazel-out/host/bin/external/flatbuffers/src/_objs/flatc/flatc_main.o' -iquote external/flatbuffers -iquote bazel-out/host/bin/external/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/src/_virtual_includes/flatc -Ibazel-out/host/bin/external/flatbuffers/src/_virtual_includes/flatc_library -Ibazel-out/host/bin/external/flatbuffers/src/_virtual_includes/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/cpp_generator -Ibazel-out/host/bin/external/flatbuffers/_virtual_includes/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/go_generator -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/java_generator -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/python_generator -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/python_generator_private -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/swift_generator -g0 -g0 '-std=c++14' -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/flatbuffers/src/flatc_main.cpp -o bazel-out/host/bin/external/flatbuffers/src/_objs/flatc/flatc_main.o)
Execution platform: @local_execution_config_platform//:platform
In file included from external/flatbuffers/src/flatc_main.cpp:17:
bazel-out/host/bin/external/flatbuffers/src/_virtual_includes/flatc/flatbuffers/flatc.h:20:10: fatal error: functional: No such file or directory
   20 | #include <functional>
      |          ^~~~~~~~~~~~
compilation terminated.
Target //tensorflow/lite:libtensorflowlite.so failed to build
ERROR: /nauto-third-party/tensorflow-2.3.0/tensorflow/lite/kernels/BUILD:689:1 C++ compilation of rule '@flatbuffers//src:flatc' failed (Exit 1): aarch64-agl-linux-gcc failed: error executing command
  (cd /root/.cache/bazel/_bazel_root/c98970e5863e2bb0e27536babd496e3c/execroot/org_tensorflow && \
  exec env - \
    PATH=/usr/local/lib:/root/.local/lib:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/bin:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/bin:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/sbin:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/bin:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/sbin:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/bin/../x86_64-aglsdk-linux/bin:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/bin/aarch64-agl-linux:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/bin/aarch64-agl-linux-musl:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/lib/python3.8/site-packages \
    PWD=/proc/self/cwd \
  /opt/agl-sdk/10.90.0+snapshot-aarch64/sysroots/x86_64-aglsdk-linux/usr/bin/aarch64-agl-linux/aarch64-agl-linux-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 -fdata-sections '-std=c++0x' -MD -MF bazel-out/host/bin/external/flatbuffers/src/_objs/flatc/flatc_main.d '-frandom-seed=bazel-out/host/bin/external/flatbuffers/src/_objs/flatc/flatc_main.o' -iquote external/flatbuffers -iquote bazel-out/host/bin/external/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/src/_virtual_includes/flatc -Ibazel-out/host/bin/external/flatbuffers/src/_virtual_includes/flatc_library -Ibazel-out/host/bin/external/flatbuffers/src/_virtual_includes/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/cpp_generator -Ibazel-out/host/bin/external/flatbuffers/_virtual_includes/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/go_generator -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/java_generator -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/python_generator -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/python_generator_private -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/swift_generator -g0 -g0 '-std=c++14' -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/flatbuffers/src/flatc_main.cpp -o bazel-out/host/bin/external/flatbuffers/src/_objs/flatc/flatc_main.o)
Execution platform: @local_execution_config_platform//:platform
INFO: Elapsed time: 0.077s, Critical Path: 0.02s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

***
Lastly please note that I get the same error but in different places when I run this build.  Sometimes as above it cant find <function>, other times it cant find <map> and others it cant find <assert>
***
_._,_._,_

Links:

You receive all messages sent to this group.

View/Reply Online (#8960) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [list-automotive-discussions82@xxxxxxxxxxx]

_._,_._,_

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux