google-coral / libedgetpu

Source code for the userspace level runtime driver for Coral.ai devices.
Apache License 2.0
181 stars 62 forks source link

Fail to compile libedgetpu #13

Closed aquahsu0811 closed 3 years ago

aquahsu0811 commented 3 years ago

Dear all,

I got an error when I compiled libedgetpu libary,

make libedgetpu-direct CPU=aarch64:

bazel build --sandbox_debug --subcommands --experimental_repo_remote_exec --compilation_mode=opt --define darwinn_portable=1 --action_env PYTHON_BIN_PATH=/usr/bin/python3 --cpu=aarch64 --embed_label='TENSORFLOW_COMMIT=f394a768719a55b5c351ed1ecab2ec6f16f99dd4' --stamp --verbose_failures --crosstool_top=@crosstool//:toolchains --compiler=gcc //tflite/public:libedgetpu_direct_all.so Starting local Bazel server and connecting to it... ... still trying to connect to local Bazel server after 10 seconds ... INFO: Analyzed target //tflite/public:libedgetpu_direct_all.so (60 packages loaded, 1021 targets configured). INFO: Found 1 target... SUBCOMMAND: # @flatbuffers//src:flatc_library [action 'Compiling src/flatc.cpp [for host]', configuration: 3d467bcde7472f94e8494187ceef88f756b47bbba87d97f671b42962e8ccc7d6, execution platform: @local_config_platform//:host] (cd /home/firefly/.cache/bazel/_bazel_firefly/5e823d200991dd229ee17d0652942eef/execroot/libedgetpu && \ exec env - \ PATH=/home/firefly/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \ PWD=/proc/self/cwd \ /usr/bin/aarch64-linux-gnu-gcc -fPIC -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O3 -DNDEBUG '-D_FORTIFY_SOURCE=2' -ffunction-sections -fdata-sections '-march=armv8-a' -funsafe-math-optimizations -ftree-vectorize '-std=c++11' -MD -MF bazel-out/host/bin/external/flatbuffers/src/_objs/flatc_library/flatc.d '-frandom-seed=bazel-out/host/bin/external/flatbuffers/src/_objs/flatc_library/flatc.o' -iquote external/flatbuffers -iquote bazel-out/host/bin/external/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/src/_virtual_includes/flatc_library -Ibazel-out/host/bin/external/flatbuffers/src/_virtual_includes/flatbuffers -g0 -g0 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/flatbuffers/src/flatc.cpp -o bazel-out/host/bin/external/flatbuffers/src/_objs/flatc_library/flatc.o) SUBCOMMAND: # @flatbuffers//grpc/src/compiler:python_generator_private [action 'Compiling grpc/src/compiler/python_generator.cc [for host]', configuration: 3d467bcde7472f94e8494187ceef88f756b47bbba87d97f671b42962e8ccc7d6, execution platform: @local_config_platform//:host] (cd /home/firefly/.cache/bazel/_bazel_firefly/5e823d200991dd229ee17d0652942eef/execroot/libedgetpu && \ exec env - \ PATH=/home/firefly/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \ PWD=/proc/self/cwd \ /usr/bin/aarch64-linux-gnu-gcc -fPIC -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O3 -DNDEBUG '-D_FORTIFY_SOURCE=2' -ffunction-sections -fdata-sections '-march=armv8-a' -funsafe-math-optimizations -ftree-vectorize '-std=c++11' -MD -MF bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/python_generator_private/python_generator.d '-frandom-seed=bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/python_generator_private/python_generator.o' -iquote external/flatbuffers -iquote bazel-out/host/bin/external/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/python_generator_private -Ibazel-out/host/bin/external/flatbuffers/_virtual_includes/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/src/_virtual_includes/flatbuffers -g0 -g0 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/flatbuffers/grpc/src/compiler/python_generator.cc -o bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/python_generator_private/python_generator.o) SUBCOMMAND: # @flatbuffers//grpc/src/compiler:go_generator [action 'Compiling grpc/src/compiler/go_generator.cc [for host]', configuration: 3d467bcde7472f94e8494187ceef88f756b47bbba87d97f671b42962e8ccc7d6, execution platform: @local_config_platform//:host] (cd /home/firefly/.cache/bazel/_bazel_firefly/5e823d200991dd229ee17d0652942eef/execroot/libedgetpu && \ exec env - \ PATH=/home/firefly/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \ PWD=/proc/self/cwd \ /usr/bin/aarch64-linux-gnu-gcc -fPIC -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O3 -DNDEBUG '-D_FORTIFY_SOURCE=2' -ffunction-sections -fdata-sections '-march=armv8-a' -funsafe-math-optimizations -ftree-vectorize '-std=c++11' -MD -MF bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/go_generator/go_generator.d '-frandom-seed=bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/go_generator/go_generator.o' -iquote external/flatbuffers -iquote bazel-out/host/bin/external/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/go_generator -Ibazel-out/host/bin/external/flatbuffers/_virtual_includes/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/src/_virtual_includes/flatbuffers -g0 -g0 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/flatbuffers/grpc/src/compiler/go_generator.cc -o bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/go_generator/go_generator.o) SUBCOMMAND: # @flatbuffers//grpc/src/compiler:swift_generator [action 'Compiling grpc/src/compiler/swift_generator.cc [for host]', configuration: 3d467bcde7472f94e8494187ceef88f756b47bbba87d97f671b42962e8ccc7d6, execution platform: @local_config_platform//:host] (cd /home/firefly/.cache/bazel/_bazel_firefly/5e823d200991dd229ee17d0652942eef/execroot/libedgetpu && \ exec env - \ PATH=/home/firefly/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \ PWD=/proc/self/cwd \ /usr/bin/aarch64-linux-gnu-gcc -fPIC -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O3 -DNDEBUG '-D_FORTIFY_SOURCE=2' -ffunction-sections -fdata-sections '-march=armv8-a' -funsafe-math-optimizations -ftree-vectorize '-std=c++11' -MD -MF bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/swift_generator/swift_generator.d '-frandom-seed=bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/swift_generator/swift_generator.o' -iquote external/flatbuffers -iquote bazel-out/host/bin/external/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/swift_generator -Ibazel-out/host/bin/external/flatbuffers/_virtual_includes/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/src/_virtual_includes/flatbuffers -g0 -g0 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/flatbuffers/grpc/src/compiler/swift_generator.cc -o bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/swift_generator/swift_generator.o) SUBCOMMAND: # @flatbuffers//grpc/src/compiler:cpp_generator [action 'Compiling grpc/src/compiler/cpp_generator.cc [for host]', configuration: 3d467bcde7472f94e8494187ceef88f756b47bbba87d97f671b42962e8ccc7d6, execution platform: @local_config_platform//:host] (cd /home/firefly/.cache/bazel/_bazel_firefly/5e823d200991dd229ee17d0652942eef/execroot/libedgetpu && \ exec env - \ PATH=/home/firefly/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \ PWD=/proc/self/cwd \ /usr/bin/aarch64-linux-gnu-gcc -fPIC -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O3 -DNDEBUG '-D_FORTIFY_SOURCE=2' -ffunction-sections -fdata-sections '-march=armv8-a' -funsafe-math-optimizations -ftree-vectorize '-std=c++11' -MD -MF bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/cpp_generator/cpp_generator.d '-frandom-seed=bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/cpp_generator/cpp_generator.o' -iquote external/flatbuffers -iquote bazel-out/host/bin/external/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/src/_virtual_includes/flatbuffers -g0 -g0 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/flatbuffers/grpc/src/compiler/cpp_generator.cc -o bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/cpp_generator/cpp_generator.o) SUBCOMMAND: # @flatbuffers//grpc/src/compiler:java_generator [action 'Compiling grpc/src/compiler/java_generator.cc [for host]', configuration: 3d467bcde7472f94e8494187ceef88f756b47bbba87d97f671b42962e8ccc7d6, execution platform: @local_config_platform//:host] (cd /home/firefly/.cache/bazel/_bazel_firefly/5e823d200991dd229ee17d0652942eef/execroot/libedgetpu && \ exec env - \ PATH=/home/firefly/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \ PWD=/proc/self/cwd \ /usr/bin/aarch64-linux-gnu-gcc -fPIC -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O3 -DNDEBUG '-D_FORTIFY_SOURCE=2' -ffunction-sections -fdata-sections '-march=armv8-a' -funsafe-math-optimizations -ftree-vectorize '-std=c++11' -MD -MF bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/java_generator/java_generator.d '-frandom-seed=bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/java_generator/java_generator.o' -iquote external/flatbuffers -iquote bazel-out/host/bin/external/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_virtual_includes/java_generator -Ibazel-out/host/bin/external/flatbuffers/_virtual_includes/flatbuffers -Ibazel-out/host/bin/external/flatbuffers/src/_virtual_includes/flatbuffers -g0 -g0 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/flatbuffers/grpc/src/compiler/java_generator.cc -o bazel-out/host/bin/external/flatbuffers/grpc/src/compiler/_objs/java_generator/java_generator.o) ERROR: /home/firefly/.cache/bazel/_bazel_firefly/5e823d200991dd229ee17d0652942eef/external/flatbuffers/grpc/src/compiler/BUILD:93:11: Compiling grpc/src/compiler/swift_generator.cc [for host] failed: undeclared inclusion(s) in rule '@flatbuffers//grpc/src/compiler:swift_generator': this rule is missing dependency declarations for the following files included by 'grpc/src/compiler/swift_generator.cc': '/usr/lib/gcc/aarch64-linux-gnu/7/include/stddef.h' '/usr/lib/gcc/aarch64-linux-gnu/7/include/stdarg.h' '/usr/lib/gcc/aarch64-linux-gnu/7/include/stdint.h' 1613987167.002092322: src/main/tools/linux-sandbox.cc:152: calling pipe(2)... 1613987167.002237856: src/main/tools/linux-sandbox.cc:171: calling clone(2)... 1613987167.002922066: src/main/tools/linux-sandbox.cc:180: linux-sandbox-pid1 has PID 14735 1613987167.011250416: src/main/tools/linux-sandbox-pid1.cc:434: Pid1Main started 1613987167.011670683: src/main/tools/linux-sandbox.cc:197: done manipulating pipes 1613987167.012211985: src/main/tools/linux-sandbox-pid1.cc:176: working dir: /home/firefly/.cache/bazel/_bazel_firefly/5e823d200991dd229ee17d0652942eef/sandbox/linux-sandbox/4/execroot/libedgetpu 1613987167.012278189: src/main/tools/linux-sandbox-pid1.cc:208: writable: /home/firefly/.cache/bazel/_bazel_firefly/5e823d200991dd229ee17d0652942eef/sandbox/linux-sandbox/4/execroot/libedgetpu 1613987167.012307646: src/main/tools/linux-sandbox-pid1.cc:208: writable: /tmp 1613987167.012331853: src/main/tools/linux-sandbox-pid1.cc:208: writable: /dev/shm 1613987167.012579463: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: / 1613987167.012615628: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /dev 1613987167.012638377: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /dev/pts 1613987167.012660834: src/main/tools/linux-sandbox-pid1.cc:279: remount rw: /dev/shm 1613987167.012680374: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /dev/mqueue 1613987167.012703123: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /run 1613987167.012724413: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /run/lock 1613987167.012747162: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /run/user/1000 1613987167.012771952: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /run/user/1000/gvfs 1613987167.012794993: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys 1613987167.012815700: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/kernel/security 1613987167.012845156: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup 1613987167.012871988: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/unified 1613987167.012902320: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/systemd 1613987167.013002064: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/blkio 1613987167.013030354: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/cpuset 1613987167.013054852: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/devices 1613987167.013080226: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/pids 1613987167.013105891: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/net_prio 1613987167.013131848: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/cpu,cpuacct 1613987167.013158096: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/freezer 1613987167.013184053: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/perf_event 1613987167.013211760: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/cgroup/memory 1613987167.013242675: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/pstore 1613987167.013268048: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/kernel/debug 1613987167.013293422: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/kernel/debug/tracing 1613987167.013312671: src/main/tools/linux-sandbox-pid1.cc:300: remount(nullptr, /sys/kernel/debug/tracing, nullptr, 2101281, nullptr) failure (Permission denied) ignored 1613987167.013373042: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/fs/fuse/connections 1613987167.013407165: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /sys/kernel/config 1613987167.013475411: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /proc 1613987167.013501368: src/main/tools/linux-sandbox-pid1.cc:279: remount ro: /media/firefly/ALLNET 1613987167.013528492: src/main/tools/linux-sandbox-pid1.cc:279: remount rw: /home/firefly/.cache/bazel/_bazel_firefly/5e823d200991dd229ee17d0652942eef/sandbox/linux-sandbox/4/execroot/libedgetpu 1613987167.013575447: src/main/tools/linux-sandbox-pid1.cc:279: remount rw: /home/firefly/.cache/bazel/_bazel_firefly/5e823d200991dd229ee17d0652942eef/sandbox/linux-sandbox/4/execroot/libedgetpu 1613987167.013599946: src/main/tools/linux-sandbox-pid1.cc:279: remount rw: /tmp 1613987167.013620653: src/main/tools/linux-sandbox-pid1.cc:279: remount rw: /dev/shm 1613987167.013699690: src/main/tools/linux-sandbox-pid1.cc:363: calling fork... 1613987167.014281823: src/main/tools/linux-sandbox-pid1.cc:393: child started with PID 2 1613987182.506801016: src/main/tools/linux-sandbox-pid1.cc:410: wait returned pid=2, status=0x00 1613987182.506878594: src/main/tools/linux-sandbox-pid1.cc:428: child exited normally with code 0 1613987182.537172251: src/main/tools/linux-sandbox.cc:233: child exited normally with code 0 Target //tflite/public:libedgetpu_direct_all.so failed to build INFO: Elapsed time: 89.636s, Critical Path: 16.29s INFO: 91 processes: 91 internal. FAILED: Build did NOT complete successfully Makefile:99: recipe for target 'libedgetpu-direct' failed make: *** [libedgetpu-direct] Error 1

Environment: Architecture: aarch64 OS: Ubuntu 18.04.5 LTS

Namburger commented 3 years ago

@aquaXU I believe you either have some missing library or mismatching dependency. I suggest using the provided docker image to build, we also use this internally since it's became out of hand to have different system and glic version building binaries for a target.

$ DOCKER_CPUS="aarch64" DOCKER_TARGETS=libedgetpu make docker-build
manoj7410 commented 3 years ago

Feel free to reopen if this is still an issue.