Remove redundant NULL checks after new
[bitcoinplatinum.git] / doc / build-osx.md
blob836c856a64e75ddb23193a26d4510c07a812b52e
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 --c++11 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 Build Bitcoin Core
30 ------------------------
32 1. Clone the bitcoin source code and cd into `bitcoin`
34         git clone https://github.com/bitcoin/bitcoin
35         cd bitcoin
37 2.  Build bitcoin-core:
39     Configure and build the headless bitcoin binaries as well as the GUI (if Qt is found).
41     You can disable the GUI build by passing `--without-gui` to configure.
43         ./autogen.sh
44         ./configure
45         make
47 3.  It is recommended to build and run the unit tests:
49         make check
51 4.  You can also create a .dmg that contains the .app bundle (optional):
53         make deploy
55 Running
56 -------
58 Bitcoin Core is now available at `./src/bitcoind`
60 Before running, it's recommended you create an RPC configuration file.
62     echo -e "rpcuser=bitcoinrpc\nrpcpassword=$(xxd -l 16 -p /dev/urandom)" > "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf"
64     chmod 600 "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf"
66 The first time you run bitcoind, it will start downloading the blockchain. This process could take several hours.
68 You can monitor the download process by looking at the debug.log file:
70     tail -f $HOME/Library/Application\ Support/Bitcoin/debug.log
72 Other commands:
73 -------
75     ./src/bitcoind -daemon # Starts the bitcoin daemon.
76     ./src/bitcoin-cli --help # Outputs a list of command-line options.
77     ./src/bitcoin-cli help # Outputs a list of RPC commands when the daemon is running.
79 Using Qt Creator as IDE
80 ------------------------
81 You can use Qt Creator as an IDE, for bitcoin development.
82 Download and install the community edition of [Qt Creator](https://www.qt.io/download/).
83 Uncheck everything except Qt Creator during the installation process.
85 1. Make sure you installed everything through Homebrew mentioned above
86 2. Do a proper ./configure --enable-debug
87 3. In Qt Creator do "New Project" -> Import Project -> Import Existing Project
88 4. Enter "bitcoin-qt" as project name, enter src/qt as location
89 5. Leave the file selection as it is
90 6. Confirm the "summary page"
91 7. In the "Projects" tab select "Manage Kits..."
92 8. Select the default "Desktop" kit and select "Clang (x86 64bit in /usr/bin)" as compiler
93 9. Select LLDB as debugger (you might need to set the path to your installation)
94 10. Start debugging with Qt Creator
96 Notes
97 -----
99 * Tested on OS X 10.8 through 10.12 on 64-bit Intel processors only.
101 * Building with downloaded Qt binaries is not officially supported. See the notes in [#7714](https://github.com/bitcoin/bitcoin/issues/7714)