方法一
[root@qyc]$ cat build_essd.sh #!/bin/bash
export PURPOSE=compile-with-cmake; export CXX=/usr/bin/g++ export CC=/usr/bin/gcc
cmake -DWITH_DEBUG_SYMBOLS=ON -DWITH_GLOG=OFF -DWITH_MESALINK=OFF -DDEBUG=OFF -DBUILD_UNIT_TESTS=OFF -DDOWNLOAD_GTEST=OFF -DWITH_THRIFT=OFF
-DGFLAGS_INCLUDE_PATH=../gflags/output/include
-DPROTOBUF_INCLUDE_DIRS=../protobuf/output/include
-DLEVELDB_INCLUDE_PATH=../leveldb/output/include
-DGFLAGS_LIBRARY=../gflags/output/lib/libgflags.a
-DPROTOBUF_LIBRARIES=../protobuf/output/lib/libprotobuf.a
-DLEVELDB_LIB=../leveldb/output/lib/libleveldb.a
-DPROTOC_LIB=../protobuf/output/lib/libprotoc.a
-DPROTOBUF_PROTOC_EXECUTABLE=../protobuf/output/bin/protoc
#sh build_in_travis_ci.sh
#sh config_brpc.sh --headers="../gflags/output/include ../protobuf/output/include ../leveldb/output/include /usr/include" --libs="../gflags/output/lib ../protobuf/output/lib ../leveldb/output/lib /usr/lib"
方法二
sudo apt-get install -y git g++ make libssl-dev libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev
sudo apt-get install -y libsnappy-dev
sudo apt-get install -y libgoogle-perftools-dev
sudo apt-get install -y cmake libgtest-dev
cd/usr/src/gtest
sudo cmake.
sudo make
sudo mv libgtest* /usr/lib/
下载所有文件:
可以去github下载zip,也可以使用git下载,这里我使用的是git下载:
git clone https://github.com/gflags/gflags.git
然后进入brpc目录下:
$ sh config_brpc.sh --headers=/usr/include --libs=/usr/lib
$ make
标签:brpc,..,lib,dev,编译,usr,output,include,方法 From: https://blog.51cto.com/xiamachao/9004299