title: Which version of protocol buffers does TensorFlow 1.1 depend on?
body: <p>It is unclear which version of protocol buffers TensorFlow 1.1 depends on.</p>
  
  <ul>
  <li>The pip package built by TensorFlow 1.1 <a href="https://github.com/tensorflow/tensorflow/blob/r1.1/tensorflow/tools/pip_package/setup.py#L37" rel="nofollow noreferrer">depends on protobuf >= 3.2</a>.</li>
  <li>The <a href="https://www.tensorflow.org/install/install_linux#protobuf_pip_package_31" rel="nofollow noreferrer">TensorFlow installation instructions for Ubuntu</a> reference protobuf 3.1.</li>
  </ul>
  
  <p>Furthermore, attempting to build TensorFlow 1.1 from source whilst using protobuf 3.1, 3.2, or 3.3 built from source fails.</p>
  
  <p>I can build TensorFlow 1.1 from source as long as I allow it to build its own copy of protobuf but I would rather it used a common version if possible.</p>
  
  <p>If I build protobuf 3.1 from source and then attempt to build TensorFlow 1.1 from source I get the following error:</p>
  
  <pre><code>ERROR: &lt;snip&gt;/.cache/bazel/_bazel_daniel/041a78b467f26d47aee0fcd68c1f3624/external/protobuf/BUILD:73:1: C++ compilation of rule '@protobuf//:protobuf_lite' 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 45 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
  external/protobuf/src/google/protobuf/wire_format_lite.cc:393:67: error: no 'void google::protobuf::internal::WireFormatLite::WriteFloatArray(const float*, int, google::protobuf::io::CodedOutputStream*)' member function declared in class 'google::protobuf::internal::WireFormatLite'
                                        io::CodedOutputStream* output) {
                                                                     ^
  external/protobuf/src/google/protobuf/wire_format_lite.cc:398:67: error: no 'void google::protobuf::internal::WireFormatLite::WriteDoubleArray(const double*, int, google::protobuf::io::CodedOutputStream*)' member function declared in class 'google::protobuf::internal::WireFormatLite'
                                        io::CodedOutputStream* output) {
                                                                     ^
  external/protobuf/src/google/protobuf/wire_format_lite.cc:403:67: error: no 'void google::protobuf::internal::WireFormatLite::WriteFixed32Array(const uint32*, int, google::protobuf::io::CodedOutputStream*)' member function declared in class 'google::protobuf::internal::WireFormatLite'
                                        io::CodedOutputStream* output) {
                                                                     ^
  external/protobuf/src/google/protobuf/wire_format_lite.cc:408:69: error: no 'void google::protobuf::internal::WireFormatLite::WriteFixed64Array(const uint64*, int, google::protobuf::io::CodedOutputStream*)' member function declared in class 'google::protobuf::internal::WireFormatLite'
                                          io::CodedOutputStream* output) {
                                                                       ^
  external/protobuf/src/google/protobuf/wire_format_lite.cc:413:69: error: no 'void google::protobuf::internal::WireFormatLite::WriteSFixed32Array(const int32*, int, google::protobuf::io::CodedOutputStream*)' member function declared in class 'google::protobuf::internal::WireFormatLite'
                                          io::CodedOutputStream* output) {
                                                                       ^
  external/protobuf/src/google/protobuf/wire_format_lite.cc:418:69: error: no 'void google::protobuf::internal::WireFormatLite::WriteSFixed64Array(const int64*, int, google::protobuf::io::CodedOutputStream*)' member function declared in class 'google::protobuf::internal::WireFormatLite'
                                          io::CodedOutputStream* output) {
                                                                       ^
  external/protobuf/src/google/protobuf/wire_format_lite.cc:423:66: error: no 'void google::protobuf::internal::WireFormatLite::WriteBoolArray(const bool*, int, google::protobuf::io::CodedOutputStream*)' member function declared in class 'google::protobuf::internal::WireFormatLite'
                                       io::CodedOutputStream* output) {
                                                                    ^
  external/protobuf/src/google/protobuf/wire_format_lite.cc: In static member function 'static void google::protobuf::internal::WireFormatLite::WriteGroupMaybeToArray(int, const google::protobuf::MessageLite&amp;, google::protobuf::io::CodedOutputStream*)':
  external/protobuf/src/google/protobuf/wire_format_lite.cc:557:17: error: 'class google::protobuf::io::CodedOutputStream' has no member named 'IsSerializationDeterministic'
           output-&gt;IsSerializationDeterministic(), target);
                   ^
  external/protobuf/src/google/protobuf/wire_format_lite.cc: In static member function 'static void google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(int, const google::protobuf::MessageLite&amp;, google::protobuf::io::CodedOutputStream*)':
  external/protobuf/src/google/protobuf/wire_format_lite.cc:574:17: error: 'class google::protobuf::io::CodedOutputStream' has no member named 'IsSerializationDeterministic'
           output-&gt;IsSerializationDeterministic(), target);
                   ^
  external/protobuf/src/google/protobuf/wire_format_lite.cc: At global scope:
  external/protobuf/src/google/protobuf/wire_format_lite.cc:739:8: error: prototype for 'size_t google::protobuf::internal::WireFormatLite::Int32Size(const google::protobuf::RepeatedField&lt;int&gt;&amp;)' does not match any in class 'google::protobuf::internal::WireFormatLite'
   size_t WireFormatLite::Int32Size(const RepeatedField&lt;int32&gt;&amp; value) {
          ^
  In file included from external/protobuf/src/google/protobuf/wire_format_lite.cc:35:0:
  &lt;snip&gt;/source/protobuf/protobuf-3.1.0/inst/include/google/protobuf/wire_format_lite_inl.h:813:15: error: candidate is: static size_t google::protobuf::internal::WireFormatLite::Int32Size(google::protobuf::int32)
   inline size_t WireFormatLite::Int32Size(int32 value) {
                 ^
  external/protobuf/src/google/protobuf/wire_format_lite.cc:748:8: error: prototype for 'size_t google::protobuf::internal::WireFormatLite::UInt32Size(const google::protobuf::RepeatedField&lt;unsigned int&gt;&amp;)' does not match any in class 'google::protobuf::internal::WireFormatLite'
   size_t WireFormatLite::UInt32Size(const RepeatedField&lt;uint32&gt;&amp; value) {
          ^
  In file included from external/protobuf/src/google/protobuf/wire_format_lite.cc:35:0:
  &lt;snip&gt;/source/protobuf/protobuf-3.1.0/inst/include/google/protobuf/wire_format_lite_inl.h:819:15: error: candidate is: static size_t google::protobuf::internal::WireFormatLite::UInt32Size(google::protobuf::uint32)
   inline size_t WireFormatLite::UInt32Size(uint32 value) {
                 ^
  external/protobuf/src/google/protobuf/wire_format_lite.cc:757:8: error: prototype for 'size_t google::protobuf::internal::WireFormatLite::SInt32Size(const google::protobuf::RepeatedField&lt;int&gt;&amp;)' does not match any in class 'google::protobuf::internal::WireFormatLite'
   size_t WireFormatLite::SInt32Size(const RepeatedField&lt;int32&gt;&amp; value) {
          ^
  In file included from external/protobuf/src/google/protobuf/wire_format_lite.cc:35:0:
  &lt;snip&gt;/source/protobuf/protobuf-3.1.0/inst/include/google/protobuf/wire_format_lite_inl.h:825:15: error: candidate is: static size_t google::protobuf::internal::WireFormatLite::SInt32Size(google::protobuf::int32)
   inline size_t WireFormatLite::SInt32Size(int32 value) {
                 ^
  external/protobuf/src/google/protobuf/wire_format_lite.cc:766:8: error: prototype for 'size_t google::protobuf::internal::WireFormatLite::EnumSize(const google::protobuf::RepeatedField&lt;int&gt;&amp;)' does not match any in class 'google::protobuf::internal::WireFormatLite'
   size_t WireFormatLite::EnumSize(const RepeatedField&lt;int&gt;&amp; value) {
          ^
  In file included from external/protobuf/src/google/protobuf/wire_format_lite.cc:35:0:
  &lt;snip&gt;/source/protobuf/protobuf-3.1.0/inst/include/google/protobuf/wire_format_lite_inl.h:831:15: error: candidate is: static size_t google::protobuf::internal::WireFormatLite::EnumSize(int)
   inline size_t WireFormatLite::EnumSize(int value) {
                 ^
  Target //tensorflow/tools/pip_package:build_pip_package failed to build
  </code></pre>
  
  <p>If I build protobuf 3.2 from source and then attempt to build TensorFlow 1.1 from source I get the following error:</p>
  
  <pre><code>ERROR: &lt;snip&gt;/.cache/bazel/_bazel_daniel/041a78b467f26d47aee0fcd68c1f3624/external/protobuf/BUILD:113:1: C++ compilation of rule '@protobuf//:protobuf' 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 43 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
  external/protobuf/src/google/protobuf/util/json_util.cc:52:49: error: definition of implicitly-declared 'virtual google::protobuf::util::internal::ZeroCopyStreamByteSink::~ZeroCopyStreamByteSink()'
   ZeroCopyStreamByteSink::~ZeroCopyStreamByteSink() {
                                                   ^
  external/protobuf/src/google/protobuf/util/json_util.cc: In member function 'virtual void google::protobuf::util::internal::ZeroCopyStreamByteSink::Append(const char*, size_t)':
  external/protobuf/src/google/protobuf/util/json_util.cc:58:16: error: 'buffer_size_' was not declared in this scope
       if (len &lt;= buffer_size_) {
                  ^
  external/protobuf/src/google/protobuf/util/json_util.cc:59:14: error: 'buffer_' was not declared in this scope
         memcpy(buffer_, bytes, len);
                ^
  external/protobuf/src/google/protobuf/util/json_util.cc:64:12: error: 'buffer_' was not declared in this scope
       memcpy(buffer_, bytes, buffer_size_);
              ^
  external/protobuf/src/google/protobuf/util/json_util.cc:64:28: error: 'buffer_size_' was not declared in this scope
       memcpy(buffer_, bytes, buffer_size_);
                              ^
  external/protobuf/src/google/protobuf/util/json_util.cc: In function 'google::protobuf::util::Status google::protobuf::util::BinaryToJsonStream(google::protobuf::util::TypeResolver*, const string&amp;, google::protobuf::io::ZeroCopyInputStream*, google::protobuf::io::ZeroCopyOutputStream*, const google::protobuf::util::JsonPrintOptions&amp;)':
  external/protobuf/src/google/protobuf/util/json_util.cc:85:47: error: 'const struct google::protobuf::util::JsonPrintOptions' has no member named 'always_print_enums_as_ints'
     proto_source.set_use_ints_for_enums(options.always_print_enums_as_ints);
                                                 ^
  Target //tensorflow/tools/pip_package:build_pip_package failed to build
  </code></pre>
  
  <p>If I build protobuf 3.3 from source and then attempt to build TensorFlow 1.1 from source I get the following error:</p>
  
  <pre><code>ERROR: &lt;snip&gt;/.cache/bazel/_bazel_daniel/041a78b467f26d47aee0fcd68c1f3624/external/protobuf/BUILD:73:1: C++ compilation of rule '@protobuf//:protobuf_lite' 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 45 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
  external/protobuf/src/google/protobuf/arenastring.cc:41:6: error: redefinition of 'void google::protobuf::internal::ArenaStringPtr::AssignWithDefault(const string*, google::protobuf::internal::ArenaStringPtr)'
   void ArenaStringPtr::AssignWithDefault(const ::std::string* default_value,
        ^
  In file included from external/protobuf/src/google/protobuf/arenastring.cc:34:0:
  &lt;snip&gt;/source/protobuf/protobuf-3.3.0/inst/include/google/protobuf/arenastring.h:316:13: note: 'void google::protobuf::internal::ArenaStringPtr::AssignWithDefault(const string*, google::protobuf::internal::ArenaStringPtr)' previously defined here
   inline void ArenaStringPtr::AssignWithDefault(const ::std::string* default_value,
               ^
  Target //tensorflow/tools/pip_package:build_pip_package failed to build
  </code></pre>