Guide to compile Bitcoin | Dash | other altcoins and generate Ubuntu & Debian or Windows executables
I will presume that you are using Ubuntu 14.04.5 LTS because thats what I use to compile executables. You can also use other Linux distribution but this guide is related to debian based Linux system.
Reason for writing this Guide: The reason behind this guide are those who find it difficult to compile source code and generate windows .exe files, also covers the Ubuntu & debian build for bitcoin or dash (but process also follows the same for most of altcoins). I will try my best to keep it simple and humanly
Note: C++ compilers are memory-hungry. It is recommended to have at least 1.5 GB of memory available when compiling <coin>Core
Before We BuildYou will only be able to build when dependencies are met!
Step1: Build requirements:sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils
Step2:installing required Boost library files:sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev
Step3:BerkeleyDB is required for the wallet:sudo apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
Step 4Miniupnpc:sudo apt-get install libminiupnpc-dev
Step5:Dependencies for the GUI Qt5sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
sudo apt-get install libqrencode-dev
Step6Cross-compilationsudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl
- Buid requirements for 64bit windows:
sudo apt-get install g++-mingw-w64-x86-64 mingw-w64-x86-64-dev
- Build requirements for 32bit windows:
sudo apt-get install g++-mingw-w64-i686 mingw-w64-i686-dev
Now that you have installed all the requirements the way it has been mentions in above steps, your compiler is ready to build the executable for Ubuntu & Debian or Window x86_32bit & x86_64bit.
Tobuild:Note: clone coin repository separately for each buildFor Ubuntu & Debian: git clone
https://github.com/<username>/<repo.git>
cd <repo>
./autogen.sh
./configure
make
make install # optional (it will install the binaries to /usr/local/bin
For Windows x86_32bit: git clone
https://github.com/<username>/<repo.git>
cd <repo>/depends
make HOST=i686-w64-mingw32
cd ..
./autogen.sh
CONFIG_SITE=$PWD/depends/i686-w64-mingw32/share/config.site ./configure -with-gui --disable-zmq --prefix=/
make
For Windows x86_64bit: git clone
https://github.com/<username>/<repo.git>
cd <repo>/depends
make HOST=x86_64-w64-mingw32
cd ..
./autogen.sh
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure -with-gui --disable-zmq --prefix=/
make
If all the steps above went as expected!, you now will have the executables ready for your desired operating system.
I hope this guide has helped you to learn some new things.
Feel free to ask questions if you don't understand a step, i will support you if needed
Cheers!
Dr4ge.