isearch/build.sh
2021-03-26 14:41:00 +08:00

66 lines
1.8 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
# install - install search_local
: '
由于检索存储层依赖rocksdb所以编译时需要满足以下前置配置
1centos版本需要升级到centos7及以上版本
2gcc版本需要支持c++11特性因此需要安装4.8以上的版本
3Cmake版本需要大于等于3.6.2
4安装gflagsgoogle开源的一套命令行参数解析工具支持从环境变量和配置文件读取参数
安装命令:
git clone https://github.com/gflags/gflags.git
cd gflags
git checkout -b 2.2 v2.2.2
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON -DGFLAGS_NAMESPACE=google -G "Unix Makefiles" .
make && sudo make install
sudo ldconfig
sudo ln -s /usr/local/lib/libgflags.so.2.2 /lib64
安装后需要将gflags的包含路径添加到你的CPATH环境变量中
5安装rocksdb依赖库zlibbzip2lz4snappyzstandard
sudo yum install -y snappy snappy-devel zlib zlib-devel bzip2 bzip2-devel lz4-devel libasan openssl-devel
'
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"
rocksdb_lib="3rdlib/rocksdb/lib"
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"
src_rocksdb_lib="$srcdir/$rocksdb_lib"
cd $src_index_storage
make
cp $src_index_storage/api/c_api_cc/libdtc-gcc-*.so /lib64
ln -s /lib64/libdtc-gcc-*.so /lib64/libdtc.so.1
ln -s /lib64/libdtc.so.1 /lib64/libdtc.so
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