2021-03-22 14:40:15 +08:00
|
|
|
|
#!/bin/sh
|
|
|
|
|
# install - install search_local
|
|
|
|
|
|
|
|
|
|
: '
|
|
|
|
|
由于检索存储层依赖rocksdb,所以编译时需要满足以下前置配置:
|
2021-04-26 18:10:25 +08:00
|
|
|
|
1)CentOS 7.x
|
|
|
|
|
2)gcc 4.8
|
2021-03-22 14:40:15 +08:00
|
|
|
|
3)Cmake版本需要大于等于3.6.2
|
|
|
|
|
4)安装gflags:google开源的一套命令行参数解析工具,支持从环境变量和配置文件读取参数
|
|
|
|
|
安装命令:
|
|
|
|
|
git clone https://github.com/gflags/gflags.git
|
|
|
|
|
cd gflags
|
2021-03-23 11:46:31 +08:00
|
|
|
|
git checkout -b 2.2 v2.2.2
|
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON -DGFLAGS_NAMESPACE=google -G "Unix Makefiles" .
|
2021-04-26 18:10:25 +08:00
|
|
|
|
make && make install
|
2021-03-23 11:46:31 +08:00
|
|
|
|
sudo ldconfig
|
|
|
|
|
sudo ln -s /usr/local/lib/libgflags.so.2.2 /lib64
|
2021-03-22 14:40:15 +08:00
|
|
|
|
安装后,需要将gflags的包含路径添加到你的CPATH环境变量中
|
|
|
|
|
5)安装rocksdb依赖库:zlib,bzip2,lz4,snappy,zstandard
|
2021-03-23 11:46:31 +08:00
|
|
|
|
sudo yum install -y snappy snappy-devel zlib zlib-devel bzip2 bzip2-devel lz4-devel libasan openssl-devel
|
2021-03-22 14:40:15 +08:00
|
|
|
|
'
|
|
|
|
|
|
|
|
|
|
localdir=`pwd`
|
|
|
|
|
srcdir="$localdir/src"
|
|
|
|
|
|
|
|
|
|
common="comm"
|
|
|
|
|
stat="stat"
|
|
|
|
|
index_write="index_write"
|
|
|
|
|
index_read="index_read"
|
|
|
|
|
index_storage="index_storage"
|
|
|
|
|
search_local="search_local"
|
|
|
|
|
|
|
|
|
|
src_common="$srcdir/$common"
|
|
|
|
|
src_stat="$srcdir/$common/$stat"
|
|
|
|
|
src_index_write="$srcdir/$search_local/$index_write"
|
|
|
|
|
src_index_read="$srcdir/$search_local/$index_read"
|
|
|
|
|
src_index_storage="$srcdir/$search_local/$index_storage"
|
2021-03-25 10:53:10 +08:00
|
|
|
|
|
2021-03-22 14:40:15 +08:00
|
|
|
|
cd $src_common
|
|
|
|
|
cmake .
|
|
|
|
|
make
|
|
|
|
|
cd $localdir
|
|
|
|
|
|
|
|
|
|
cd $src_stat
|
|
|
|
|
cmake .
|
|
|
|
|
make
|
|
|
|
|
cd $localdir
|
|
|
|
|
|
|
|
|
|
cd $src_index_write
|
|
|
|
|
cmake .
|
|
|
|
|
make
|
|
|
|
|
cd $localdir
|
|
|
|
|
|
|
|
|
|
cd $src_index_read
|
|
|
|
|
cmake .
|
|
|
|
|
make
|
|
|
|
|
cd $localdir
|
2021-08-27 15:04:17 +08:00
|
|
|
|
|
|
|
|
|
cd $src_index_storage
|
|
|
|
|
make
|