Building Bitcoin Core on OS X with Errors, Warnings and Solutions
Here we talk about how to build Bitcoin Core on OS X with some error messages and their solutions.
First, we assume the Xcode command line tools and MacPorts are installed. We also assume Bitcoin Core has been cloned with git.
We start with
./autogen.sh
If you get
configuration failed, please install autoconf first
you need to install autoconf.
sudo port install autoconf
If you get
Can't exec "/opt/local/bin/aclocal": No such file or directory at /opt/local/share/autoconf/Autom4te/FileUtils.pm line 326. autoreconf: failed to run /opt/local/bin/aclocal: No such file or directory
automake
is missing. You can install it with
sudo port install automake
If you get
Makefile.am:8: error: Libtool library used but 'LIBTOOL' is undefined Makefile.am:8: The usual way to define 'LIBTOOL' is to add 'LT_INIT' Makefile.am:8: to 'configure.ac' and run 'aclocal' and 'autoconf' again. Makefile.am:8: If 'LT_INIT' is in 'configure.ac', make sure Makefile.am:8: its definition is in aclocal's search path.
and other errors, libtool
is missing. You can install it with
sudo port install libtool
Now that ./autogen.sh
is working, it’s time to install Berkeley DB 4.8 with
./contrib/install_db4.sh `pwd`
Then ./configure
BitCoin with
export BDB_PREFIX=`pwd`'/db4' ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include"
If you get
configure: error: PKG_PROG_PKG_CONFIG macro not found. Please install pkg-config and re-run autogen.sh.
pgk-config
is missing. You can install it with
sudo port install pkgconfig
and run ./autogen.sh
again, before retrying ./configure ...
.
If you get
configure: WARNING: Qt dependencies not found; bitcoin-qt frontend will not be built
you can install Qt.
sudo port install qt59
If you get
checking for boostlib >= 1.47.0... configure: We could not detect the boost libraries (version 1.47 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 <boost/version.hpp>. See http://randspringer.de/boost for more documentation. checking whether the Boost::System library is available... no checking whether the Boost::Filesystem library is available... no checking whether the Boost::Program_Options library is available... no checking whether the Boost::Thread library is available... no checking whether the Boost::Chrono library is available... no checking whether the Boost::Unit_Test_Framework library is available... no checking for dynamic linked boost test... no checking for mismatched boost c++11 scoped enums... ok configure: error: No working boost sleep implementation found.
you are missing the Boost libraries.
sudo port install boost
If you get
configure: WARNING: libprotobuf not found; bitcoin-qt frontend will not be built
you can install protobuf
.
sudo port install protobuf-cpp
If you get
configure: error: libevent not found.
you need to install libevent
.
sudo port install libevent
Now that you have a successful ./configure ...
you can build Bitcoin.
make
And everything should build properly.