博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在CentOS 7上编译Qtum
阅读量:7094 次
发布时间:2019-06-28

本文共 1233 字,大约阅读时间需要 4 分钟。

在CentOS上编译Qtum是一件非常麻烦的事情,因为CentOS提供的boost库过于老旧。而我们需要自己去手动编译boost库。

准备工作

添加epel-release仓库,然后安装一些编译工具:

sudo yum install epel-release gcc-c++ git复制代码

编译Boost

我们需要至少1.58.0版本的boost库来编译Qtum,但是CentOS 7上只提供了1.53.0版本以下的boost,我们可以选择手动编译。

首先我们需要安装一些依赖:

sudo yum install python-devel bzip2-devel复制代码

然后我们从GitHub上克隆boost库:

git clone https://github.com/boostorg/boost.gitcd boost复制代码

检出一个发布版本并且初始化子模块:

git checkout boost-1.58.0git submodule update --init --recursive复制代码

编译Boost: 你可以把--prefix--libdir设置为任意你想要的位置,或者保持默认。但是你需要在编译和运行Qtum的时候把

libdir
添加到
LD_LIBRARY_PATH环境变量中,多少有些麻烦。

# omit the --libdir option for 32-bit systems./bootstrap.sh --prefix=/usr --libdir=/usr/lib64./b2 headers# 你可以设置-j
,其中N是你的电脑的CPU的核心数或线程数。sudo ./b2 -j4 install复制代码

编译Qtum

安装依赖:

sudo yum install libtool libdb4-cxx-devel openssl-devel libevent-devel复制代码

如果你需要编译Qtum图形化界面qtum-qt,你还需要安装这些依赖:

sudo yum install qt5-qttools-devel protobuf-devel qrencode-devel复制代码

克隆仓库并且初始化子模块:

git clone https://github.com/qtumproject/qtum.gitcd qtumgit submodule update --init --recursive复制代码

配置参数以及编译:

如果你把boost安装到了/, /usr, /usr/local以外的路径,你需要在configure的时候指定--with-boost=/path/to/your/boost,以及把/path/to/your/boost/lib添加到LD_LIBRARY_PATH环境变量。

./autogen.sh./configuremake -j4复制代码

转载地址:http://wiaql.baihongyu.com/

你可能感兴趣的文章