ubuntu18.04安装protobuf

本文详细介绍了protobuf的编译步骤,包括从源码获取、编译配置、编译过程及安装,同时也展示了编译过程中的部分输出信息,帮助读者理解protobuf的构建流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

关于protobuf的介绍和应用参考

ONNX格式解析之google protobuf解析_tugouxp的专栏-优快云博客ONNX模型是按照google protobuf格式保存的,模型训练的目的就是为了得到变量的权值,只不过是纯数字罢了,但是我们也不能就这样把这些数字一个一个地写入文件,因为在要保存的模型文件里,不光要保存权值,也要告诉之后用这个模型的人,模型结构是怎么样的,所以需要合理地设计保存文件的格式。不同的机器学习框架都有自己的模型保存格式,例如 Keras 的模型格式是 h5,而 Tensorflow 和 onnx 的保存格式就是 protobuf。其实 protobuf 使用起来非常简单方便,就是自己先定义一https://blog.youkuaiyun.com/tugouxp/article/details/120583308下面介绍其安装:

git clone https://github.com/protocolbuffers/protobuf.git

git reset到最新版本

git submodule update --init --recursive

 编译,执行

./autogen.sh

./configure

编译:

 检查

make check
(base) caozilong@caozilong-Vostro-3268:~/protoc/protobuf$ make check
Making check in .
make[1]: 进入目录“/home/caozilong/protoc/protobuf”
make  check-local
make[2]: 进入目录“/home/caozilong/protoc/protobuf”
Making lib/libgmock.a lib/libgmock_main.a in gmock
make[3]: 进入目录“/home/caozilong/protoc/protobuf/third_party/googletest/googletest”
depbase=`echo src/gtest-all.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./build-aux  -I. -I./include  -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG -MT src/gtest-all.lo -MD -MP -MF $depbase.Tpo -c -o src/gtest-all.lo src/gtest-all.cc &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./build-aux -I. -I./include -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG -MT src/gtest-all.lo -MD -MP -MF src/.deps/gtest-all.Tpo -c src/gtest-all.cc  -fPIC -DPIC -o src/.libs/gtest-all.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./build-aux -I. -I./include -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG -MT src/gtest-all.lo -MD -MP -MF src/.deps/gtest-all.Tpo -c src/gtest-all.cc -o src/gtest-all.o >/dev/null 2>&1
/bin/bash ./libtool  --tag=CXX   --mode=link g++ -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG   -o lib/libgtest.la -rpath /usr/local/lib src/gtest-all.lo  
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o  src/.libs/gtest-all.o   -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o  -pthread -g   -pthread -Wl,-soname -Wl,libgtest.so.0 -o lib/.libs/libgtest.so.0.0.0
libtool: link: (cd "lib/.libs" && rm -f "libgtest.so.0" && ln -s "libgtest.so.0.0.0" "libgtest.so.0")
libtool: link: (cd "lib/.libs" && rm -f "libgtest.so" && ln -s "libgtest.so.0.0.0" "libgtest.so")
libtool: link: ar cru lib/.libs/libgtest.a  src/gtest-all.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib lib/.libs/libgtest.a
libtool: link: ( cd "lib/.libs" && rm -f "libgtest.la" && ln -s "../libgtest.la" "libgtest.la" )
depbase=`echo src/gtest_main.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./build-aux  -I. -I./include  -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG -MT src/gtest_main.lo -MD -MP -MF $depbase.Tpo -c -o src/gtest_main.lo src/gtest_main.cc &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./build-aux -I. -I./include -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG -MT src/gtest_main.lo -MD -MP -MF src/.deps/gtest_main.Tpo -c src/gtest_main.cc  -fPIC -DPIC -o src/.libs/gtest_main.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./build-aux -I. -I./include -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG -MT src/gtest_main.lo -MD -MP -MF src/.deps/gtest_main.Tpo -c src/gtest_main.cc -o src/gtest_main.o >/dev/null 2>&1
/bin/bash ./libtool  --tag=CXX   --mode=link g++ -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG   -o lib/libgtest_main.la -rpath /usr/local/lib src/gtest_main.lo lib/libgtest.la 
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o  src/.libs/gtest_main.o   -Wl,-rpath -Wl,/home/caozilong/protoc/protobuf/third_party/googletest/googletest/lib/.libs lib/.libs/libgtest.so -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o  -pthread -g   -pthread -Wl,-soname -Wl,libgtest_main.so.0 -o lib/.libs/libgtest_main.so.0.0.0
libtool: link: (cd "lib/.libs" && rm -f "libgtest_main.so.0" && ln -s "libgtest_main.so.0.0.0" "libgtest_main.so.0")
libtool: link: (cd "lib/.libs" && rm -f "libgtest_main.so" && ln -s "libgtest_main.so.0.0.0" "libgtest_main.so")
libtool: link: ar cru lib/.libs/libgtest_main.a  src/gtest_main.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib lib/.libs/libgtest_main.a
libtool: link: ( cd "lib/.libs" && rm -f "libgtest_main.la" && ln -s "../libgtest_main.la" "libgtest_main.la" )
make[3]: 离开目录“/home/caozilong/protoc/protobuf/third_party/googletest/googletest”
make[3]: 进入目录“/home/caozilong/protoc/protobuf/third_party/googletest/googlemock”
depbase=`echo src/gmock-all.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./build-aux  -I./../googletest/include -I./include  -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG -MT src/gmock-all.lo -MD -MP -MF $depbase.Tpo -c -o src/gmock-all.lo src/gmock-all.cc &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./build-aux -I./../googletest/include -I./include -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG -MT src/gmock-all.lo -MD -MP -MF src/.deps/gmock-all.Tpo -c src/gmock-all.cc  -fPIC -DPIC -o src/.libs/gmock-all.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./build-aux -I./../googletest/include -I./include -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG -MT src/gmock-all.lo -MD -MP -MF src/.deps/gmock-all.Tpo -c src/gmock-all.cc -o src/gmock-all.o >/dev/null 2>&1
/bin/bash ./libtool  --tag=CXX   --mode=link g++ -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG   -o lib/libgmock.la -rpath /usr/local/lib src/gmock-all.lo  
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o  src/.libs/gmock-all.o   -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o  -pthread -g   -pthread -Wl,-soname -Wl,libgmock.so.0 -o lib/.libs/libgmock.so.0.0.0
libtool: link: (cd "lib/.libs" && rm -f "libgmock.so.0" && ln -s "libgmock.so.0.0.0" "libgmock.so.0")
libtool: link: (cd "lib/.libs" && rm -f "libgmock.so" && ln -s "libgmock.so.0.0.0" "libgmock.so")
libtool: link: ar cru lib/.libs/libgmock.a  src/gmock-all.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib lib/.libs/libgmock.a
libtool: link: ( cd "lib/.libs" && rm -f "libgmock.la" && ln -s "../libgmock.la" "libgmock.la" )
depbase=`echo src/gmock_main.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./build-aux  -I./../googletest/include -I./include  -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG -MT src/gmock_main.lo -MD -MP -MF $depbase.Tpo -c -o src/gmock_main.lo src/gmock_main.cc &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./build-aux -I./../googletest/include -I./include -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG -MT src/gmock_main.lo -MD -MP -MF src/.deps/gmock_main.Tpo -c src/gmock_main.cc  -fPIC -DPIC -o src/.libs/gmock_main.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./build-aux -I./../googletest/include -I./include -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG -MT src/gmock_main.lo -MD -MP -MF src/.deps/gmock_main.Tpo -c src/gmock_main.cc -o src/gmock_main.o >/dev/null 2>&1
/bin/bash ./libtool  --tag=CXX   --mode=link g++ -pthread -DGTEST_HAS_PTHREAD=1 -g -std=c++11 -DNDEBUG   -o lib/libgmock_main.la -rpath /usr/local/lib src/gmock_main.lo lib/libgmock.la 
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o  src/.libs/gmock_main.o   -Wl,-rpath -Wl,/home/caozilong/protoc/protobuf/third_party/googletest/googlemock/lib/.libs lib/.libs/libgmock.so -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o  -pthread -g   -pthread -Wl,-soname -Wl,libgmock_main.so.0 -o lib/.libs/libgmock_main.so.0.0.0
libtool: link: (cd "lib/.libs" && rm -f "libgmock_main.so.0" && ln -s "libgmock_main.so.0.0.0" "libgmock_main.so.0")
libtool: link: (cd "lib/.libs" && rm -f "libgmock_main.so" && ln -s "libgmock_main.so.0.0.0" "libgmock_main.so")
libtool: link: ar cru lib/.libs/libgmock_main.a  src/gmock_main.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib lib/.libs/libgmock_main.a
libtool: link: ( cd "lib/.libs" && rm -f "libgmock_main.la" && ln -s "../libgmock_main.la" "libgmock_main.la" )
make[3]: 离开目录“/home/caozilong/protoc/protobuf/third_party/googletest/googlemock”
make[2]: 离开目录“/home/caozilong/protoc/protobuf”
make[1]: 离开目录“/home/caozilong/protoc/protobuf”
Making check in src
make[1]: 进入目录“/home/caozilong/protoc/protobuf/src”
make  protoc protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test test_plugin protobuf-lite-arena-test no-warning-test zcgzip zcgunzip
make[2]: 进入目录“/home/caozilong/protoc/protobuf/src”
make[2]: “protoc”已是最新。
oldpwd=`pwd` && ( cd . && $oldpwd/protoc -I. --cpp_out=$oldpwd google/protobuf/any_test.proto google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto google/protobuf/map_lite_unittest.proto google/protobuf/map_proto2_unittest.proto google/protobuf/map_unittest.proto google/protobuf/unittest_arena.proto google/protobuf/unittest_custom_options.proto google/protobuf/unittest_drop_unknown_fields.proto google/protobuf/unittest_embed_optimize_for.proto google/protobuf/unittest_empty.proto google/protobuf/unittest_enormous_descriptor.proto google/protobuf/unittest_import_lite.proto google/protobuf/unittest_import.proto google/protobuf/unittest_import_public_lite.proto google/protobuf/unittest_import_public.proto google/protobuf/unittest_lazy_dependencies.proto google/protobuf/unittest_lazy_dependencies_custom_option.proto google/protobuf/unittest_lazy_dependencies_enum.proto google/protobuf/unittest_lite_imports_nonlite.proto google/protobuf/unittest_lite.proto google/protobuf/unittest_mset.proto google/protobuf/unittest_mset_wire_format.proto google/protobuf/unittest_no_arena_lite.proto google/protobuf/unittest_no_arena_import.proto google/protobuf/unittest_no_arena.proto google/protobuf/unittest_no_field_presence.proto google/protobuf/unittest_no_generic_services.proto google/protobuf/unittest_optimize_for.proto google/protobuf/unittest_preserve_unknown_enum2.proto google/protobuf/unittest_preserve_unknown_enum.proto google/protobuf/unittest.proto google/protobuf/unittest_proto3.proto google/protobuf/unittest_proto3_arena.proto google/protobuf/unittest_proto3_arena_lite.proto google/protobuf/unittest_proto3_lite.proto google/protobuf/unittest_well_known_types.proto google/protobuf/util/internal/testdata/anys.proto google/protobuf/util/internal/testdata/books.proto google/protobuf/util/internal/testdata/default_value.proto google/protobuf/util/internal/testdata/default_value_test.proto google/protobuf/util/internal/testdata/field_mask.proto google/protobuf/util/internal/testdata/maps.proto google/protobuf/util/internal/testdata/oneofs.proto google/protobuf/util/internal/testdata/proto3.proto google/protobuf/util/internal/testdata/struct.proto google/protobuf/util/internal/testdata/timestamp_duration.proto google/protobuf/util/internal/testdata/wrappers.proto google/protobuf/util/json_format.proto google/protobuf/util/json_format_proto3.proto google/protobuf/util/message_differencer_unittest.proto google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto )
touch unittest_proto_middleman
  CXX      google/protobuf/stubs/protobuf_test-bytestream_unittest.o
  CXX      google/protobuf/stubs/protobuf_test-common_unittest.o
  CXX      google/protobuf/stubs/protobuf_test-int128_unittest.o
  CXX      google/protobuf/io/protobuf_test-io_win32_unittest.o
  CXX      google/protobuf/stubs/protobuf_test-statusor_test.o
  CXX      google/protobuf/stubs/protobuf_test-status_test.o
  CXX      google/protobuf/stubs/protobuf_test-stringpiece_unittest.o
  CXX      google/protobuf/stubs/protobuf_test-stringprintf_unittest.o
  CXX      google/protobuf/stubs/protobuf_test-structurally_valid_unittest.o
  CXX      google/protobuf/stubs/protobuf_test-strutil_unittest.o
  CXX      google/protobuf/stubs/protobuf_test-template_util_unittest.o
  CXX      google/protobuf/stubs/protobuf_test-time_test.o
  CXX      google/protobuf/protobuf_test-any_test.o
  CXX      google/protobuf/protobuf_test-arenastring_unittest.o
  CXX      google/protobuf/protobuf_test-arena_unittest.o
  CXX      google/protobuf/protobuf_test-descriptor_database_unittest.o
  CXX      google/protobuf/protobuf_test-descriptor_unittest.o

  CXX      google/protobuf/protobuf_test-drop_unknown_fields_test.o
  CXX      google/protobuf/protobuf_test-dynamic_message_unittest.o
  CXX      google/protobuf/protobuf_test-extension_set_unittest.o
  CXX      google/protobuf/protobuf_test-generated_message_reflection_unittest.o
  CXX      google/protobuf/protobuf_test-map_field_test.o
  CXX      google/protobuf/protobuf_test-map_test.o
  CXX      google/protobuf/protobuf_test-message_unittest.o
  CXX      google/protobuf/protobuf_test-no_field_presence_test.o
  CXX      google/protobuf/protobuf_test-preserve_unknown_enum_test.o
  CXX      google/protobuf/protobuf_test-proto3_arena_lite_unittest.o
  CXX      google/protobuf/protobuf_test-proto3_arena_unittest.o
  CXX      google/protobuf/protobuf_test-proto3_lite_unittest.o
  CXX      google/protobuf/protobuf_test-reflection_ops_unittest.o
  CXX      google/protobuf/protobuf_test-repeated_field_reflection_unittest.o
  CXX      google/protobuf/protobuf_test-repeated_field_unittest.o
  CXX      google/protobuf/protobuf_test-text_format_unittest.o
  CXX      google/protobuf/protobuf_test-unknown_field_set_unittest.o
  CXX      google/protobuf/protobuf_test-well_known_types_unittest.o
  CXX      google/protobuf/protobuf_test-wire_format_unittest.o
  CXX      google/protobuf/io/protobuf_test-coded_stream_unittest.o
  CXX      google/protobuf/io/protobuf_test-printer_unittest.o
  CXX      google/protobuf/io/protobuf_test-tokenizer_unittest.o
  CXX      google/protobuf/io/protobuf_test-zero_copy_stream_unittest.o
  CXX      google/protobuf/compiler/protobuf_test-annotation_test_util.o
  CXX      google/protobuf/compiler/protobuf_test-command_line_interface_unittest.o
  CXX      google/protobuf/compiler/protobuf_test-importer_unittest.o
  CXX      google/protobuf/compiler/protobuf_test-mock_code_generator.o
  CXX      google/protobuf/compiler/protobuf_test-parser_unittest.o
  CXX      google/protobuf/compiler/cpp/protobuf_test-cpp_bootstrap_unittest.o
  CXX      google/protobuf/compiler/cpp/protobuf_test-cpp_move_unittest.o
  CXX      google/protobuf/compiler/cpp/protobuf_test-cpp_unittest.o
  CXX      google/protobuf/compiler/cpp/protobuf_test-cpp_plugin_unittest.o
  CXX      google/protobuf/compiler/cpp/protobuf_test-metadata_test.o
  CXX      google/protobuf/compiler/java/protobuf_test-java_plugin_unittest.o
  CXX      google/protobuf/compiler/java/protobuf_test-java_doc_comment_unittest.o
  CXX      google/protobuf/compiler/objectivec/protobuf_test-objectivec_helpers_unittest.o
  CXX      google/protobuf/compiler/python/protobuf_test-python_plugin_unittest.o
  CXX      google/protobuf/compiler/ruby/protobuf_test-ruby_generator_unittest.o
  CXX      google/protobuf/compiler/csharp/protobuf_test-csharp_bootstrap_unittest.o
  CXX      google/protobuf/compiler/csharp/protobuf_test-csharp_generator_unittest.o
  CXX      google/protobuf/util/protobuf_test-delimited_message_util_test.o
  CXX      google/protobuf/util/protobuf_test-field_comparator_test.o
  CXX      google/protobuf/util/protobuf_test-field_mask_util_test.o
  CXX      google/protobuf/util/internal/protobuf_test-default_value_objectwriter_test.o
  CXX      google/protobuf/util/internal/protobuf_test-json_objectwriter_test.o
  CXX      google/protobuf/util/internal/protobuf_test-json_stream_parser_test.o
  CXX      google/protobuf/util/internal/protobuf_test-protostream_objectsource_test.o
  CXX      google/protobuf/util/internal/protobuf_test-protostream_objectwriter_test.o
  CXX      google/protobuf/util/internal/protobuf_test-type_info_test_helper.o
  CXX      google/protobuf/util/protobuf_test-json_util_test.o
  CXX      google/protobuf/util/protobuf_test-message_differencer_unittest.o
  CXX      google/protobuf/util/protobuf_test-time_util_test.o
  CXX      google/protobuf/util/protobuf_test-type_resolver_util_test.o
  CXX      google/protobuf/protobuf_test-arena_test_util.o
  CXX      google/protobuf/protobuf_test-map_test_util.o
  CXX      google/protobuf/protobuf_test-test_util.o
  CXX      google/protobuf/testing/protobuf_test-googletest.o
  CXX      google/protobuf/testing/protobuf_test-file.o
  CXX      google/protobuf/protobuf_test-map_lite_unittest.pb.o
  CXX      google/protobuf/protobuf_test-unittest_lite.pb.o
  CXX      google/protobuf/protobuf_test-unittest_no_arena_lite.pb.o
  CXX      google/protobuf/protobuf_test-unittest_import_lite.pb.o
  CXX      google/protobuf/protobuf_test-unittest_import_public_lite.pb.o
  CXX      google/protobuf/protobuf_test-any_test.pb.o
  CXX      google/protobuf/compiler/cpp/protobuf_test-cpp_test_bad_identifiers.pb.o
  CXX      google/protobuf/compiler/cpp/protobuf_test-cpp_test_large_enum_value.pb.o
  CXX      google/protobuf/protobuf_test-map_proto2_unittest.pb.o
  CXX      google/protobuf/protobuf_test-map_unittest.pb.o
  CXX      google/protobuf/protobuf_test-unittest_arena.pb.o
  CXX      google/protobuf/protobuf_test-unittest_custom_options.pb.o
  CXX      google/protobuf/protobuf_test-unittest_drop_unknown_fields.pb.o
  CXX      google/protobuf/protobuf_test-unittest_embed_optimize_for.pb.o
  CXX      google/protobuf/protobuf_test-unittest_empty.pb.o
  CXX      google/protobuf/protobuf_test-unittest_enormous_descriptor.pb.o
  CXX      google/protobuf/protobuf_test-unittest_import.pb.o
  CXX      google/protobuf/protobuf_test-unittest_import_public.pb.o
  CXX      google/protobuf/protobuf_test-unittest_lazy_dependencies.pb.o
  CXX      google/protobuf/protobuf_test-unittest_lazy_dependencies_custom_option.pb.o
  CXX      google/protobuf/protobuf_test-unittest_lazy_dependencies_enum.pb.o
  CXX      google/protobuf/protobuf_test-unittest_lite_imports_nonlite.pb.o
  CXX      google/protobuf/protobuf_test-unittest_mset.pb.o
  CXX      google/protobuf/protobuf_test-unittest_mset_wire_format.pb.o
  CXX      google/protobuf/protobuf_test-unittest_no_arena_import.pb.o
  CXX      google/protobuf/protobuf_test-unittest_no_arena.pb.o
  CXX      google/protobuf/protobuf_test-unittest_no_field_presence.pb.o
  CXX      google/protobuf/protobuf_test-unittest_no_generic_services.pb.o
  CXX      google/protobuf/protobuf_test-unittest_optimize_for.pb.o
  CXX      google/protobuf/protobuf_test-unittest.pb.o
  CXX      google/protobuf/protobuf_test-unittest_preserve_unknown_enum2.pb.o
  CXX      google/protobuf/protobuf_test-unittest_preserve_unknown_enum.pb.o
  CXX      google/protobuf/protobuf_test-unittest_proto3.pb.o
  CXX      google/protobuf/protobuf_test-unittest_proto3_arena.pb.o
  CXX      google/protobuf/protobuf_test-unittest_proto3_arena_lite.pb.o
  CXX      google/protobuf/protobuf_test-unittest_proto3_lite.pb.o
  CXX      google/protobuf/protobuf_test-unittest_well_known_types.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_test-anys.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_test-books.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_test-default_value.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_test-default_value_test.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_test-field_mask.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_test-maps.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_test-oneofs.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_test-proto3.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_test-struct.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_test-timestamp_duration.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_test-wrappers.pb.o
  CXX      google/protobuf/util/protobuf_test-json_format.pb.o
  CXX      google/protobuf/util/protobuf_test-json_format_proto3.pb.o
  CXX      google/protobuf/util/protobuf_test-message_differencer_unittest.pb.o
  CXXLD    protobuf-test
google/protobuf/testing/protobuf_test-googletest.o: In function `google::protobuf::(anonymous namespace)::GetTemporaryDirectoryName()':
/home/caozilong/protoc/protobuf/src/google/protobuf/testing/googletest.cc:124: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
  CXX      google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_unittest.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-arena_test_util.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-map_test_util.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-test_util.o
  CXX      google/protobuf/testing/protobuf_lazy_descriptor_test-googletest.o
  CXX      google/protobuf/testing/protobuf_lazy_descriptor_test-file.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-map_lite_unittest.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_lite.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_no_arena_lite.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_import_lite.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public_lite.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-any_test.pb.o
  CXX      google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_bad_identifiers.pb.o
  CXX      google/protobuf/compiler/cpp/protobuf_lazy_descriptor_test-cpp_test_large_enum_value.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-map_proto2_unittest.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-map_unittest.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_arena.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_custom_options.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_drop_unknown_fields.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_embed_optimize_for.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_empty.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_enormous_descriptor.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_import.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_import_public.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_custom_option.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_lazy_dependencies_enum.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_lite_imports_nonlite.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_mset.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_mset_wire_format.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_no_arena_import.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_no_arena.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_no_field_presence.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_no_generic_services.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_optimize_for.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum2.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_preserve_unknown_enum.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_arena_lite.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_proto3_lite.pb.o
  CXX      google/protobuf/protobuf_lazy_descriptor_test-unittest_well_known_types.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-anys.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-books.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-default_value_test.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-field_mask.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-maps.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-oneofs.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-proto3.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-struct.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-timestamp_duration.pb.o
  CXX      google/protobuf/util/internal/testdata/protobuf_lazy_descriptor_test-wrappers.pb.o
  CXX      google/protobuf/util/protobuf_lazy_descriptor_test-json_format.pb.o
  CXX      google/protobuf/util/protobuf_lazy_descriptor_test-json_format_proto3.pb.o
  CXX      google/protobuf/util/protobuf_lazy_descriptor_test-message_differencer_unittest.pb.o
  CXXLD    protobuf-lazy-descriptor-test
google/protobuf/testing/protobuf_lazy_descriptor_test-googletest.o: In function `google::protobuf::(anonymous namespace)::GetTemporaryDirectoryName()':
/home/caozilong/protoc/protobuf/src/google/protobuf/testing/googletest.cc:124: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
  CXX      google/protobuf/protobuf_lite_test-lite_unittest.o
  CXX      google/protobuf/protobuf_lite_test-arena_test_util.o
  CXX      google/protobuf/protobuf_lite_test-map_lite_test_util.o
  CXX      google/protobuf/protobuf_lite_test-test_util_lite.o
  CXX      google/protobuf/protobuf_lite_test-map_lite_unittest.pb.o
  CXX      google/protobuf/protobuf_lite_test-unittest_lite.pb.o
  CXX      google/protobuf/protobuf_lite_test-unittest_no_arena_lite.pb.o
  CXX      google/protobuf/protobuf_lite_test-unittest_import_lite.pb.o
  CXX      google/protobuf/protobuf_lite_test-unittest_import_public_lite.pb.o
  CXXLD    protobuf-lite-test
  CXX      google/protobuf/compiler/test_plugin-mock_code_generator.o
  CXX      google/protobuf/testing/test_plugin-file.o
  CXX      google/protobuf/compiler/test_plugin-test_plugin.o
  CXXLD    test_plugin
  CXX      google/protobuf/protobuf_lite_arena_test-lite_arena_unittest.o
  CXX      google/protobuf/protobuf_lite_arena_test-arena_test_util.o
  CXX      google/protobuf/protobuf_lite_arena_test-map_lite_test_util.o
  CXX      google/protobuf/protobuf_lite_arena_test-test_util_lite.o
  CXX      google/protobuf/protobuf_lite_arena_test-map_lite_unittest.pb.o
  CXX      google/protobuf/protobuf_lite_arena_test-unittest_lite.pb.o
  CXX      google/protobuf/protobuf_lite_arena_test-unittest_no_arena_lite.pb.o
  CXX      google/protobuf/protobuf_lite_arena_test-unittest_import_lite.pb.o
  CXX      google/protobuf/protobuf_lite_arena_test-unittest_import_public_lite.pb.o
  CXXLD    protobuf-lite-arena-test
echo "// Generated from Makefile.am" > no_warning_test.cc
for FILE in google/protobuf/stubs/callback.h google/protobuf/stubs/bytestream.h google/protobuf/stubs/casts.h google/protobuf/stubs/common.h google/protobuf/stubs/fastmem.h google/protobuf/stubs/hash.h google/protobuf/stubs/logging.h google/protobuf/stubs/macros.h google/protobuf/stubs/map_util.h google/protobuf/stubs/mutex.h google/protobuf/stubs/once.h google/protobuf/stubs/platform_macros.h google/protobuf/stubs/port.h google/protobuf/stubs/status.h google/protobuf/stubs/stl_util.h google/protobuf/stubs/stringpiece.h google/protobuf/stubs/strutil.h google/protobuf/stubs/template_util.h google/protobuf/any.pb.h google/protobuf/api.pb.h google/protobuf/any.h google/protobuf/arena.h google/protobuf/arena_impl.h google/protobuf/arenastring.h google/protobuf/descriptor_database.h google/protobuf/descriptor.h google/protobuf/descriptor.pb.h google/protobuf/duration.pb.h google/protobuf/dynamic_message.h google/protobuf/empty.pb.h google/protobuf/extension_set.h google/protobuf/extension_set_inl.h google/protobuf/field_mask.pb.h google/protobuf/generated_enum_reflection.h google/protobuf/generated_enum_util.h google/protobuf/generated_message_reflection.h google/protobuf/generated_message_table_driven.h google/protobuf/generated_message_util.h google/protobuf/has_bits.h google/protobuf/implicit_weak_message.h google/protobuf/inlined_string_field.h google/protobuf/map_entry.h google/protobuf/map_entry_lite.h google/protobuf/map_field.h google/protobuf/map_field_inl.h google/protobuf/map_field_lite.h google/protobuf/map.h google/protobuf/map_type_handler.h google/protobuf/message.h google/protobuf/message_lite.h google/protobuf/metadata.h google/protobuf/metadata_lite.h google/protobuf/parse_context.h google/protobuf/port.h google/protobuf/port_def.inc google/protobuf/port_undef.inc google/protobuf/reflection.h google/protobuf/reflection_ops.h google/protobuf/repeated_field.h google/protobuf/service.h google/protobuf/source_context.pb.h google/protobuf/struct.pb.h google/protobuf/text_format.h google/protobuf/timestamp.pb.h google/protobuf/type.pb.h google/protobuf/unknown_field_set.h google/protobuf/wire_format.h google/protobuf/wire_format_lite.h google/protobuf/wrappers.pb.h google/protobuf/io/coded_stream.h google/protobuf/io/gzip_stream.h google/protobuf/io/printer.h google/protobuf/io/strtod.h google/protobuf/io/tokenizer.h google/protobuf/io/zero_copy_stream.h google/protobuf/io/zero_copy_stream_impl.h google/protobuf/io/zero_copy_stream_impl_lite.h google/protobuf/compiler/code_generator.h google/protobuf/compiler/command_line_interface.h google/protobuf/compiler/importer.h google/protobuf/compiler/parser.h google/protobuf/compiler/plugin.h google/protobuf/compiler/plugin.pb.h google/protobuf/compiler/cpp/cpp_generator.h google/protobuf/compiler/csharp/csharp_generator.h google/protobuf/compiler/csharp/csharp_names.h google/protobuf/compiler/java/java_generator.h google/protobuf/compiler/java/java_names.h google/protobuf/compiler/js/js_generator.h google/protobuf/compiler/js/well_known_types_embed.h google/protobuf/compiler/objectivec/objectivec_generator.h google/protobuf/compiler/objectivec/objectivec_helpers.h google/protobuf/compiler/php/php_generator.h google/protobuf/compiler/python/python_generator.h google/protobuf/compiler/ruby/ruby_generator.h google/protobuf/util/type_resolver.h google/protobuf/util/delimited_message_util.h google/protobuf/util/field_comparator.h google/protobuf/util/field_mask_util.h google/protobuf/util/json_util.h google/protobuf/util/time_util.h google/protobuf/util/type_resolver_util.h google/protobuf/util/message_differencer.h; do \
    echo "#include <${FILE}>" >> no_warning_test.cc; \
done
echo "int main(int, char**) { return 0; }" >> no_warning_test.cc
  CXX      no_warning_test-no_warning_test.o
  CXX      google/protobuf/no_warning_test-map_lite_unittest.pb.o
  CXX      google/protobuf/no_warning_test-unittest_lite.pb.o
  CXX      google/protobuf/no_warning_test-unittest_no_arena_lite.pb.o
  CXX      google/protobuf/no_warning_test-unittest_import_lite.pb.o
  CXX      google/protobuf/no_warning_test-unittest_import_public_lite.pb.o
  CXX      google/protobuf/no_warning_test-any_test.pb.o
  CXX      google/protobuf/compiler/cpp/no_warning_test-cpp_test_bad_identifiers.pb.o
  CXX      google/protobuf/compiler/cpp/no_warning_test-cpp_test_large_enum_value.pb.o
  CXX      google/protobuf/no_warning_test-map_proto2_unittest.pb.o
  CXX      google/protobuf/no_warning_test-map_unittest.pb.o
  CXX      google/protobuf/no_warning_test-unittest_arena.pb.o
  CXX      google/protobuf/no_warning_test-unittest_custom_options.pb.o
  CXX      google/protobuf/no_warning_test-unittest_drop_unknown_fields.pb.o
  CXX      google/protobuf/no_warning_test-unittest_embed_optimize_for.pb.o
  CXX      google/protobuf/no_warning_test-unittest_empty.pb.o
  CXX      google/protobuf/no_warning_test-unittest_enormous_descriptor.pb.o
  CXX      google/protobuf/no_warning_test-unittest_import.pb.o
  CXX      google/protobuf/no_warning_test-unittest_import_public.pb.o
  CXX      google/protobuf/no_warning_test-unittest_lazy_dependencies.pb.o
  CXX      google/protobuf/no_warning_test-unittest_lazy_dependencies_custom_option.pb.o
  CXX      google/protobuf/no_warning_test-unittest_lazy_dependencies_enum.pb.o
  CXX      google/protobuf/no_warning_test-unittest_lite_imports_nonlite.pb.o
  CXX      google/protobuf/no_warning_test-unittest_mset.pb.o
  CXX      google/protobuf/no_warning_test-unittest_mset_wire_format.pb.o
  CXX      google/protobuf/no_warning_test-unittest_no_arena_import.pb.o
  CXX      google/protobuf/no_warning_test-unittest_no_arena.pb.o
  CXX      google/protobuf/no_warning_test-unittest_no_field_presence.pb.o
  CXX      google/protobuf/no_warning_test-unittest_no_generic_services.pb.o
  CXX      google/protobuf/no_warning_test-unittest_optimize_for.pb.o
  CXX      google/protobuf/no_warning_test-unittest.pb.o
  CXX      google/protobuf/no_warning_test-unittest_preserve_unknown_enum2.pb.o
  CXX      google/protobuf/no_warning_test-unittest_preserve_unknown_enum.pb.o
  CXX      google/protobuf/no_warning_test-unittest_proto3.pb.o
  CXX      google/protobuf/no_warning_test-unittest_proto3_arena.pb.o
  CXX      google/protobuf/no_warning_test-unittest_proto3_arena_lite.pb.o
  CXX      google/protobuf/no_warning_test-unittest_proto3_lite.pb.o
  CXX      google/protobuf/no_warning_test-unittest_well_known_types.pb.o
  CXX      google/protobuf/util/internal/testdata/no_warning_test-anys.pb.o
  CXX      google/protobuf/util/internal/testdata/no_warning_test-books.pb.o
  CXX      google/protobuf/util/internal/testdata/no_warning_test-default_value.pb.o
  CXX      google/protobuf/util/internal/testdata/no_warning_test-default_value_test.pb.o
  CXX      google/protobuf/util/internal/testdata/no_warning_test-field_mask.pb.o
  CXX      google/protobuf/util/internal/testdata/no_warning_test-maps.pb.o
  CXX      google/protobuf/util/internal/testdata/no_warning_test-oneofs.pb.o
  CXX      google/protobuf/util/internal/testdata/no_warning_test-proto3.pb.o
  CXX      google/protobuf/util/internal/testdata/no_warning_test-struct.pb.o
  CXX      google/protobuf/util/internal/testdata/no_warning_test-timestamp_duration.pb.o
  CXX      google/protobuf/util/internal/testdata/no_warning_test-wrappers.pb.o
  CXX      google/protobuf/util/no_warning_test-json_format.pb.o
  CXX      google/protobuf/util/no_warning_test-json_format_proto3.pb.o
  CXX      google/protobuf/util/no_warning_test-message_differencer_unittest.pb.o
  CXXLD    no-warning-test
  CXX      google/protobuf/testing/zcgzip.o
  CXXLD    zcgzip
  CXX      google/protobuf/testing/zcgunzip.o
  CXXLD    zcgunzip
make[2]: 离开目录“/home/caozilong/protoc/protobuf/src”
make  check-TESTS
make[2]: 进入目录“/home/caozilong/protoc/protobuf/src”
make[3]: 进入目录“/home/caozilong/protoc/protobuf/src”
PASS: protobuf-test
PASS: protobuf-lazy-descriptor-test
PASS: protobuf-lite-test
PASS: google/protobuf/compiler/zip_output_unittest.sh
PASS: google/protobuf/io/gzip_stream_unittest.sh
PASS: protobuf-lite-arena-test
PASS: no-warning-test
============================================================================
Testsuite summary for Protocol Buffers 3.9.2
============================================================================
# TOTAL: 7
# PASS:  7
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make[3]: 离开目录“/home/caozilong/protoc/protobuf/src”
make[2]: 离开目录“/home/caozilong/protoc/protobuf/src”
make[1]: 离开目录“/home/caozilong/protoc/protobuf/src”
(base) caozilong@caozilong-Vostro-3268:~/protoc/protobuf$

 安装:

sudo make install
sudo ldconfig

查看protoc版本

结束! 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

papaofdoudou

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值