diff options
Diffstat (limited to 'doc/build-osx.md')
-rw-r--r-- | doc/build-osx.md | 75 |
1 files changed, 27 insertions, 48 deletions
diff --git a/doc/build-osx.md b/doc/build-osx.md index 20c92ab7a4..5456fd00fa 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -1,6 +1,6 @@ # macOS Build Guide -**Updated for MacOS [11.2](https://www.apple.com/macos/big-sur/)** +**Updated for MacOS [14](https://www.apple.com/macos/sonoma/)** This guide describes how to build bitcoind, command-line utilities, and GUI on macOS @@ -48,11 +48,9 @@ See [dependencies.md](dependencies.md) for a complete overview. To install, run the following from your terminal: ``` bash -brew install automake libtool boost pkg-config libevent +brew install cmake boost pkg-config libevent ``` -For macOS 11 (Big Sur) and 12 (Monterey) you need to install a more recent version of llvm. - ``` bash brew install llvm ``` @@ -60,7 +58,7 @@ brew install llvm And append the following to the configure commands below: ``` bash -CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++ +-DCMAKE_C_COMPILER="$(brew --prefix llvm)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm)/bin/clang++" ``` Try `llvm@17` if compilation fails with the default version of llvm. @@ -102,9 +100,8 @@ brew install berkeley-db@4 ###### Qt -Bitcoin Core includes a GUI built with the cross-platform Qt Framework. -To compile the GUI, we need to install `qt@5`. -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 +Qt, libqrencode and pass `-DBUILD_GUI=ON`. Skip if you don't intend to use the GUI. ``` bash brew install qt@5 @@ -113,14 +110,16 @@ brew install qt@5 Note: Building with Qt binaries downloaded from the Qt website is not officially supported. See the notes in [#7714](https://github.com/bitcoin/bitcoin/issues/7714). -###### qrencode +###### libqrencode -The GUI can encode addresses in a QR Code. To build in QR support for the GUI, install `qrencode`. -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 brew install qrencode ``` + +Otherwise, if you don't need QR encoding support, you can pass `-DWITH_QRENCODE=OFF` to disable this feature. + --- #### Port Mapping Dependencies @@ -134,18 +133,6 @@ Skip if you do not need this functionality. brew install miniupnpc ``` -###### libnatpmp - -libnatpmp may be used for NAT-PMP port mapping. -Skip if you do not need this functionality. - -``` bash -brew install libnatpmp -``` - -Note: UPnP and NAT-PMP support will be compiled in and disabled by default. -Check out the [further configuration](#further-configuration) section for more information. - --- #### ZMQ Dependencies @@ -157,7 +144,6 @@ Skip if you do not need ZMQ functionality. brew install zeromq ``` -ZMQ is automatically compiled in and enabled if the dependency is detected. Check out the [further configuration](#further-configuration) section for more information. For more information on ZMQ, see: [zmq.md](zmq.md) @@ -177,7 +163,7 @@ brew install python #### Deploy Dependencies -You can deploy a `.zip` containing the Bitcoin Core application using `make deploy`. +You can [deploy](#3-deploy-optional) a `.zip` containing the Bitcoin Core application. It is required that you have `python` installed. ## Building Bitcoin Core @@ -188,32 +174,25 @@ There are many ways to configure Bitcoin Core, here are a few common examples: ##### Wallet (BDB + SQlite) Support, No GUI: -If `berkeley-db@4` is installed, then legacy wallet support will be built. -If `sqlite` is installed, then descriptor wallet support will also be built. -Additionally, this explicitly disables the GUI. +If `berkeley-db@4` or `sqlite` are not installed, this will throw an error. ``` bash -./autogen.sh -./configure --with-gui=no +cmake -B build -DWITH_BDB=ON ``` ##### Wallet (only SQlite) and GUI Support: -This explicitly enables the GUI and disables legacy wallet support. -If `qt` is not installed, this will throw an error. -If `sqlite` is installed then descriptor wallet functionality will be built. -If `sqlite` is not installed, then wallet functionality will be disabled. +This enables the GUI. +If `sqlite` or `qt` are not installed, this will throw an error. ``` bash -./autogen.sh -./configure --without-bdb --with-gui=yes +cmake -B build -DBUILD_GUI=ON ``` ##### No Wallet or GUI ``` bash -./autogen.sh -./configure --without-wallet --with-gui=no +cmake -B build -DENABLE_WALLET=OFF ``` ##### Further Configuration @@ -222,7 +201,7 @@ You may want to dig deeper into the configuration options to achieve your desire Examine the output of the following command for a full list of configuration options: ``` bash -./configure -help +cmake -B build -LH ``` ### 2. Compile @@ -231,8 +210,8 @@ After configuration, you are ready to compile. Run the following in your terminal to compile Bitcoin Core: ``` bash -make # use "-j N" here for N parallel jobs -make check # Run tests if Python 3 is available +cmake --build build # Use "-j N" here 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. ``` ### 3. Deploy (optional) @@ -240,13 +219,13 @@ make check # Run tests if Python 3 is available You can also create a `.zip` containing the `.app` bundle by running the following command: ``` bash -make deploy +cmake --build build --target deploy ``` ## Running Bitcoin Core -Bitcoin Core should now be available at `./src/bitcoind`. -If you compiled support for the GUI, it should be available at `./src/qt/bitcoin-qt`. +Bitcoin Core should now be available at `./build/src/bitcoind`. +If you compiled support for the GUI, it should be available at `./build/src/qt/bitcoin-qt`. The first time you run `bitcoind` or `bitcoin-qt`, it will start downloading the blockchain. This process could take many hours, or even days on slower than average systems. @@ -276,8 +255,8 @@ tail -f $HOME/Library/Application\ Support/Bitcoin/debug.log ## Other commands: ```shell -./src/bitcoind -daemon # Starts the bitcoin daemon. -./src/bitcoin-cli --help # Outputs a list of command-line options. -./src/bitcoin-cli help # Outputs a list of RPC commands when the daemon is running. -./src/qt/bitcoin-qt -server # Starts the bitcoin-qt server mode, allows bitcoin-cli control +./build/src/bitcoind -daemon # Starts the bitcoin daemon. +./build/src/bitcoin-cli --help # Outputs a list of command-line options. +./build/src/bitcoin-cli help # Outputs a list of RPC commands when the daemon is running. +./build/src/qt/bitcoin-qt -server # Starts the bitcoin-qt server mode, allows bitcoin-cli control ``` |