sofa-pbrpc的使用

it2025-01-10  15

编译与安装

下载源码

$ git clone -v https://github.com/baidu/sofa-pbrpc.git

boost

http://downloads.sourceforge.net/project/boost/boost/1.53.0/boost_1_53_0.tar.gz 只需要解压就行,无需编译 修改depends.mk的boost的目录

BOOST_HEADER_DIR=/home/wilson/net/boost_1_53_0

protobuf

https://github.com/google/protobuf/releases/download/v2.4.1/protobuf-2.4.1.tar.gz

配置输出路径

$ ./configure --prefix=$PWD/output

编译

$ make $ sudo make install

如果使用高版本的gcc,会编译失败,需要更改文件,然后重新编译

$ gedit src/google/protobuf/compiler/command_line_interface.cc //proto_path_.push_back(make_pair<string, string>(virtual_path, disk_path)); proto_path_.push_back(make_pair(virtual_path, disk_path));

添加到sofa的编译路径

修改depends.mk的protobuf的目录

PROTOBUF_DIR=/home/wilson/net/protobuf-2.4.1/output

snappy

https://github.com/google/snappy/releases/download/1.1.3/snappy-1.1.3.tar.gz

配置输出路径

$ ./configure --prefix=$PWD/output

编译

$ make $ sudo make install

添加到sofa的编译路径

修改depends.mk的Snappy的目录

SNAPPY_DIR=/home/wilson/net/snappy-1.1.3/output

编译安装

$ make $ sudo make install

基本使用

最新回复(0)