1. 程式人生 > >bitcoind編譯過程中的問題

bitcoind編譯過程中的問題

本文列出個人在編譯比特幣程式bitcoind以及啟動執行中遇到的問題。

1 執行autogen.sh libtool沒有安裝

Makefile.am:10: error: Libtool library used but 'LIBTOOL' is undefined
Makefile.am:10:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
Makefile.am:10:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
Makefile.am:10:   If 'LT_INIT' is in 'configure.ac', make sure
Makefile.am:10:   its definition is in aclocal's search path.

解決方法:yum install libtool -y 

2 執行autogen.sh aclocal找不到

解決方法:問題原因是機器沒有安裝autotool工具系列,需要安裝automake和autoconf

yum install automake -y
yum install autoconf 

3 configure: error: openssl not found

執行bitcoind目錄下的configure過程中出現openssl庫沒有找到的情況,執行命令:openssl version -a 檢視系統如果安裝(大多數系統都會安裝),則需要安裝openssl-devel,執行如下命令

yum install openssl-devel

4 checking for libevent... no configure: error: libevent not found

./configure --prefix=/user/local/
make 
make install

安裝成功後,執行bitcoin目錄下的configure如果仍然出現上述問題是因為沒有安裝libeven-devel,執行命令

yum install libevent-devel

5 configure: error: libdb_cxx headers missing, Bitcoin Core requires this library for wallet functionality (--disable-wallet to disable wallet functionality)

問題的原因是沒有安裝BekerlyDB,解決方法如下:

wget http://download.oracle.com/berkeley-db/db-4.8.30.zip
unzip db-4.8.30.zip
cd db-4.8.30
cd build_unix/
../dist/configure --prefix=/usr/local --enable-cxx
make
make install

注意如果執行過程中出現找不到libdb.xxx.so的時候原因是一樣的,都是由於沒有安裝BerkelyDB的原因。

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)

如果遇到上述錯誤,解決的方法一樣,需要安裝BerkeleyDB 同時在configure後面新增

--with-incompatible-bdb

6 configure: error: No working boost sleep implementation found.

核心問題,也是比較常見的問題,原因是系統中沒有安裝boot庫,解決方法如下:

下載 boost (http://www.boost.org/users/history/version_1_66_0.html)
cd boost_1_66_0/
./bootstrap.sh --prefix=/usr/local/
./bjam install

注意bootstrap中的prefix引數很重要,這個直接決定後面執行的時候如果出現libboost.xxx.so找不到的解決方法

7 tmp/ccuyuMIK.s:93510: Error: no such instruction: `vextracti128 $0x1,%ymm0,%xmm1'

問題是AS的版本過低導致,可以通過更新AS的版本來解決該問題

wget https://ftp.gnu.org/gnu/binutils/binutils-2.31.tar.gz
tar zxvf binutils-2.31.tar.gz
cd binutils-2.31
./configure 
make 
make install

8 如果有需要編譯boost,在編譯的過程中出現找不到pyconfig.h的錯誤

機器上沒有安裝對應的pythond-devel,解決方法如下

yum install python-devel.x86_64

以上的問題是編譯過程遇到的問題,下面主要是執行過程中遇到的問題

1 啟動bitcoind 出現找不到動態連結庫的問題

error while loading shared libraries: libdb_cxx-4.8.so: cannot open shared object file: No such file or directory

error while loading shared libraries: libboost.xxxx.so: cannot open shared object file: No such file or directory

主要原因是動態鏈庫找不到,可以通過修改libc.conf來實現

vim /etc/ld.so.conf.d/libc.conf
新增剛才安裝的boost等庫的路徑例如
/usr/local/lib
/usr/lib
儲存libc.conf
執行ldconfig