Cross compiling specific instructions
Dependency Build Instructions
sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3
Now, you can either build from self-compiled depends or install the required dependencies:
sudo apt-get install libevent-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev libfmt-dev
Jagoancoin Core can be cross-compiled on Linux to all other supported host systems. This is done by changing the
HOSTparameter when building the dependencies and then specifying another
--prefixdirectory when building Jagoancoin.
The following instructions are only tested on Debian Stretch and Ubuntu Bionic.
Cross-compiling to MacOSX requires a few additional packages to be installed:
$ sudo apt-get install python3-setuptools libcap-dev zlib1g-dev libbz2-dev
Additionally, the Mac OSX SDK must be downloaded and extracted manually:
$ 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
$ make HOST=x86_64-apple-darwin14 -j4
When building Jagoancoin Core, use
$ ./configure --prefix=`pwd`/depends/x86_64-apple-darwin14
The steps below can be performed on Ubuntu (including in a VM) or WSL. The depends system will also work on other Linux distributions, however the commands for installing the toolchain will be different.
First, install the general dependencies:
sudo apt update
sudo apt upgrade
sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git python3 cmake
A host toolchain (
build-essential) is necessary because some dependency packages need to build host utilities that are used in the build process.
See dependencies.md for a complete overview.
sudo apt install nsis
Acquire the source in the usual way:
git clone https://github.com/Raptor3um/jagoancoin
The first step is to install the mingw-w64 cross-compilation tool chain:
sudo apt install g++-mingw-w64-x86-64
Ubuntu Bionic 18.04 1:
sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.
Once the toolchain is installed the build steps are common:
Note that for WSL the Jagoancoin Core source path MUST be somewhere in the default mount file system, for example /usr/src/jagoancoin, AND not under /mnt/d/. If this is not the case the dependency autoconf scripts will fail. This means you cannot use a directory that is located directly on the host Windows file system to perform the build.
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
./autogen.sh # not required when building from tarball
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
Cross-compiling to ARM-Linux requires a few additional packages to be installed:
$ sudo apt-get install g++-arm-linux-gnueabihf
$ make HOST=arm-linux-gnueabihf -j4
When building Jagoancoin Core, use
$ ./configure --prefix=`pwd`/depends/arm-linux-gnueabihf
1: Starting from Ubuntu Xenial 16.04, both the 32 and 64 bit Mingw-w64 packages install two different compiler options to allow a choice between either posix or win32 threads. The default option is win32 threads which is the more efficient since it will result in binary code that links directly with the Windows kernel32.lib. Unfortunately, the headers required to support win32 threads conflict with some of the classes in the C++11 standard library, in particular std::mutex. It's not possible to build the Jagoancoin Core code using the win32 version of the Mingw-w64 cross compilers (at least not without modifying headers in the Jagoancoin Core source code).