I am getting this error when trying to build with bazel.
I am using centos 7 with bazel 0.4.4
[root@nqa-seeing-docker-1d 10.0.8.221:/mnt1/serving] bazel build tensorflow_serving/...
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.
WARNING: /root/.cache/bazel/_bazel_root/65b3db6a809ce98ae6975189354f0e27/external/org_tensorflow/tensorflow/workspace.bzl:65:5: tf_repo_name was specified to tf_workspace but is no longer used and will be removed in the future.
WARNING: /root/.cache/bazel/_bazel_root/65b3db6a809ce98ae6975189354f0e27/external/inception_model/WORKSPACE:1: Workspace name in /root/.cache/bazel/_bazel_root/65b3db6a809ce98ae6975189354f0e27/external/inception_model/WORKSPACE (@inception) does not match the name given in the repository's definition (@inception_model); this will cause a build error in future versions.
INFO: Found 256 targets...
ERROR: /root/.cache/bazel/_bazel_root/65b3db6a809ce98ae6975189354f0e27/external/curl/BUILD.bazel:8:1: C++ compilation of rule '@curl//:curl' failed: gcc failed: error executing command /bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -MD -MF ... (remaining 50 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
external/curl/lib/if2ip.c:47:23: fatal error: stropts.h: No such file or directory
# include <stropts.h>
^
compilation terminated.
INFO: Elapsed time: 12.994s, Critical Path: 8.79s
sudo touch /usr/include/stropts.h fixes this issue. (Fedora 25)
Thank you, it fixed it in centos also!
Creating an empty stropts.h is not a great solution to this issue. Building CURL on CentOS from a cloned github source _does not_ run into this problem. The bug is in how CURL is configured by tensorflow. In third_party/curl.BUILD it sets HAVE_STROPTS_H to 1 when building include/curl_config.h. I don't know if stropts.h is being used by CURL at all. It is definitely not being used on CentOS. And I don't have an Ubuntu system to experiment on to find out. It would have been better to leave this bug open and have the tf team take a quick look at it.
@oleg-kiselev thank you
I went to this file /root/.cache/bazel/_bazel_root/65b3db6a809ce98ae6975189354f0e27/external/curl/lib/if2ip.c and commented this line # include <stropts.h> it worked, and I had no issues, may be you can give it a shot. though this is not good advice.
or you can remove this line "# define HAVE_STROPTS_H 1", from BUILD file
vim tensorflow/third_party/curl.BUILD
remove the line like:
define HAVE_STROPTS_H 1
Just a note - as per above you really need to delete the line - I was setting HAVE_STROPTS_H to zero and it still broke in interesting ways.
Any solution. I am having the same problem. I am installing tensorflow for Redhat
touch /usr/include/stropts.h fixes the curl problem for me as well (in branch r1.4). Installing curl from source (as in here https://gist.github.com/jarutis/6c2934705298720ff92a1c10f6a009d4) did not fix the curl compilation error. Note that the HAVE_STROPS_H definition has been removed from the master branch. Is there a stable branch with this fix?
Most helpful comment
sudo touch /usr/include/stropts.hfixes this issue. (Fedora 25)