The project uses the open source BAZEL build system which is a derivative of Google's proprietary build system BLAZE. Although the project documentation says that the library supporting the USB Coral component can be built without BAZEL, I'm finding that assertion is no longer true and the result is you run "make" which, in turn, calls Bazel. This particular project is quite complex. A nifty feature of the BAZEL system is that you can created an pictorial diagram of the dependencies, which I did for kicks, and you can view the PNG representation of the graphviz-generated SVG at: graph (27 MB)and graph_simplified (20 MB).
My first roadblock was that Bazel was not finding the C++ compiler. I overcame that by modifying my PATH variable to point to gcc's C++ compiler. See libedgetpu gcc: fatal error: cannot execute 'cc1plus' Hu noted in the topic that my output suggested the compiler was also not finding the standard C++ headers. Well, here I am and I've isolated that issue into this topic because it may be something that Bazel is configured in such a way that it cannot find the standard C++ headers on a Gentoo system.
For this build, I have debugging activated which was achieved by modifying the top level Makefile:
Code: Select all
jlpoole@eos ~/libedgetpu $ diff Makefile_ORIGINAL Makefile
68a69,71
> #
> # 11/20/2022 jlpoole: added "--sandbox_debug" after failed output suggested using same
> #
69a73
> --sandbox_debug \
jlpoole@eos ~/libedgetpu $
Code: Select all
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.
Code: Select all
jlpoole@eos ~/libedgetpu $ clang -E -xc++ - -v
clang version 15.0.5
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/15/bin
Configuration file: /etc/clang/clang.cfg
System configuration file directory: /etc/clang
Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
(in-process)
"/usr/lib/llvm/15/bin/clang-15" -cc1 -triple x86_64-pc-linux-gnu -E -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -v -fcoverage-compilation-dir=/home/jlpoole/libedgetpu -resource-dir /usr/lib/llvm/15/bin/../../../../lib/clang/15.0.5 -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/include/g++-v11 -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/include/g++-v11/x86_64-pc-linux-gnu -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/include/g++-v11/backward -internal-isystem /usr/lib/llvm/15/bin/../../../../lib/clang/15.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir=/home/jlpoole/libedgetpu -ferror-limit 19 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -fcolor-diagnostics -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o - -x c++ -
clang -cc1 version 15.0.5 based upon LLVM 15.0.5 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/include/g++-v11
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/include/g++-v11/x86_64-pc-linux-gnu
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/include/g++-v11/backward
/usr/lib/llvm/15/bin/../../../../lib/clang/15.0.5/include
/usr/include
End of search list.
^C
jlpoole@eos ~/libedgetpu $Anyone familiar with Bazel and C++ compilation and where one might add some of the above paths, i.e. /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/include/g++-v11?
