Skip to content

Commit d7e5f02

Browse files
codablockUdjinM6
authored andcommitted
Update build documentation (#2323)
Only describe how to build based on the depends system
1 parent bd8c54d commit d7e5f02

File tree

5 files changed

+237
-337
lines changed

5 files changed

+237
-337
lines changed

doc/build-cross.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
Cross-compiliation of Dash Core
2+
===============================
3+
4+
Dash Core can be cross-compiled on Linux to all other supported host systems. This is done by changing
5+
the `HOST` parameter when building the dependencies and then specifying another `--prefix` directory when building Dash.
6+
7+
The following instructions are only tested on Debian Stretch and Ubuntu Bionic.
8+
9+
MacOSX Cross-compilation
10+
------------------------
11+
Cross-compiling to MacOSX requires a few additional packages to be installed:
12+
13+
```bash
14+
$ sudo apt-get install python3-setuptools libcap-dev zlib1g-dev libbz2-dev
15+
```
16+
17+
Additionally, the Mac OSX SDK must be downloaded and extracted manually:
18+
19+
```bash
20+
$ mkdir -p depends/sdk-sources
21+
$ mkdir -p depends/SDKs
22+
$ curl https://bitcoincore.org/depends-sources/sdks/MacOSX10.11.sdk.tar.gz -o depends/sdk-sources/MacOSX10.11.sdk.tar.gz
23+
$ tar -C depends/SDKs -xf depends/sdk-sources/MacOSX10.11.sdk.tar.gz
24+
```
25+
26+
When building the dependencies, as described in [build-generic](build-generic.md), use
27+
28+
```bash
29+
$ make HOST=x86_64-apple-darwin11 -j4
30+
```
31+
32+
When building Dash Core, use
33+
34+
```bash
35+
$ ./configure --prefix `pwd`/depends/x86_64-apple-darwin11
36+
```
37+
38+
Windows 64bit/32bit Cross-compilation
39+
-------------------------------
40+
Cross-compiling to Windows requires a few additional packages to be installed:
41+
42+
```bash
43+
$ sudo apt-get install nsis wine wine64 bc
44+
```
45+
46+
For Windows 64bit, install :
47+
```bash
48+
$ sudo apt-get install g++-mingw-w64-x86-64
49+
$ # Required to enable C++ threading libraries (e.g. std::thread)
50+
$ sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
51+
$ sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
52+
```
53+
54+
For Windows 32bit, install:
55+
```bash
56+
$ sudo apt-get install g++-mingw-w64-i686
57+
$ # Required to enable C++ threading libraries (e.g. std::thread)
58+
$ sudo update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
59+
$ sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
60+
```
61+
62+
When building the dependencies, as described in [build-generic](build-generic.md), use
63+
64+
```bash
65+
$ make HOST=x86_64-w64-mingw32 -j4
66+
```
67+
68+
When building Dash Core, use
69+
70+
```bash
71+
$ ./configure --prefix `pwd`/depends/x86_64-w64-mingw32
72+
```
73+
74+
These commands will build for Windows 64bit. If you want to compile for 32bit,
75+
replace `x86_64-w64-mingw32` with `i686-w64-mingw32`.
76+
77+
ARM-Linux Cross-compilation
78+
-------------------
79+
Cross-compiling to ARM-Linux requires a few additional packages to be installed:
80+
81+
```bash
82+
$ sudo apt-get install g++-arm-linux-gnueabihf
83+
```
84+
85+
When building the dependencies, as described in [build-generic](build-generic.md), use
86+
87+
```bash
88+
$ make HOST=arm-linux-gnueabihf -j4
89+
```
90+
91+
When building Dash Core, use
92+
93+
```bash
94+
$ ./configure --prefix `pwd`/depends/arm-linux-gnueabihf
95+
```

doc/build-generic.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
GENERIC BUILD NOTES
2+
====================
3+
Some notes on how to build Dash Core based on the [depends](../depends/README.md) build system.
4+
5+
Note on old build instructions
6+
------------------------------
7+
In the past, the build documentation contained instructions on how to build Dash with system-wide installed dependencies
8+
like BerkeleyDB 4.8, boost and Qt. Building this way is considered deprecated and only building with the `depends` prefix
9+
is supported today.
10+
11+
Required build tools and environment
12+
------------------------------------
13+
Building the dependencies and Dash Core requires some essential build tools to be installed before. Please see
14+
[build-unix](build-unix.md), [build-osx](build-osx.md) and [build-windows](build-windows.md) for details.
15+
16+
Building dependencies
17+
---------------------
18+
Dash inherited the `depends` folder from Bitcoin, which contains all dependencies required to build Dash. These
19+
dependencies must be built before Dash can actually be built. To do so, perform the following:
20+
21+
```bash
22+
$ cd depends
23+
$ make -j4 # Choose a good -j value, depending on the number of CPU cores available
24+
$ cd ..
25+
```
26+
27+
This will download and build all dependencies required to build Dash Core. Caching of build results will ensure that only
28+
the packages are rebuilt which have changed since the last depends build.
29+
30+
It is required to re-run the above commands from time to time when dependencies have been updated or added. If this is
31+
not done, build failures might occur when building Dash.
32+
33+
Please read the [depends](../depends/README.md) documentation for more details on supported hosts and configuration
34+
options. If no host is specified (as in the above example) when calling `make`, the depends system will default to your
35+
local host system.
36+
37+
Building Dash Core
38+
---------------------
39+
40+
```bash
41+
$ ./autogen.sh
42+
$ ./configure --prefix `pwd`/depends/<host>
43+
$ make
44+
$ make install # optional
45+
```
46+
47+
Please replace `<host>` with your local system's `host-platform-triplet`. The following triplets are usually valid:
48+
- `i686-pc-linux-gnu` for Linux32
49+
- `x86_64-pc-linux-gnu` for Linux64
50+
- `i686-w64-mingw32` for Win32
51+
- `x86_64-w64-mingw32` for Win64
52+
- `x86_64-apple-darwin11` for MacOSX
53+
- `arm-linux-gnueabihf` for Linux ARM 32 bit
54+
- `aarch64-linux-gnu` for Linux ARM 64 bit
55+
56+
If you want to cross-compile for another platform, choose the appropriate `<host>` and make sure to build the
57+
dependencies with the same host before.
58+
59+
60+
ccache
61+
------
62+
The depends system also contains [ccache](https://ccache.samba.org/), which caches build results on source->object
63+
level. `./configure` of Dash Core will autodetect the presence of ccache and enable use of it. To disable ccache, use
64+
`./configure --prefix=<prefix> --disable-ccache`.
65+
66+
The default maximum cache size is 5G, which might not be enough to cache multiple builds when switching Git branches
67+
very often. It is advised to increase the maximum cache size:
68+
69+
```bash
70+
$ ./depends/<host>/bin/ccache -M20G
71+
```
72+
73+
Additional Configure Flags
74+
--------------------------
75+
A list of additional configure flags can be displayed with:
76+
77+
```bash
78+
./configure --help
79+
```

doc/build-osx.md

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,22 @@ When the popup appears, click `Install`.
1313

1414
Then install [Homebrew](https://brew.sh).
1515

16-
Dependencies
17-
----------------------
16+
Base build dependencies
17+
-----------------------
1818

19-
brew install automake berkeley-db4 libtool boost --c++11 miniupnpc openssl pkg-config protobuf qt libevent
19+
```bash
20+
brew install automake libtool --c++11 pkg-config
21+
```
2022

2123
If you want to build the disk image with `make deploy` (.dmg / optional), you need RSVG
24+
```bash
25+
brew install librsvg
26+
```
2227

23-
brew install librsvg
28+
Building
29+
--------
2430

25-
NOTE: Building with Qt4 is still supported, however, doing so could result in a broken UI. Therefore, building with Qt5 is recommended.
26-
27-
Build Dash Core
28-
------------------------
29-
30-
1. Clone the Dash Core source code and cd into `dash`
31-
32-
git clone https://github.com/dashpay/dash
33-
cd dash
34-
35-
2. Build Dash Core:
36-
37-
Configure and build the headless dash binaries as well as the GUI (if Qt is found).
38-
39-
You can disable the GUI build by passing `--without-gui` to configure.
40-
41-
./autogen.sh
42-
./configure
43-
make
44-
45-
3. It is recommended to build and run the unit tests:
46-
47-
make check
48-
49-
4. You can also create a .dmg that contains the .app bundle (optional):
50-
51-
make deploy
31+
Follow the instructions in [build-generic](build-generic.md)
5232

5333
Running
5434
-------
@@ -90,10 +70,3 @@ Uncheck everything except Qt Creator during the installation process.
9070
8. Select the default "Desktop" kit and select "Clang (x86 64bit in /usr/bin)" as compiler
9171
9. Select LLDB as debugger (you might need to set the path to your installation)
9272
10. Start debugging with Qt Creator
93-
94-
Notes
95-
-----
96-
97-
* Tested on OS X 10.8 through 10.12 on 64-bit Intel processors only.
98-
99-
* Building with downloaded Qt binaries is not officially supported. See the notes in [#7714](https://github.com/bitcoin/bitcoin/issues/7714)

0 commit comments

Comments
 (0)