serving
serving copied to clipboard
Unable to build tensorflow-model-server in macOS using bazel
I'm on macOS 10.13.5
After executing bazel build -c opt tensorflow_serving/... as mentioned in installation instructions, I'm getting the following error.
Beginning of the error:
ERROR: /private/var/tmp/_bazel_Sumanth/f07d738ca2f9eb67816d8a220b407e4d/external/org_tensorflow/tensorflow/python/BUILD:396:1: C++ compilation of rule '@org_tensorflow//tensorflow/python:py_util' failed (Exit 1)
In file included from external/org_tensorflow/tensorflow/python/lib/core/py_util.cc:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/locale:182:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:492:15: error: C++ requires a type specifier for all declarations
char_type toupper(char_type __c) const
^
bazel-out/host/genfiles/external/local_config_python/python_include/pyport.h:731:29: note: expanded from macro 'toupper'
#define toupper(c) towupper(btowc(c))
^
In file included from external/org_tensorflow/tensorflow/python/lib/core/py_util.cc:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/locale:182:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:498:48: error: too many arguments provided to function-like macro invocation
const char_type* toupper(char_type* __low, const char_type* __high) const
^
bazel-out/host/genfiles/external/local_config_python/python_include/pyport.h:731:9: note: macro 'toupper' defined here
#define toupper(c) towupper(btowc(c))
^
In file included from external/org_tensorflow/tensorflow/python/lib/core/py_util.cc:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/locale:182:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:498:29: error: expected ';' at end of declaration list
const char_type* toupper(char_type* __low, const char_type* __high) const
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:510:48: error: too many arguments provided to function-like macro invocation
const char_type* tolower(char_type* __low, const char_type* __high) const
^
bazel-out/host/genfiles/external/local_config_python/python_include/pyport.h:729:9: note: macro 'tolower' defined here
#define tolower(c) towlower(btowc(c))
^
In file included from external/org_tensorflow/tensorflow/python/lib/core/py_util.cc:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/locale:182:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/_locale:494:27: error: use of undeclared identifier '_c'
return do_toupper(__c);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:601:15: error: C++ requires a type specifier for all declarations
char_type toupper(char_type __c) const
^
bazel-out/host/genfiles/external/local_config_python/python_include/pyport.h:731:29: note: expanded from macro 'toupper'
#define toupper(c) towupper(btowc(c))
^
In file included from external/org_tensorflow/tensorflow/python/lib/core/py_util.cc:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/locale:182:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:607:48: error: too many arguments provided to function-like macro invocation
const char_type* toupper(char_type* __low, const char_type* __high) const
^
bazel-out/host/genfiles/external/local_config_python/python_include/pyport.h:731:9: note: macro 'toupper' defined here
#define toupper(c) towupper(btowc(c))
^
In file included from external/org_tensorflow/tensorflow/python/lib/core/py_util.cc:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/locale:182:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:607:29: error: expected ';' at end of declaration list
const char_type* toupper(char_type* __low, const char_type* __high) const
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:619:48: error: too many arguments provided to function-like macro invocation
const char_type* tolower(char_type* __low, const char_type* __high) const
^
bazel-out/host/genfiles/external/local_config_python/python_include/pyport.h:729:9: note: macro 'tolower' defined here
#define tolower(c) towlower(btowc(c))
^
In file included from external/org_tensorflow/tensorflow/python/lib/core/py_util.cc:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/locale:182:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/_locale:603:27: error: use of undeclared identifier '_c'
return do_toupper(__c);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:729:21: error: too many arguments provided to function-like macro invocation
isspace(_CharT __c, const locale& __loc)
^
bazel-out/host/genfiles/external/local_config_python/python_include/pyport.h:725:9: note: macro 'isspace' defined here
#define isspace(c) iswspace(btowc(c))
^
In file included from external/org_tensorflow/tensorflow/python/lib/core/py_util.cc:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/locale:182:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:729:1: error: declaration conflicts with target of using declaration already in scope
isspace(_CharT __c, const locale& __loc)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/_ctype.h:267:1: note: target of using declaration
isspace(int _c)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cctype:113:9: note: using declaration
using ::isspace;
^
In file included from external/org_tensorflow/tensorflow/python/lib/core/py_util.cc:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/locale:182:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:731:5: error: expected expression
return use_facet<ctype<CharT> >(_loc).is(ctype_base::space, __c);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:732:2: error: expected ';' at end of declaration
}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:753:21: error: too many arguments provided to function-like macro invocation
isupper(_CharT __c, const locale& __loc)
^
bazel-out/host/genfiles/external/local_config_python/python_include/pyport.h:727:9: note: macro 'isupper' defined here
#define isupper(c) iswupper(btowc(c))
^
In file included from external/org_tensorflow/tensorflow/python/lib/core/py_util.cc:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/locale:182:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:753:1: error: declaration conflicts with target of using declaration already in scope
isupper(_CharT __c, const locale& __loc)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/_ctype.h:273:1: note: target of using declaration
isupper(int _c)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cctype:114:9: note: using declaration
using ::isupper;
^
In file included from external/org_tensorflow/tensorflow/python/lib/core/py_util.cc:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/locale:182:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:755:5: error: expected expression
return use_facet<ctype<CharT> >(_loc).is(ctype_base::upper, __c);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:756:2: error: expected ';' at end of declaration
}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale:761:21: error: too many arguments provided to function-like macro invocation
islower(_CharT __c, const locale& __loc)
^
bazel-out/host/genfiles/external/local_config_python/python_include/pyport.h:723:9: note: macro 'islower' defined here
#define islower(c) iswlower(btowc(c))
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
INFO: Elapsed time: 5440.752s, Critical Path: 606.11s
INFO: 1671 processes, local.
FAILED: Build did NOT complete successfully
this does not answer your question directly, but you can alternatively develop within a docker container (on macos) using the (official) devel images provided here: https://hub.docker.com/r/tensorflow/serving/
more details: https://github.com/tensorflow/serving/blob/master/tensorflow_serving/g3doc/docker.md#developing-with-docker
@netfs Thanks. I'm able to build using Docker. Need to pass some flag to bazel command to fix bazel build I think.