grpc 环境安装
git clone https://github.com/grpc/grpc
git submodule update --init
mkdir cmake/build && cd $_ && \
cmake ../.. -DBUILD_SHARED_LIBS=ON -DgRPC_INSTALL=ON && \
make -j$(nproc) && \
sudo make install && \
make clean && \
sudo ldconfig
查看环境安装是否成功
ls /usr/local/bin/grpc_*
/usr/local/bin/grpc_cpp_plugin /usr/local/bin/grpc_node_plugin /usr/local/bin/grpc_php_plugin /usr/local/bin/grpc_ruby_plugin
/usr/local/bin/grpc_csharp_plugin /usr/local/bin/grpc_objective_c_plugin /usr/local/bin/grpc_python_plugin
编译时报错
/usr/local/bin/grpc_objective_c_plugin
执行时报错:
error while loading
shared libraries: libgrpc_plugin_support.so: cannot open shared object file: No such file or directory
# 或
error while loading
shared libraries: libprotoc.so: cannot open shared object file: No such file or directory
解决:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/lib64