3 (updated for OpenBSD 6.2)
5 This guide describes how to build bitcoind and command-line utilities on OpenBSD.
7 OpenBSD is most commonly used as a server OS, so this guide does not contain instructions for building the GUI.
12 Run the following as root to install the base dependencies for building:
15 pkg_add git gmake libevent libtool
16 pkg_add autoconf # (select highest version, e.g. 2.69)
17 pkg_add automake # (select highest version, e.g. 1.15)
18 pkg_add python # (select highest version, e.g. 3.6)
21 git clone https://github.com/bitcoin/bitcoin.git
24 See [dependencies.md](dependencies.md) for a complete overview.
29 The default C++ compiler that comes with OpenBSD 6.2 is g++ 4.2.1. This version is old (from 2007), and is not able to compile the current version of Bitcoin Core because it has no C++11 support. We'll install a newer version of GCC:
35 This compiler will not overwrite the system compiler, it will be installed as `egcc` and `eg++` in `/usr/local/bin`.
37 ### Building BerkeleyDB
39 BerkeleyDB is only necessary for the wallet functionality. To skip this, pass `--disable-wallet` to `./configure`.
41 It is recommended to use Berkeley DB 4.8. You cannot use the BerkeleyDB library
42 from ports, for the same reason as boost above (g++/libstd++ incompatibility).
43 If you have to build it yourself, you can use [the installation script included
44 in contrib/](contrib/install_db4.sh) like so
47 ./contrib/install_db4.sh `pwd` CC=egcc CXX=eg++ CPP=ecpp
50 from the root of the repository.
54 The standard ulimit restrictions in OpenBSD are very strict:
58 This, unfortunately, may no longer be enough to compile some `.cpp` files in the project,
59 at least with GCC 4.9.4 (see issue [#6658](https://github.com/bitcoin/bitcoin/issues/6658)).
60 If your user is in the `staff` group the limit can be raised with:
64 The change will only affect the current shell and processes spawned by it. To
65 make the change system-wide, change `datasize-cur` and `datasize-max` in
66 `/etc/login.conf`, and reboot.
68 ### Building Bitcoin Core
70 **Important**: use `gmake`, not `make`. The non-GNU `make` will exit with a horrible error.
74 export AUTOCONF_VERSION=2.69 # replace this with the autoconf version that you installed
75 export AUTOMAKE_VERSION=1.15 # replace this with the automake version that you installed
78 Make sure `BDB_PREFIX` is set to the appropriate path from the above steps.
80 To configure with wallet:
82 ./configure --with-gui=no CC=egcc CXX=eg++ CPP=ecpp \
83 BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include"
86 To configure without wallet:
88 ./configure --disable-wallet --with-gui=no CC=egcc CXX=eg++ CPP=ecpp
91 Build and run the tests:
93 gmake # use -jX here for parallelism
98 ------------------------------
103 ./configure --disable-wallet --with-gui=no CC=clang CXX=clang++
104 gmake # use -jX here for parallelism