Hello folks,
We a custom clang with additional homegrown optimization passes for our application. We are incorporating tensorflow as a shared library and for that we had to customize the build, which has been achieved. Bazel compiles tensorflow with our custom clang and generates the .so library as expected.
The problem now is that when we try to create the library using libc++ instead of the default GCC libstdc++, it spews out this error:
$ bazel build --cxxopt=-std=c++11 --cxxopt=-stdlib=libc++ tensorflow:libtensorflow_all.so
INFO: Found 1 target...
INFO: From Compiling external/protobuf/src/google/protobuf/compiler/js/embed.cc [for host]:
external/protobuf/src/google/protobuf/compiler/js/embed.cc:37:12: warning: unused variable 'output_file' [-Wunused-const-variable]
const char output_file[] = "well_known_types_embed.cc";
^
1 warning generated.
ERROR: /home/hbucher/.cache/bazel/_bazel_hbucher/ad427c7fddd5b68de5e1cfaa7cd8c8cc/external/com_googlesource_code_re2/BUILD:11:1: undeclared inclusion(s) in rule '@com_googlesource_code_re2//:re2':
this rule is missing dependency declarations for the following files included by 'external/com_googlesource_code_re2/re2/bitstate.cc':
'/home/hbucher/install/include/c++/v1/stddef.h'
'/home/hbucher/install/include/c++/v1/__config'
'/home/hbucher/install/include/c++/v1/__nullptr'
'/home/hbucher/install/include/c++/v1/stdint.h'
'/home/hbucher/install/include/c++/v1/string.h'
'/home/hbucher/install/include/c++/v1/stdio.h'
I am struggling with the path of creating a custom toolchain so my question to you is:
Is there any way to just tweak the zipped bazel distribution (bazel-4.5.0-dist.zip) such that I can get through this without creating a custom toolchain?
Alternatively, would you have a ready example of files for a custom clang/x86_64 I can use with --crosstool_top?
Thank you.