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

原因是系統中沒有安裝libevent庫,解決辦法爲手動安裝。打開http://libevent.org/選擇libevent的版本,本人選擇libevent-2.0.22-stable.tar.gz, 下載代碼到系統中。執行如下命令 :

./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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章