环境
源码:https://github.com/fomy/destor
环境:Linux64,ubuntu20.04LTS
C++环境搭建
1.gcc/g++
sudo apt install gcc g++ cmake git vim
2.openssl
不能直接apt-get安装openssl,不然会报“找不到crypto库”错误,需要安装老版本openssl
wget http://www.openssl.org/source/openssl-1.0.2d.tar.gz
# 解压后
./config --prefix=/usr/local --openssldir=/usr/local/openssl
make && sudo make install
sudo apt-get install libssl-dev
3.libcurl
sudo apt install libcurl4-openssl-dev
4.log4cxx
sudo apt install liblog4cxx-dev
5.tcmalloc
sudo apt install libgoogle-perftools-dev
glib安装
首先安装依赖
sudo apt-get install zlib1g-dev
sudo apt-get install libffi-dev
上面的依赖可能不全,依赖相关错误参考:
https://blog.csdn.net/weixin_43600809/article/details/121224799
https://blog.csdn.net/qq_28626013/article/details/111187037
apt安装glib
sudo apt-get install libglib2.0-dev
改变glib头文件位置
这里和建立连接时glib的地址可能不一定,需要查看并确认
sudo cp -r /usr/include/glib-2.0/* /usr/local/include
sudo cp /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h /usr/local/include
建立连接
sudo ln -s /usr/lib/x86_64-linux-gnu/libglib-2.0.so /usr/local/lib/libglib.so
旧库改动
sudo mv /usr/lib/x86_64-linux-gnu/libcrypto.a /usr/lib/x86_64-linux-gnu/libcrypto.a.old
sudo mv /usr/lib/x86_64-linux-gnu/libcrypto.so /usr/lib/x86_64-linux-gnu/libcrypto.so.old
automake
目前configure已经可以通过,但是make时报错
sudo apt install autoconf
报错:aclocal-1.14: command not found
手动下载aclocall-1.14
wget http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz
安装aclocal还需要一个autoconf 2.65或更高的版本
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
解压并autoconf-2.69进入目录
tar xvzf autoconf-2.69.tar.gz
cd autoconf-2.69
安装autoconf
./configure
make
make install
最后重启一下,查看automake版本
automake --version
完成Destor编译&&安装
Destor目录下输入
./configure
make
make install
参考文献
参考文献
[1]: https://blog.csdn.net/blue2015213115/article/details/116229988
[2]: https://blog.csdn.net/qq_28626013/article/details/111187037
[3]: https://blog.csdn.net/weixin_43600809/article/details/121224799
[4]:https://jingyan.baidu.com/article/ab0b563072e697c15afa7d98.html
[5]:http://www.javashuo.com/article/p-mehwonfq-nw.html
[6]:https://github.com/fomy/destor/issues/4
[7]:https://github.com/google/farmhash/issues/15