Bazel Build Error on Ubuntu 16.10
I am trying to build tensorflow serving using:
bazel build tensorflow_serving/...
and I am getting the following error:
____[32 / 1,163] Compiling external/grpc/src/core/lib/security/credentials/fake/fake_credentials.c ERROR: /home/fventer/.cache/bazel/_bazel_fventer/df112d81776eed8445fcdf4a47c78963/external/com_googlesource_code_re2/BUILD:11:1: C++ compilation of rule '@com_googlesource_code_re2//:re2' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-canonical-system-headers ... (remaining 32 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1. external/com_googlesource_code_re2/re2/dfa.cc: In constructor 're2::DFA::State::State()': external/com_googlesource_code_re2/re2/dfa.cc:117:10: error: unknown array size in delete struct State { ^~~~~ external/com_googlesource_code_re2/re2/dfa.cc: In member function 're2::DFA::State* re2::DFA::CachedState(int*, int, uint32_t)': external/com_googlesource_code_re2/re2/dfa.cc:719:9: note: synthesized method 're2::DFA::State::State()' first required here State state; ^~~~~
This is on Ubuntu 16.10 server gcc version 6.2.0
Any suggestions?
Check https://github.com/tensorflow/tensorflow/issues/4348 for some background info about this. Looking at some of the linked threads suggests it's a GCC 6.1/6.2 bug.
TF Serving and TF no longer rely on regex/re2 however. Can you confirm you're using the latest version at head?
From the serving repo, run:
git log -1
cd tensorflow
git log -1
I got the above error from building a repo that I got using git clone this morning. I then did a pull about 30 minutes ago in serving and tensorflow sub dir and rerun the bazel build. The build went much further, but stopped with a new error: ERROR: /home/fventer/.cache/bazel/_bazel_fventer/df112d81776eed8445fcdf4a47c78963/external/org_tensorflow/tensorflow/core/platform/cloud/BUILD:95:1: C++ compilation of rule '@org_tensorflow//tensorflow/core/platform/cloud:oauth_client' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-canonical-system-headers ... (remaining 111 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1. In file included from external/org_tensorflow/tensorflow/core/platform/cloud/oauth_client.h:22:0, from external/org_tensorflow/tensorflow/core/platform/cloud/oauth_client.cc:16: external/org_tensorflow/tensorflow/core/platform/cloud/http_request.h:22:23: fatal error: curl/curl.h: No such file or directory #include <curl/curl.h>
I guess this is from some requirement that did not install properly before the build, so I will take it from here.
Thanks for the help!
For that you'll want to run sudo apt-get install curl and possibly also sudo apt-get install libcurl3-dev
Please re-open the issue if you encounter any other issues.
libcurl3-dev is needed. Will you please update the setup ?
uname -a: Linux ubuntu16 4.4.0-45-generic #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Updating now.
Thx!
Done. The change was just pushed to GitHub. Thanks.