Unbuntu下搭建raiblocks

4 篇文章 0 订阅
1 篇文章 0 订阅

Build assist tools:
sudo apt install gcc g++ git cmake -y

Build Boost
安装boost依赖库
sudo apt-get update
sudo apt-get install libboost-all-dev

ubuntu依赖库版本过高:
libcups2-dev : Depends: libcups2 (= 2.1.3-4) but 2.1.3-4ubuntu0.5 is to be installed
libdrm-dev : Depends: libdrm2 (= 2.4.67-1) but 2.4.91-2~16.04.1 is to be installed
Depends: libdrm-intel1 (= 2.4.67-1) but 2.4.91-2~16.04.1 is to be installed
Depends: libdrm-radeon1 (= 2.4.67-1) but 2.4.91-2~16.04.1 is to be installed
Depends: libdrm-nouveau2 (= 2.4.67-1) but 2.4.91-2~16.04.1 is to be installed
Depends: libdrm-amdgpu1 (= 2.4.67-1) but 2.4.91-2~16.04.1 is to be installed

解决方案:
sudo aptitude install
sudo aptitude install libboost-all-dev

询问是否依然按当前高版本依赖库进行qt安装
Accept this solution? [Y/n/q/?] n

进行版本安装
Accept this solution? [Y/n/q/?] y

安装需要一定数量的内存,是否继续
Do you want to continue? [Y/n/?] y

下载boost
wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2
tar --bzip2 -xf boost_1_66_0.tar.bz2
cd boost_1_66_0
sudo ./bootstrap.sh
./b2 -d0 --prefix=/usr/local/boost link=static install

生成的文件可以在/usr/local/include和/usr/local/lib下找到

Building Qt
安装Qt依赖库:
sudo apt-get install bison build-essential gperf flex ruby python libasound2-dev libbz2-dev libcap-dev
libcups2-dev libdrm-dev libegl1-mesa-dev libgcrypt11-dev libnss3-dev libpci-dev libpulse-dev libudev-dev
libxtst-dev gyp ninja-build libglu1-mesa-dev libfontconfig1-dev libx11-xcb-dev libicu-dev

依赖库版本过高问题参考Building boost的解决方案

下载qt源码
git clone git://code.qt.io/qt/qt5.git
进入qt5目录
perl init-repository 初始化库和克隆子模块的变量
执行./configure -shared -opensource -nomake examples -nomake tests -confirm-license -prefix /usr/local/qt
sudo make
sudo make install

Build RaiBlocks

  1. 下载源码
    方式一:
    主程序源码: git clone https://github.com/nanocurrency/raiblocks.git
    进入raiblocks目录
    更新子模块源码: git submodule update --init --recursive
    方式二:
    主程序和子模块源码一次性全部下载: sudo git clone https://github.com/nanocurrency/raiblocks.git --recursive

建立且切换分支(可略过)
git checkout releases/v12

  1. 没设置Qt5_DIR出错
    By not providing “FindQt5.cmake” in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by “Qt5”, but
    CMake did not find one.

Could not find a package configuration file provided by “Qt5” with any of
the following names:

Add the installation prefix of “Qt5” to CMAKE_PREFIX_PATH or set “Qt5_DIR”
to a directory containing one of the above files. If “Qt5” provides a
separate development package or SDK, be sure it has been installed

  1. 没有设置BOOST_ROOT会报错
    CMake Error at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1947 (message):
    Unable to find the requested Boost libraries.

Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost’s headers.
Call Stack (most recent call first):
CMakeLists.txt:126 (find_package)

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:

解决方案:
进入到raiblocks目录
cmake -DRAIBLOCKS_GUI=ON -DQt5_DIR=/usr/local/qt/lib/cmake/Qt5 -DBOOST_ROOT=/usr/local/boost ~/raiblocks

make nano_wallet

启动钱包时字体问题
QFontDatabase: Cannot find font directory /home/ghc/Documents/nano/raiblocks/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.

复制fonts字体到当前目录的lib/fonts里面

mkdir lib

cd lib

mkdir fonts

cp /usr/share/fonts/ ./

raiblocks目录下有个qt.conf 修改Plugins 值为
Plugins = /usr/local/qt/plugins

这是为了解决如下错误:
qt.qpa.plugin: Could not find the Qt platform plugin “xcb” in “”
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

sudo ./nano_wallet

编译服务端rai_node
mkdir build
cd build
cmake …
make
这样就可以正常编译和启动

主要参考:
https://github.com/nanocurrency/raiblocks/wiki/Build-Instructions
http://wiki.qt.io/Building_Qt_5_from_Git
https://wiki.qt.io/QtWebEngine/How_to_Try
https://blog.csdn.net/wahaha13168/article/details/82721209
https://askubuntu.com/questions/654939/opengl-for-ubuntu14-building-qt-5-4
https://github.com/nanocurrency/raiblocks/wiki/Install-Wallet-on-Ubuntu-16.04.3
https://blog.csdn.net/wahaha13168/article/details/82721301?utm_source=copy

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值