Replaces numbered place marker %2 with %1.
[bitcoinplatinum.git] / doc / build-osx.md
blob3e243933c80ac418311c83466578bf29b95a4e62
1 Mac OS X Build Instructions and Notes
2 ====================================
3 The commands in this guide should be executed in a Terminal application.
4 The built-in one is located in `/Applications/Utilities/Terminal.app`.
6 Preparation
7 -----------
8 Install the OS X command line tools:
10 `xcode-select --install`
12 When the popup appears, click `Install`.
14 Then install [Homebrew](https://brew.sh).
16 Dependencies
17 ----------------------
19     brew install automake berkeley-db4 libtool boost miniupnpc openssl pkg-config protobuf python3 qt libevent
21 See [dependencies.md](dependencies.md) for a complete overview.
23 If you want to build the disk image with `make deploy` (.dmg / optional), you need RSVG
25     brew install librsvg
27 NOTE: Building with Qt4 is still supported, however, could result in a broken UI. Building with Qt5 is recommended.
29 Berkeley DB
30 -----------
31 It is recommended to use Berkeley DB 4.8. If you have to build it yourself,
32 you can use [the installation script included in contrib/](/contrib/install_db4.sh)
33 like so
35 ```shell
36 ./contrib/install_db4.sh .
37 ```
39 from the root of the repository.
41 **Note**: You only need Berkeley DB if the wallet is enabled (see the section *Disable-Wallet mode* below).
43 Build Bitcoin Core
44 ------------------------
46 1. Clone the bitcoin source code and cd into `bitcoin`
48         git clone https://github.com/bitcoin/bitcoin
49         cd bitcoin
51 2.  Build bitcoin-core:
53     Configure and build the headless bitcoin binaries as well as the GUI (if Qt is found).
55     You can disable the GUI build by passing `--without-gui` to configure.
57         ./autogen.sh
58         ./configure
59         make
61 3.  It is recommended to build and run the unit tests:
63         make check
65 4.  You can also create a .dmg that contains the .app bundle (optional):
67         make deploy
69 Running
70 -------
72 Bitcoin Core is now available at `./src/bitcoind`
74 Before running, it's recommended you create an RPC configuration file.
76     echo -e "rpcuser=bitcoinrpc\nrpcpassword=$(xxd -l 16 -p /dev/urandom)" > "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf"
78     chmod 600 "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf"
80 The first time you run bitcoind, it will start downloading the blockchain. This process could take several hours.
82 You can monitor the download process by looking at the debug.log file:
84     tail -f $HOME/Library/Application\ Support/Bitcoin/debug.log
86 Other commands:
87 -------
89     ./src/bitcoind -daemon # Starts the bitcoin daemon.
90     ./src/bitcoin-cli --help # Outputs a list of command-line options.
91     ./src/bitcoin-cli help # Outputs a list of RPC commands when the daemon is running.
93 Using Qt Creator as IDE
94 ------------------------
95 You can use Qt Creator as an IDE, for bitcoin development.
96 Download and install the community edition of [Qt Creator](https://www.qt.io/download/).
97 Uncheck everything except Qt Creator during the installation process.
99 1. Make sure you installed everything through Homebrew mentioned above
100 2. Do a proper ./configure --enable-debug
101 3. In Qt Creator do "New Project" -> Import Project -> Import Existing Project
102 4. Enter "bitcoin-qt" as project name, enter src/qt as location
103 5. Leave the file selection as it is
104 6. Confirm the "summary page"
105 7. In the "Projects" tab select "Manage Kits..."
106 8. Select the default "Desktop" kit and select "Clang (x86 64bit in /usr/bin)" as compiler
107 9. Select LLDB as debugger (you might need to set the path to your installation)
108 10. Start debugging with Qt Creator
110 Notes
111 -----
113 * Tested on OS X 10.8 through 10.13 on 64-bit Intel processors only.
115 * Building with downloaded Qt binaries is not officially supported. See the notes in [#7714](https://github.com/bitcoin/bitcoin/issues/7714)