Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions doc/build-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
Cross-compiliation of Dash Core
===============================

Dash Core can be cross-compiled on Linux to all other supported host systems. This is done by changing
the `HOST` parameter when building the dependencies and then specifying another `--prefix` directory when building Dash.

The following instructions are only tested on Debian Stretch and Ubuntu Bionic.

MacOSX Cross-compilation
------------------------
Cross-compiling to MacOSX requires a few additional packages to be installed:

```bash
$ sudo apt-get install python3-setuptools libcap-dev zlib1g-dev libbz2-dev
```

Additionally, the Mac OSX SDK must be downloaded and extracted manually:

```bash
$ mkdir -p depends/sdk-sources
$ mkdir -p depends/SDKs
$ curl https://bitcoincore.org/depends-sources/sdks/MacOSX10.11.sdk.tar.gz -o depends/sdk-sources/MacOSX10.11.sdk.tar.gz
$ tar -C depends/SDKs -xf depends/sdk-sources/MacOSX10.11.sdk.tar.gz
```

When building the dependencies, as described in [build-generic](build-generic.md), use

```bash
$ make HOST=x86_64-apple-darwin11 -j4
```

When building Dash Core, use

```bash
$ ./configure --prefix `pwd`/depends/x86_64-apple-darwin11
```

Windows 64bit/32bit Cross-compilation
-------------------------------
Cross-compiling to Windows requires a few additional packages to be installed:

```bash
$ sudo apt-get install nsis wine wine64 bc
```

For Windows 64bit, install :
```bash
$ sudo apt-get install g++-mingw-w64-x86-64
$ # Required to enable C++ threading libraries (e.g. std::thread)
$ sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
$ sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
```

For Windows 32bit, install:
```bash
$ sudo apt-get install g++-mingw-w64-i686
$ # Required to enable C++ threading libraries (e.g. std::thread)
$ sudo update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
$ sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
```

When building the dependencies, as described in [build-generic](build-generic.md), use

```bash
$ make HOST=x86_64-w64-mingw32 -j4
```

When building Dash Core, use

```bash
$ ./configure --prefix `pwd`/depends/x86_64-w64-mingw32
```

These commands will build for Windows 64bit. If you want to compile for 32bit,
replace `x86_64-w64-mingw32` with `i686-w64-mingw32`.

ARM-Linux Cross-compilation
-------------------
Cross-compiling to ARM-Linux requires a few additional packages to be installed:

```bash
$ sudo apt-get install g++-arm-linux-gnueabihf
```

When building the dependencies, as described in [build-generic](build-generic.md), use

```bash
$ make HOST=arm-linux-gnueabihf -j4
```

When building Dash Core, use

```bash
$ ./configure --prefix `pwd`/depends/arm-linux-gnueabihf
```
79 changes: 79 additions & 0 deletions doc/build-generic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
GENERIC BUILD NOTES
====================
Some notes on how to build Dash Core based on the [depends](../depends/README.md) build system.

Note on old build instructions
------------------------------
In the past, the build documentation contained instructions on how to build Dash with system-wide installed dependencies
like BerkeleyDB 4.8, boost and Qt. Building this way is considered deprecated and only building with the `depends` prefix
is supported today.

Required build tools and environment
------------------------------------
Building the dependencies and Dash Core requires some essential build tools to be installed before. Please see
[build-unix](build-unix.md), [build-osx](build-osx.md) and [build-windows](build-windows.md) for details.

Building dependencies
---------------------
Dash inherited the `depends` folder from Bitcoin, which contains all dependencies required to build Dash. These
dependencies must be built before Dash can actually be built. To do so, perform the following:

```bash
$ cd depends
$ make -j4 # Choose a good -j value, depending on the number of CPU cores available
$ cd ..
```

This will download and build all dependencies required to build Dash Core. Caching of build results will ensure that only
the packages are rebuilt which have changed since the last depends build.

It is required to re-run the above commands from time to time when dependencies have been updated or added. If this is
not done, build failures might occur when building Dash.

Please read the [depends](../depends/README.md) documentation for more details on supported hosts and configuration
options. If no host is specified (as in the above example) when calling `make`, the depends system will default to your
local host system.

Building Dash Core
---------------------

```bash
$ ./autogen.sh
$ ./configure --prefix `pwd`/depends/<host>
$ make
$ make install # optional
```

Please replace `<host>` with your local system's `host-platform-triplet`. The following triplets are usually valid:
- `i686-pc-linux-gnu` for Linux32
- `x86_64-pc-linux-gnu` for Linux64
- `i686-w64-mingw32` for Win32
- `x86_64-w64-mingw32` for Win64
- `x86_64-apple-darwin11` for MacOSX
- `arm-linux-gnueabihf` for Linux ARM 32 bit
- `aarch64-linux-gnu` for Linux ARM 64 bit

If you want to cross-compile for another platform, choose the appropriate `<host>` and make sure to build the
dependencies with the same host before.


ccache
------
The depends system also contains [ccache](https://ccache.samba.org/), which caches build results on source->object
level. `./configure` of Dash Core will autodetect the presence of ccache and enable use of it. To disable ccache, use
`./configure --prefix=<prefix> --disable-ccache`.

The default maximum cache size is 5G, which might not be enough to cache multiple builds when switching Git branches
very often. It is advised to increase the maximum cache size:

```bash
$ ./depends/<host>/bin/ccache -M20G
```

Additional Configure Flags
--------------------------
A list of additional configure flags can be displayed with:

```bash
./configure --help
```
49 changes: 11 additions & 38 deletions doc/build-osx.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,22 @@ When the popup appears, click `Install`.

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

Dependencies
----------------------
Base build dependencies
-----------------------

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

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

brew install librsvg
Building
--------

NOTE: Building with Qt4 is still supported, however, doing so could result in a broken UI. Therefore, building with Qt5 is recommended.

Build Dash Core
------------------------

1. Clone the Dash Core source code and cd into `dash`

git clone https://github.com/dashpay/dash
cd dash

2. Build Dash Core:

Configure and build the headless dash binaries as well as the GUI (if Qt is found).

You can disable the GUI build by passing `--without-gui` to configure.

./autogen.sh
./configure
make

3. It is recommended to build and run the unit tests:

make check

4. You can also create a .dmg that contains the .app bundle (optional):

make deploy
Follow the instructions in [build-generic](build-generic.md)

Running
-------
Expand Down Expand Up @@ -90,10 +70,3 @@ Uncheck everything except Qt Creator during the installation process.
8. Select the default "Desktop" kit and select "Clang (x86 64bit in /usr/bin)" as compiler
9. Select LLDB as debugger (you might need to set the path to your installation)
10. Start debugging with Qt Creator

Notes
-----

* Tested on OS X 10.8 through 10.12 on 64-bit Intel processors only.

* Building with downloaded Qt binaries is not officially supported. See the notes in [#7714](https://github.com/bitcoin/bitcoin/issues/7714)
Loading