官方文档只提供了mac、windows、Ubuntu、Debian 的安装说明,对于CentOS 安装过程一个复杂的是它的依赖很难安装。
首先请记住:
[centos]rpm文件安装,使用rpm指令 类似[ubuntu]deb文件安装,使用dpkg指令
[centos]yum安装 类似[ubuntu]apt-get安装
1、git clone https://github.com/bitcoin/bitcoin.git
没有git的要先安装git
sudo yum git
2、sudo yum install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils
敲黑板,注意了,有的依赖没有!!!!!需要单独安装!!!!
3、sudo yum install gcc-c++ libtool make autoconf automake openssl-devel libevent-devel boost-devel libdb4-devel libdb4-cxx-devel
4、sudo yuminstall qt5-qttools-devel qt5-qtbase-devel protobuf-devel
问题来了,当安装了一堆依赖后,尝试执行./autogen.sh 报错
configure.ac:1209: error: possibly undefined macro: PKG_CONFIG_LIBDIR
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
解决办法
https://github.com/bitcoin/bitcoin/issues/6432
还遇到一个问题:GCC update 问题
再接一个问题:configure: error: Found Berkeley DB other than 4.8, required for portable wallets (–with-incompatible-bdb to ignore or –disable-wallet to disable wallet functionality)
参考链接:https://github.com/bitcoin/bitcoin/issues/3686
获取db4.8源代码,编译安装
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
make
sudo make install
////////////////////////////////////////////
问题不断:autoconf版本过低
configure.ac:209: error: Autoconf version 2.64 or higher is required
build-aux/m4/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from…
configure.ac:209: the top level
autom4te: /usr/bin/m4 failed with exit status: 63
aclocal: autom4te failed with exit status: 63
autoreconf: aclocal failed with exit status: 63
所以需要更新autoconf版本……….
问题多多啊,还有:
./configure –with-incompatible-bdb
configure: error: Could not find a version of the boost_chrono library!
安装boost…..
但是走到最后,编译过程显示找不到boost一个文件,多次尝试无果,被它打败了。
终极武器:找了篇博客
http://blog.csdn.net/terminatorsong/article/details/74089911
一句话总结:还是Ubuntu下面配置编译easy,分分钟完成。