信息安全从业人员^_^
一个未入门de情报学胖子(邮箱:tenghm1986@163.com)
Toggle navigation
信息安全从业人员^_^
主页
About Me
归档
标签
GRPC编译过程
2020-11-04 16:34:59
982
0
0
heming
# 0.pre 人老了,也许35岁的程序员可以称之为老吧,总爱怀念过去。五年多前当时做机器人,懵懵懂懂,用过grpc,那时同事已经编译好deb安装包了,直接安装就好了;未了解种种之坑,等自己编译时才知道各种问题吧。今编译过程记录一下。 # 1.编译过程 ## 1.1 grpc版本与protobuf版本 |软件|版本|comments| |:--|:--|:--| |grpc|1.27.1|未发现两者版本之间适配关系| |protobuf|3.11.0|try n+ version,最后在这个版本适配| ## 1.2 grpc clone ``` sudo apt-get install build-essential autoconf libtool pkg-config libtool git clone -b v1.27.1 https://gitee.com/tengheming/grpc.git git submodule update --init #.gitmodules替换成国内源 ``` ### 1.2.1 absl ``` cd grpc/third_party/abseil cmake .. make sudo make install ``` ### 1.2.2 cares ``` cd third_party/abseil cmake .. make sudo make install ``` ### 1.2.3 protobuf(**cmake方式安装protobuf**) ``` ##cmake 版本 cd third_party/protobuf/cmake mkdir build cd build cmake .. make sudo make install sudo ldconfig sudo checkinstall #打包 ``` ### 1.2.4 zlib ``` cd third_party/zlib ./configure make sudo make install ``` ### 1.2.5 grpc编译 ``` cmake ../.. -DgRPC_INSTALL=ON \ -DCMAKE_BUILD_TYPE=Release \ -DgRPC_ABSL_PROVIDER=package \ -DgRPC_CARES_PROVIDER=package \ -DgRPC_PROTOBUF_PROVIDER=package \ -DgRPC_RE2_PROVIDER=package \ -DgRPC_SSL_PROVIDER=package \ -DgRPC_ZLIB_PROVIDER=package make sudo make install sudo checkinstall ``` # 2.常见的issues ## 2.1 ProtocolBuffersConfig.cmake/protocolbuffers-config.cmake **原因:** >Could not find module FindProtocolBuffers.cmake or a configuration file for package ProtocolBuffers. Adjust CMAKE_MODULE_PATH to find FindProtocolBuffers.cmake or set ProtocolBuffers_DIR to the directory containing a CMake configuration file for ProtocolBuffers. The file will have one of the following names: ``` ProtocolBuffersConfig.cmake protocolbuffers-config.cmake ``` **解决:** ``` protobuf的camke版本安装,protobuf源代码里有cmake文件夹,采用cmake方式安装 ``` ## 2.2 relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC > absl CMakeLists.txt ``` add_compile_options(-fPIC) ```
上一篇:
MP-SPDZ性能测试Demo
下一篇:
混淆电路总结一
0
赞
982 人读过
新浪微博
微信
腾讯微博
QQ空间
人人网
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus
文档导航