mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-12 22:02:28 +02:00
doc: Update for CMake-based build system
Co-authored-by: Lőrinc <pap.lorinc@gmail.com> Co-authored-by: pablomartin4btc <pablomartin4btc@gmail.com>
This commit is contained in:
@ -10,15 +10,14 @@ This guide describes how to build bitcoind, command-line utilities, and GUI on F
|
||||
Run the following as root to install the base dependencies for building.
|
||||
|
||||
```bash
|
||||
pkg install autoconf automake boost-libs git gmake libevent libtool pkgconf
|
||||
|
||||
pkg install boost-libs cmake git libevent pkgconf
|
||||
```
|
||||
|
||||
See [dependencies.md](dependencies.md) for a complete overview.
|
||||
|
||||
### 2. Clone Bitcoin Repo
|
||||
Now that `git` and all the required dependencies are installed, let's clone the Bitcoin Core repository to a directory. All build scripts and commands will run from this directory.
|
||||
``` bash
|
||||
```bash
|
||||
git clone https://github.com/bitcoin/bitcoin.git
|
||||
```
|
||||
|
||||
@ -31,7 +30,7 @@ It is not necessary to build wallet functionality to run either `bitcoind` or `b
|
||||
|
||||
`sqlite3` is required to support [descriptor wallets](descriptors.md).
|
||||
Skip if you don't intend to use descriptor wallets.
|
||||
``` bash
|
||||
```bash
|
||||
pkg install sqlite3
|
||||
```
|
||||
|
||||
@ -41,7 +40,8 @@ BerkeleyDB is only required if legacy wallet support is required.
|
||||
It is required to use Berkeley DB 4.8. You **cannot** use the BerkeleyDB library
|
||||
from ports. However, you can build DB 4.8 yourself [using depends](/depends).
|
||||
|
||||
```
|
||||
```bash
|
||||
pkg install gmake
|
||||
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
|
||||
```
|
||||
|
||||
@ -64,17 +64,23 @@ sh/bash: export BDB_PREFIX=[path displayed above]
|
||||
#### GUI Dependencies
|
||||
###### Qt5
|
||||
|
||||
Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install the necessary parts of Qt. Skip if you don't intend to use the GUI.
|
||||
Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install
|
||||
the necessary parts of Qt, the libqrencode and pass `-DBUILD_GUI=ON`. Skip if you don't intend to use the GUI.
|
||||
|
||||
```bash
|
||||
pkg install qt5-buildtools qt5-core qt5-gui qt5-linguisttools qt5-testlib qt5-widgets
|
||||
```
|
||||
|
||||
###### libqrencode
|
||||
|
||||
The GUI can encode addresses in a QR Code. To build in QR support for the GUI, install `libqrencode`. Skip if not using the GUI or don't want QR code functionality.
|
||||
The GUI will be able to encode addresses in QR codes unless this feature is explicitly disabled. To install libqrencode, run:
|
||||
|
||||
```bash
|
||||
pkg install libqrencode
|
||||
```
|
||||
|
||||
Otherwise, if you don't need QR encoding support, use the `-DWITH_QRENCODE=OFF` option to disable this feature in order to compile the GUI.
|
||||
|
||||
---
|
||||
|
||||
#### Notifications
|
||||
@ -101,33 +107,28 @@ pkg install python3 databases/py-sqlite3
|
||||
There are many ways to configure Bitcoin Core, here are a few common examples:
|
||||
|
||||
##### Descriptor Wallet and GUI:
|
||||
This explicitly enables the GUI and disables legacy wallet support, assuming `sqlite` and `qt` are installed.
|
||||
This disables legacy wallet support and enables the GUI, assuming `sqlite` and `qt` are installed.
|
||||
```bash
|
||||
./autogen.sh
|
||||
./configure --without-bdb --with-gui=yes MAKE=gmake
|
||||
cmake -B build -DWITH_BDB=OFF -DBUILD_GUI=ON
|
||||
```
|
||||
|
||||
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, assuming
|
||||
This enables support for both wallet types, assuming
|
||||
`sqlite3` and `db4` are both installed.
|
||||
```bash
|
||||
./autogen.sh
|
||||
./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 -DBerkeleyDB_INCLUDE_DIR:PATH="${BDB_PREFIX}/include"
|
||||
```
|
||||
|
||||
##### No Wallet or GUI
|
||||
``` bash
|
||||
./autogen.sh
|
||||
./configure --without-wallet --with-gui=no MAKE=gmake
|
||||
```bash
|
||||
cmake -B build -DENABLE_WALLET=OFF
|
||||
```
|
||||
|
||||
### 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.
|
||||
```
|
||||
|
Reference in New Issue
Block a user