Building from source
When building Bitcoin Core from source, there are some platform-dependant instructions to follow.
To learn how to build for your platform, visit the Bitcoin Core bitcoin/doc directory, and read the file named "build-*.md", where "*" is the name of your platform. For windows this is "build-windows.md", for macOS this is "build-osx.md" and for most linux distributions this is "build-unix.md".
Out-of-source builds with CMake
Bitcoin Core v30.2 uses CMake as the build system (replacing the older autotools). Using a separate build directory is the standard approach with CMake and helps keep the source directory clean.
From within your Bitcoin Core source directory you can run:
# Configure the build (creates build/ directory)
cmake -B build
# Build with all available cores
cmake --build build -j$(nproc)
# Run the tests
test/functional/test_runner.py -j$(nproc)You can pass configuration options with -D flags:
# Example: build with wallet disabled
cmake -B build -DENABLE_WALLET=OFF
# Example: build in release mode with tests
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON| To run individual functional tests using the bitcoind binary built in an out-of-source build change directory back to the root source and specify the config.ini file from within the build directory: |
| For older versions (pre-v28) that use autotools, the build sequence was: |