Serving: Bazel Build Error on Centos 7

Created on 2 Nov 2016  路  6Comments  路  Source: tensorflow/serving

Hi,

I'm trying to build the basic serving example on a centos server.

The model export pass, but fail on build server while I'm running this command:

bazel build -c opt //tensorflow_serving/model_servers:tensorflow_model_server

The error message is about
C++ compilation of rule '@org_tensorflow//tensorflow/core/platform/cloud:http_request' failed

Details as following:

ERROR: ~/.cache/def2095ca8f472068ce1fdce87d2ee7d/external/org_tensorflow/tensorflow/core/platform/cloud/BUILD:49:1: C++ compilation of rule '@org_tensorflow//tensorflow/core/platform/cloud:http_request' failed: gcc failed: error executing command
  (cd ~/.cache/def2095ca8f472068ce1fdce87d2ee7d/execroot/serving && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin:/root/bin \
  /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-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/local-opt/bin/external/org_tensorflow/tensorflow/core/platform/cloud/_objs/http_request/external/org_tensorflow/tensorflow/core/platform/cloud/http_request.d '-frandom-seed=bazel-out/local-opt/bin/external/org_tensorflow/tensorflow/core/platform/cloud/_objs/http_request/external/org_tensorflow/tensorflow/core/platform/cloud/http_request.o' -DEIGEN_MPL2_ONLY -iquote external/org_tensorflow -iquote bazel-out/local-opt/genfiles/external/org_tensorflow -iquote external/bazel_tools -iquote bazel-out/local-opt/genfiles/external/bazel_tools -iquote external/protobuf -iquote bazel-out/local-opt/genfiles/external/protobuf -iquote external/com_googlesource_code_re2 -iquote bazel-out/local-opt/genfiles/external/com_googlesource_code_re2 -iquote external/farmhash_archive -iquote bazel-out/local-opt/genfiles/external/farmhash_archive -iquote external/gif_archive -iquote bazel-out/local-opt/genfiles/external/gif_archive -iquote external/highwayhash -iquote bazel-out/local-opt/genfiles/external/highwayhash -iquote external/jpeg_archive -iquote bazel-out/local-opt/genfiles/external/jpeg_archive -iquote external/png_archive -iquote bazel-out/local-opt/genfiles/external/png_archive -iquote external/zlib_archive -iquote bazel-out/local-opt/genfiles/external/zlib_archive -iquote external/eigen_archive -iquote bazel-out/local-opt/genfiles/external/eigen_archive -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/protobuf/src -isystem bazel-out/local-opt/genfiles/external/protobuf/src -isystem external/farmhash_archive -isystem bazel-out/local-opt/genfiles/external/farmhash_archive -isystem external/gif_archive -isystem bazel-out/local-opt/genfiles/external/gif_archive -isystem external/highwayhash -isystem bazel-out/local-opt/genfiles/external/highwayhash -isystem external/jpeg_archive -isystem bazel-out/local-opt/genfiles/external/jpeg_archive -isystem external/png_archive -isystem bazel-out/local-opt/genfiles/external/png_archive -isystem external/zlib_archive -isystem bazel-out/local-opt/genfiles/external/zlib_archive -isystem external/eigen_archive -isystem bazel-out/local-opt/genfiles/external/eigen_archive -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/org_tensorflow/tensorflow/core/platform/cloud/http_request.cc -o bazel-out/local-opt/bin/external/org_tensorflow/tensorflow/core/platform/cloud/_objs/http_request/external/org_tensorflow/tensorflow/core/platform/cloud/http_request.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
In file included from external/org_tensorflow/tensorflow/core/platform/cloud/http_request.h:22:0,
                 from external/org_tensorflow/tensorflow/core/platform/cloud/http_request.cc:16:
external/org_tensorflow/tensorflow/core/platform/cloud/http_request.cc: In member function 'virtual tensorflow::Status tensorflow::HttpRequest::Init()':
external/org_tensorflow/tensorflow/core/platform/cloud/http_request.cc:219:30: error: 'CURL_HTTP_VERSION_2_0' was not declared in this scope
                              CURL_HTTP_VERSION_2_0);

Here's the installed curl:

yum list installed | grep curl
==========================
curl.x86_64                            7.29.0-25.el7.centos            @base
libcurl.x86_64                         7.29.0-25.el7.centos            @base
libcurl-devel.x86_64                   7.29.0-25.el7.centos            @base
python-pycurl.x86_64                   7.19.0-17.el7                   @anaconda

Any ideas about this?

Thank you very much.

Most helpful comment

I had to compile curl to make it work in Centos 7. I used the following script, maybe it will be helpful.

All 6 comments

Try running sudo apt-get install curl and sudo apt-get install libcurl3-dev

yum list installed | grep curl
==========================
curl.x86_64                            7.29.0-25.el7.centos            @base
libcurl.x86_64                         7.29.0-25.el7.centos            @base
libcurl-devel.x86_64                   7.29.0-25.el7.centos            @base
python-pycurl.x86_64                   7.19.0-17.el7                   @anaconda

Packages already installed. Did I miss anything?

Looks like "The alias CURL_HTTP_VERSION_2 was added in 7.43.0"

Could you try updating the libcurl-devel package?

I had to compile curl to make it work in Centos 7. I used the following script, maybe it will be helpful.

Thanks @jarutis!

Thanks guys, @kirilg @jarutis It works. @jarutis the script is really helpful.

Was this page helpful?
0 / 5 - 0 ratings