Skip to content

FreeBSD build guide

(updated for FreeBSD 12.1)

This guide describes how to build bitcoind and command-line utilities on FreeBSD.

This guide does not contain instructions for building the GUI.

Preparation

You will need the following dependencies, which can be installed as root via pkg:

pkg install cmake libevent ninja openssl boost-libs git gmp zlib-ng

Optional libraries

To enable UPnP:

pkg install miniupnpc

If not installed, UPnP support should be disabled by passing -DENABLE_UPNP=OFF to cmake.

To enable NAT-PMP:

pkg install libnatpmp

If not installed, NAT-PMP support should be disabled by passing -DENABLE_NATPMP=OFF to cmake.

To enable ZeroMQ:

pkg install libzmq4

If not installed, ZeroMQ support should be disabled by passing -DBUILD_BITCOIN_ZMQ=OFF to cmake.

In order to run the test suite (recommended), you will need to have Python 3:

pkg install python3

To run the ZeroMQ tests:

pkg install py37-pyzmq

For the wallet (optional):

pkg install db5

If you also want to build the GUI client bitcoin-qt Qt 5 is necessary. To build with Qt 5 you need the following packages installed:

pkg install qt5-qmake qt5-buildtools qt5-linguisttools qt5-widgets qt5-testlib libqrencode-4.0.0

You can do without the libqrencode-4.0.0 package, just pass -DENABLE_QRCODE=OFF on the cmake command line.

To enable manpages:

pkg install help2man

If not installed, manpage generation should be disabled by passing -DENABLE_MAN=OFF to cmake.

Building Bitcoin Cash Node

Download the source code:

git clone https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node.git
cd bitcoin-cash-node/

To build with wallet:

mkdir build
cd build
cmake -GNinja -DBUILD_BITCOIN_QT=OFF ..
ninja
ninja check # recommended

To build without wallet:

mkdir build
cd build
cmake -GNinja -DBUILD_BITCOIN_QT=OFF -DBUILD_BITCOIN_WALLET=OFF ..
ninja
ninja check # recommended

To build with wallet and GUI:

mkdir build
cd build
cmake -GNinja ..
ninja
ninja check # recommended
ninja test_bitcoin-qt # recommended

After a successful test you can install the newly built binaries to your bin directory. Note that this will probably overwrite any previous version installed, including binaries from different sources. It might be necessary to run as root, depending on your system configuration:

ninja install #optional