tensorflow build fail at october 6 2016 - tensorflow

Ubuntu 16.04
gcc 5.4.0
java 1.8.0_91
bazel 0.3.1 (download the releases , haven't build from source because it build fail)
I change the config file follow the discussion here and here because it works for ./configure.
I clone the lastest code and configure without GPU. Here is my build instruction at the root directory of tensorflow
bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
The error log:
ERROR: /home/gt/.cache/bazel/_bazel_gt/3d5d29ec73796bda2fc5b2dffed26f47/external/protobuf/BUILD:333:1: Linking of rule '#protobuf//:protoc' failed: gcc failed: error executing command /usr/bin/gcc -o bazel-out/host/bin/external/protobuf/protoc -Wl,-no-as-needed -B/usr/bin -B/usr/bin -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S -Wl,--gc-sections ... (remaining 1 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
bazel-out/host/bin/external/protobuf/_objs/protoc/external/protobuf/src/google/protobuf/compiler/main.o: In function `main':
main.cc:(.text.startup.main+0x2db): undefined reference to `vtable for google::protobuf::compiler::php::Generator'
main.cc:(.text.startup.main+0x642): undefined reference to `vtable for google::protobuf::compiler::php::Generator'
main.cc:(.text.startup.main+0x740): undefined reference to `vtable for google::protobuf::compiler::php::Generator'
collect2: error: ld returned 1 exit status
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.

This is a bug in protobuf, we signaled it already two weeks ago. See https://github.com/google/protobuf/issues/2133

Related

Bazel can't find g++ despite both MSYS2 and native shell supporting it

I have installed Bazel through Chocolatey on Windows and MSYS2 to have access to bash.exe.
A script I am trying to build uses g++ which I installed through pacman in MSYS2 and also added to PATH. I am able to run g++ --version in both the MSYS2 shell and my native Powershell.
But somehow it seems as if MSYS2 can't run g++ when I am running it through Bazel.
C:/<censored>> bazel build //kernels:rasterize_triangles_kernel
INFO: Analyzed target //kernels:rasterize_triangles_kernel (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: C:/<censored>/kernels/BUILD:20:8: Executing genrule //kernels:rasterize_triangles_kernel failed: (Exit 127): bash.exe failed: error executing command (from target //kernels:rasterize_triangles_kernel) C:\msys64\usr\bin\bash.exe -c ... (remaining 1 argument skipped)
/usr/bin/bash: line 1: g++: command not found
Target //kernels:rasterize_triangles_kernel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4.883s, Critical Path: 4.80s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully

LTO compilation question when linking X86/marshal file

Envs: Ubuntu 18.04, Miniconda3, python=3.7(GCC=7.3.0), GCC -v (7.4.0)
The error occurs when I run the following command:
scons build/X86/gem5.opt -j8
The error is as follow:
[ LINK] -> X86/marshal
lto1: internal compiler error: in lto_tag_to_tree_code, at lto-streamer.h:1005
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
scons: *** [build/X86/marshal] Error 1
scons: building terminated because of errors.
And I am wondering how to fix it.

TensorFlow 1.1 “bazel build tensorflow/tools/graph_transforms:transform_graph"

When I build quantization tool use the command
"bazel build tensorflow/tools/graph_transforms:transform_graph"
The complie result as below:
WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.build/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.
INFO: Found 1 target...
ERROR: /root/tensorflow-master/tensorflow/core/BUILD:1287:1: C++ compilation of rule '//tensorflow/core:framework_internal' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 106 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
tensorflow/core/framework/reader_op_kernel.cc:20:61: error: definition of implicitly-declared 'tensorflow::ReaderOpKernel::ReaderOpKernel(tensorflow::OpKernelConstruction*)'
ReaderOpKernel::ReaderOpKernel(OpKernelConstruction* context)
^
tensorflow/core/framework/reader_op_kernel.cc:27:33: error: definition of implicitly-declared 'virtual tensorflow::ReaderOpKernel::~ReaderOpKernel()'
ReaderOpKernel::~ReaderOpKernel() {
^
tensorflow/core/framework/reader_op_kernel.cc:34:50: error: no 'void tensorflow::ReaderOpKernel::Compute(tensorflow::OpKernelContext*)' member function declared in class 'tensorflow::ReaderOpKernel'
void ReaderOpKernel::Compute(OpKernelContext* ctx) {
^
Target //tensorflow/tools/graph_transforms:transform_graph failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 5.989s, Critical Path: 5.02s
What's the problem?
Thanks!
Please try two things:
(1) configure the compile environment first and then compile, like
./configure
bazel build tensorflow/tools/graph_transforms:transform_graph
(2) You can also try:
sudo bazel build tensorflow/tools/graph_transforms:transform_graph
Point (2) worked for me sometimes to remove dependencies of including header files.
please download the latest tensorflow and bazel, if needed.

clang: error: unknown argument: '-nvcc_options=ftz=true'

I am compiling tensorflow r1.2 with clang and cuda. But the following error shows up
ERROR: /data/home/vimos/Public/git/github/ml/tensorflow/tensorflow/tensorflow/core/kernels/BUILD:642:1: Couldn't build file tensorflow/core/kernels/_objs/mirror_pad_op_gpu/tensorflow/core/kernels/mirror_pad_op_gpu.cu.pic.o: C++ compilation of rule '//tensorflow/core/kernels:mirror_pad_op_gpu' failed: clang failed: error executing command /opt/llvm/bin/clang -mavx -mavx2 -mfma -msse4.2 -MD -MF bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/mirror_pad_op_gpu/tensorflow/core/kernels/mirror_pad_op_gpu.cu.pic.d ... (remaining 143 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
clang: error: unknown argument: '-nvcc_options=relaxed-constexpr'
clang: error: unknown argument: '-nvcc_options=ftz=true'
I am using clang version
➜ tensorflow git:(r1.2) ✗ /opt/llvm/bin/clang --version
clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/llvm/bin
bazel version
➜ tensorflow git:(r1.2) ✗ bazel version
Build label: 0.4.5
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Mar 16 12:19:38 2017 (1489666778)
Build timestamp: 1489666778
Build timestamp as int: 1489666778
I am now trying compiling clang with trunk head.
Any help is appreciated, thank you!

SyntaxNet Bazel build failed: gcc: error: unrecognized command line option '-h'

Trying to install SyntaxNet on Ubuntu 14.04 LTS, build fails with gcc unrecognized command line option '-h'.
Searched gcc documentation and there seems to be no such command line option.
Have anybody seen this?
sudo /home/user/bin/bazel test --linkopt=-headerpad_max_install_names --spawn_strategy=standalone --genrule_strategy=standalone \
syntaxnet/... util/utf8/...
INFO: Found 65 targets and 12 test targets...
ERROR: /home/user/.cache/bazel/_bazel_root/1a72b3057373bad6ae8a8f20db5423d4/external/re2/BUILD:9:1: Linking of rule '#re2//:re2' failed: gcc failed: error executing command /usr/bin/gcc -shared -o bazel-out/local-opt/bin/external/re2/libre2.so -pthread -no-canonical-prefixes -B/usr/bin -B/usr/bin -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' ... (remaining 3 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
gcc: error: unrecognized command line option '-h'
INFO: Elapsed time: 0.857s, Critical Path: 0.45s