|
1 | 1 | Mac OS X Build Instructions and Notes |
2 | 2 | ==================================== |
3 | | -This guide will show you how to build Bitcoin Core for OS X. |
4 | | - |
5 | | -Notes |
6 | | ------ |
7 | | - |
8 | | -* Tested on OS X 10.7 through 10.11 on 64-bit Intel processors only. |
9 | | - |
10 | | -* All of the commands should be executed in a Terminal application. The |
11 | | -built-in one is located in `/Applications/Utilities`. |
| 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`. |
12 | 5 |
|
13 | 6 | Preparation |
14 | 7 | ----------- |
| 8 | +Download and install [Xcode](https://developer.apple.com/xcode/download). |
15 | 9 |
|
16 | | -You need to install Xcode with all the options checked so that the compiler |
17 | | -and everything is available in /usr not just /Developer. Xcode should be |
18 | | -available on your OS X installation media, but if not, you can get the |
19 | | -current version from https://developer.apple.com/xcode/. If you install |
20 | | -Xcode 4.3 or later, you'll need to install its command line tools. This can |
21 | | -be done in `Xcode > Preferences > Downloads > Components` and generally must |
22 | | -be re-done or updated every time Xcode is updated. |
23 | | - |
24 | | -You will also need to install [Homebrew](http://brew.sh) in order to install library |
25 | | -dependencies. |
| 10 | +Once installed, run `xcode-select --install` to install the OS X command line tools. |
26 | 11 |
|
27 | | -The installation of the actual dependencies is covered in the instructions |
28 | | -sections below. |
| 12 | +Install [Homebrew](http://brew.sh). |
29 | 13 |
|
30 | | -Instructions: Homebrew |
| 14 | +Dependencies |
31 | 15 | ---------------------- |
32 | 16 |
|
33 | | -#### Install dependencies using Homebrew |
| 17 | + brew install automake berkeley-db4 libtool boost --c++11 miniupnpc openssl pkg-config protobuf --c++11 qt5 libevent |
34 | 18 |
|
35 | | - brew install autoconf automake berkeley-db4 libtool boost miniupnpc openssl pkg-config protobuf qt5 libevent |
| 19 | +NOTE: Building with Qt4 is still supported, however, could result in a broken UI. Building with Qt5 is recommended. |
36 | 20 |
|
37 | | -NOTE: Building with Qt4 is still supported, however, could result in a broken UI. As such, building with Qt5 is recommended. |
38 | | - |
39 | | -### Building `bitcoin` |
| 21 | +Build Bitcoin Core |
| 22 | +------------------------ |
40 | 23 |
|
41 | | -1. Clone the GitHub tree to get the source code and go into the directory. |
| 24 | +1. Clone the bitcoin source code and cd into `bitcoin` |
42 | 25 |
|
43 | | - git clone https://github.com/bitcoin/bitcoin.git |
| 26 | + git clone https://github.com/bitcoin/bitcoin |
44 | 27 | cd bitcoin |
45 | 28 |
|
46 | 29 | 2. Build bitcoin-core: |
47 | | - This will configure and build the headless bitcoin binaries as well as the gui (if Qt is found). |
48 | | - You can disable the gui build by passing `--without-gui` to configure. |
| 30 | + |
| 31 | + Configure and build the headless bitcoin binaries as well as the GUI (if Qt is found). |
| 32 | + |
| 33 | + You can disable the GUI build by passing `--without-gui` to configure. |
49 | 34 |
|
50 | 35 | ./autogen.sh |
51 | 36 | ./configure |
52 | 37 | make |
53 | 38 |
|
54 | | -3. It is also a good idea to build and run the unit tests: |
| 39 | +3. It is recommended to build and run the unit tests: |
55 | 40 |
|
56 | 41 | make check |
57 | 42 |
|
58 | | -4. (Optional) You can also install bitcoind to your path: |
59 | | - |
60 | | - make install |
61 | | - |
62 | | -Use Qt Creator as IDE |
63 | | ------------------------- |
64 | | -You can use Qt Creator as IDE, for debugging and for manipulating forms, etc. |
65 | | -Download Qt Creator from https://www.qt.io/download/. Download the "community edition" and only install Qt Creator (uncheck the rest during the installation process). |
66 | | - |
67 | | -1. Make sure you installed everything through Homebrew mentioned above |
68 | | -2. Do a proper ./configure --enable-debug |
69 | | -3. In Qt Creator do "New Project" -> Import Project -> Import Existing Project |
70 | | -4. Enter "bitcoin-qt" as project name, enter src/qt as location |
71 | | -5. Leave the file selection as it is |
72 | | -6. Confirm the "summary page" |
73 | | -7. In the "Projects" tab select "Manage Kits..." |
74 | | -8. Select the default "Desktop" kit and select "Clang (x86 64bit in /usr/bin)" as compiler |
75 | | -9. Select LLDB as debugger (you might need to set the path to your installation) |
76 | | -10. Start debugging with Qt Creator |
77 | | - |
78 | | -Creating a release build |
79 | | ------------------------- |
80 | | -You can ignore this section if you are building `bitcoind` for your own use. |
81 | | - |
82 | | -bitcoind/bitcoin-cli binaries are not included in the Bitcoin-Qt.app bundle. |
83 | | - |
84 | | -If you are building `bitcoind` or `Bitcoin Core` for others, your build machine should be set up |
85 | | -as follows for maximum compatibility: |
| 43 | +4. You can also create a .dmg that contains the .app bundle (optional): |
86 | 44 |
|
87 | | -All dependencies should be compiled with these flags: |
88 | | - |
89 | | - -mmacosx-version-min=10.7 |
90 | | - -arch x86_64 |
91 | | - -isysroot $(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk |
92 | | - |
93 | | -Once dependencies are compiled, see [doc/release-process.md](release-process.md) for how the Bitcoin Core |
94 | | -bundle is packaged and signed to create the .dmg disk image that is distributed. |
| 45 | + make deploy |
95 | 46 |
|
96 | 47 | Running |
97 | 48 | ------- |
98 | 49 |
|
99 | | -It's now available at `./bitcoind`, provided that you are still in the `src` |
100 | | -directory. We have to first create the RPC configuration file, though. |
| 50 | +Bitcoin Core is now available at `./src/bitcoind` |
101 | 51 |
|
102 | | -Run `./bitcoind` to get the filename where it should be put, or just try these |
103 | | -commands: |
| 52 | +Before running, it's recommended you create an RPC configuration file. |
104 | 53 |
|
105 | 54 | echo -e "rpcuser=bitcoinrpc\nrpcpassword=$(xxd -l 16 -p /dev/urandom)" > "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf" |
| 55 | + |
106 | 56 | chmod 600 "/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf" |
107 | 57 |
|
108 | | -The next time you run it, it will start downloading the blockchain, but it won't |
109 | | -output anything while it's doing this. This process may take several hours; |
110 | | -you can monitor its process by looking at the debug.log file, like this: |
| 58 | +The first time you run bitcoind, it will start downloading the blockchain. This process could take several hours. |
| 59 | + |
| 60 | +You can monitor the download process by looking at the debug.log file: |
111 | 61 |
|
112 | 62 | tail -f $HOME/Library/Application\ Support/Bitcoin/debug.log |
113 | 63 |
|
114 | 64 | Other commands: |
115 | 65 | ------- |
116 | 66 |
|
117 | | - ./bitcoind -daemon # to start the bitcoin daemon. |
118 | | - ./bitcoin-cli --help # for a list of command-line options. |
119 | | - ./bitcoin-cli help # When the daemon is running, to get a list of RPC commands |
| 67 | + ./src/bitcoind -daemon # Starts the bitcoin daemon. |
| 68 | + ./src/bitcoin-cli --help # Outputs a list of command-line options. |
| 69 | + ./src/bitcoin-cli help # Outputs a list of RPC commands when the daemon is running. |
| 70 | + |
| 71 | +Using Qt Creator as IDE |
| 72 | +------------------------ |
| 73 | +You can use Qt Creator as an IDE, for bitcoin development. |
| 74 | +Download and install the community edition of [Qt Creator](https://www.qt.io/download/). |
| 75 | +Uncheck everything except Qt Creator during the installation process. |
120 | 76 |
|
121 | | -Using Qt official installer while building |
122 | | ------------------------------------------- |
| 77 | +1. Make sure you installed everything through Homebrew mentioned above |
| 78 | +2. Do a proper ./configure --enable-debug |
| 79 | +3. In Qt Creator do "New Project" -> Import Project -> Import Existing Project |
| 80 | +4. Enter "bitcoin-qt" as project name, enter src/qt as location |
| 81 | +5. Leave the file selection as it is |
| 82 | +6. Confirm the "summary page" |
| 83 | +7. In the "Projects" tab select "Manage Kits..." |
| 84 | +8. Select the default "Desktop" kit and select "Clang (x86 64bit in /usr/bin)" as compiler |
| 85 | +9. Select LLDB as debugger (you might need to set the path to your installation) |
| 86 | +10. Start debugging with Qt Creator |
| 87 | + |
| 88 | +Notes |
| 89 | +----- |
| 90 | + |
| 91 | +* Tested on OS X 10.7 through 10.11 on 64-bit Intel processors only. |
123 | 92 |
|
124 | | -If you prefer to use the latest Qt installed from the official binary |
125 | | -installer over the brew version, you have to make several changes to |
126 | | -the installed tree and its binaries (all these changes are contained |
127 | | -in the brew version already). The changes needed are described in |
128 | | -[#7714](https://github.com/bitcoin/bitcoin/issues/7714). We do not |
129 | | -support building Bitcoin Core this way though. |
| 93 | +* Building with downloaded Qt binaries is not officially supported. See the notes in [#7714](https://github.com/bitcoin/bitcoin/issues/7714) |
0 commit comments