LoginSignup
0
0

More than 5 years have passed since last update.

mac OSXでbitcoindをコンパイルする際にboostでハマった時に見るtips

Posted at

max OSXでbitcoindをコンパイルしていると、makeが通って「さあやるぞ!」となってるのに、make checkしたらFAILが出てしまう・・・ログを見るとboostライブラリがリンク出来ないエラーによく遭遇する気がします。解決方法を何度か調べなおしたりしたので備忘録として保存。

==============================================
   Bitcoin Core 0.14.99: src/test-suite.log
==============================================

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: test/test_bitcoin
=======================

dyld: Library not loaded: libboost_system-mt.dylib
  Referenced from: /usr/local/lib/libboost_unit_test_framework-mt.dylib
  Reason: image not found
FAIL test/test_bitcoin (exit status: 134)

これはboostというc++のライブラリが、bicoindのコンパイル時にうまくリンク出来てない為に発生します。otoolで確認するとやはりリンクがされてないようです。

$ otool -L src/bitcoin-cli
src/bitcoin-cli:
    libboost_program_options-mt.dylib (compatibility version 0.0.0, current version 0.0.0)

stack overflow辺りを見ると色々と解決方法はあるのですが、個人的に採用している方法はbrewでboostを入れてconfigureでパスを指定する方法です。

# 既にboostがある場合はupgrade等を試して下さい
$ brew install boost

# 一応リンクし直す
$ brew unlink boost
$ brew link boost

# configureする時にbrewで入れたboostのパスを指定
$ ./configure --with-boost-libdir=/usr/local/Cellar/boost/1.64.0_1/lib

configureでエラーが無ければ、再度makeしてmake checkを確認します。正常に通ればbitcoindを起動できます!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0