ubuntu環境でbitcoin(ビットコイン)をコンパイルする全プロセス

5602 ワード

1.まずgithubからcloneの最新のbitcoinソースコード
git clone https://github.com/bitcoin/bitcoin.git

2.cloneのコードディレクトリに入り、現在のバージョンを表示します(ここではv 0.20.0バージョンに切り替えました)
cd ./bitcoin
git tag -l
git checkout v0.20.0

3.autoconfをインストールし、インストールに成功した後にコードディレクトリの下の./autogen.sh
sudo apt install autoconf
./autogen.sh

4.エラーメッセージが表示されました.configure:error:PKG_PROG_PKG_CONFIG macro not found. Please install pkg-config and re-run autogen.sh、libtoolのインストールを求めます.gccがインストールされていない場合、g++はこの2つをインストールする必要があります.インストールが完了したらもう一度実行します./autogen.shは成功するはずです.実行に成功するとコードディレクトリの下で生成されます./configure
sudo apt install libtool gcc g++
./autogen.sh

5.実行./configure、エラーが発生しました.pkg-configをインストールしてから再./autogen.sh(上の手順に戻りました)
sudo apt install pkg-config
./autogen.sh

6.再エラー、configure:error:libdb_cxx headers missing,Bitcoin Core requires this library for wallet functionality(--disable-wallet to disable wallet functionality)、libdb++-devをインストールすると問題が解決し、インストール後に再./configure
sudo apt install libdb++-dev

7.警告とエラーが発生しました.
checking for QT5... noconfigure: WARNING: Qt dependencies not found; bitcoin-qt frontend will not be builtchecking whether to build Bitcoin Core GUI... nochecking for Berkeley DB C++ headers... defaultconfigure: error: Found Berkeley DB other than 4.8, required for portable wallets (--with-incompatible-bdb to ignore or --disable-wallet to disable wallet functionality)
またはqt 5のインストール後に警告があります
configure: WARNING: LRELEASE not found; bitcoin-qt frontend will not be built
qt 5-defaultとqttools 5-dev-toolsをインストールし、ソースコードからBerkeley DBをコンパイルする必要があります
sudo apt install qt5-default qttools5-dev-tools

Berkeley DBのコンパイル
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

8.パラメータを追加して再実行./configure
./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib"

誤報
checking for boostlib >= 1.47.0 (104700)... configure: We could not detect the boost libraries (version MINIMUM_REQUIRED_BOOST or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation.checking whether the Boost::System library is available... nochecking whether the Boost::Filesystem library is available... nochecking whether the Boost::Thread library is available... nochecking whether the Boost::Unit_Test_Framework library is available... nochecking for dynamic linked boost test... nochecking for mismatched boost c++11 scoped enums... okchecking for QR... nochecking for EVENT... noconfigure: error: libevent version 2.0.21 or greater not found.
これらを頼りにしてそろえましょう
sudo apt install libevent-dev libzmq5-dev doxygen libboost1.58-all-dev

そしてまた
./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib"

この時点では、まだ解決策が見つかっていないが、コンパイルの機能に影響を与えないという警告があります.
configure: WARNING: "xgettext is required to update qt translations"
9../configureは問題ありません.後でmakeできます.bitcoinプロジェクトの比較的大きなコンパイルには30分かかるかもしれません.辛抱強く待ってください.