Bitcoin Ubuntu编译安装Linux版

Bitcoin Ubuntu编译安装Linux版。

Ubuntu 16.04 / 18.04。

安装依赖

sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev
sudo apt-get install libboost-all-dev
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
sudo apt-get install libqrencode-dev libminiupnpc-dev libevent-dev

编译BerkeleyDB

wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --enable-cxx --disable-shared --with-pic
make
sudo make install

编译Bitcoin

./autogen.sh
./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" --disable-shared
make 
sudo make install

0.10版本问题

编译问题You must build your code with position independent code,这是QT的问题,
参考dogecoin的编译配置解决。

打开configure.ac,查找fPIE,将其所在的两行修改为

AX_CHECK_COMPILE_FLAG([-fPIC],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fPIC"])
AX_CHECK_LINK_FLAG([[-fno-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -fno-pie"])

0.16版本不存在此问题。

Leave a Comment

豫ICP备19001387号-1