Skip to content

Commit

Permalink
Merge #167: cmake, doc: Update build-openbsd.md
Browse files Browse the repository at this point in the history
f8994d1 cmake, doc: Update `build-openbsd.md` (Hennadii Stepanov)

Pull request description:

ACKs for top commit:
  theStack:
    Tested ACK f8994d1

Tree-SHA512: 58193294107a237216787af4de35f1b9d4d70fb6b42d57d981b405e0899e8051dadad1ba66bdad695f7e59c7df4e0765ccadbb686b9b26cbf97e34642981b138
  • Loading branch information
hebasto committed Apr 25, 2024
2 parents b7dc7bf + f8994d1 commit 2fc8782
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 28 deletions.
2 changes: 1 addition & 1 deletion depends/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ For linux S390X cross compilation:

### Install the required dependencies: OpenBSD

pkg_add bash gtar
pkg_add bash gmake gtar

### Dependency Options

Expand Down
46 changes: 19 additions & 27 deletions doc/build-openbsd.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenBSD Build Guide

**Updated for OpenBSD [7.4](https://www.openbsd.org/74.html)**
**Updated for OpenBSD [7.5](https://www.openbsd.org/75.html)**

This guide describes how to build bitcoind, command-line utilities, and GUI on OpenBSD.

Expand All @@ -10,9 +10,7 @@ This guide describes how to build bitcoind, command-line utilities, and GUI on O
Run the following as root to install the base dependencies for building.

```bash
pkg_add bash git gmake libevent libtool boost
# Select the newest version of the following packages:
pkg_add autoconf automake python
pkg_add git cmake boost libevent
```

See [dependencies.md](dependencies.md) for a complete overview.
Expand All @@ -31,7 +29,7 @@ It is not necessary to build wallet functionality to run either `bitcoind` or `b

###### Descriptor Wallet Support

`sqlite3` is required to support [descriptor wallets](descriptors.md).
SQLite is required to support [descriptor wallets](descriptors.md).

``` bash
pkg_add sqlite3
Expand All @@ -48,13 +46,13 @@ Refer to [depends/README.md](/depends/README.md) for detailed instructions.
```bash
gmake -C depends NO_BOOST=1 NO_LIBEVENT=1 NO_QT=1 NO_SQLITE=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1
...
to: /path/to/bitcoin/depends/x86_64-unknown-openbsd
to: /path/to/bitcoin/depends/*-unknown-openbsd*
```

Then set `BDB_PREFIX`:

```bash
export BDB_PREFIX="/path/to/bitcoin/depends/x86_64-unknown-openbsd"
export BDB_PREFIX="[path displayed above]"
```

#### GUI Dependencies
Expand All @@ -63,50 +61,44 @@ export BDB_PREFIX="/path/to/bitcoin/depends/x86_64-unknown-openbsd"
Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, Qt 5 is required.

```bash
pkg_add qt5
pkg_add qtbase qttools
```

## Building Bitcoin Core

**Important**: Use `gmake` (the non-GNU `make` will exit with an error).
#### Test Suite Dependencies
There is an included test suite that is useful for testing code changes when developing.
To run the test suite (recommended), you will need to have Python 3 installed:

Preparation:
```bash

# Adapt the following for the version you installed (major.minor only):
export AUTOCONF_VERSION=2.71
export AUTOMAKE_VERSION=1.16

./autogen.sh
pkg_add install python # Select the newest version of the package.
```

## Building Bitcoin Core

### 1. Configuration

There are many ways to configure Bitcoin Core, here are a few common examples:

##### Descriptor Wallet and GUI:
This enables the GUI and descriptor wallet support, assuming `sqlite` and `qt5` are installed.
This enables the GUI and descriptor wallet support, assuming SQLite and Qt 5 are installed.

```bash
./configure MAKE=gmake
cmake -B build -DWITH_SQLITE=ON -DWITH_GUI=Qt5
```

Run `cmake -B build -LH` to see the full list of available options.

##### Descriptor & Legacy Wallet. No GUI:
This enables support for both wallet types and disables the GUI:

```bash
./configure --with-gui=no \
BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" \
BDB_CFLAGS="-I${BDB_PREFIX}/include" \
MAKE=gmake
cmake -B build -DWITH_GUI=OFF -DBerkeleyDB_INCLUDE_DIR:PATH="${BDB_PREFIX}/include"
```

### 2. Compile
**Important**: Use `gmake` (the non-GNU `make` will exit with an error).

```bash
gmake # use "-j N" for N parallel jobs
gmake check # Run tests if Python 3 is available
cmake --build build # Use "-j N" for N parallel jobs.
ctest --test-dir build # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
```

## Resource limits
Expand Down

0 comments on commit 2fc8782

Please sign in to comment.