Bitcoin Forum
May 28, 2024, 03:05:37 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Guide] Human way to compile altcoin for Ubuntu & Debian or Windows 32 & 64bit  (Read 437 times)
dr4ge (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 0


View Profile WWW
July 04, 2018, 04:34:01 PM
Last edit: July 10, 2018, 12:43:26 PM by dr4ge
 #1

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 Smiley

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 Build
You 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 4
Miniupnpc:

sudo apt-get install libminiupnpc-dev

Step5:
Dependencies for the GUI Qt5

sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler

sudo apt-get install libqrencode-dev

Step6
Cross-compilation

sudo 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. Smiley

Tobuild:
Note: clone coin repository separately for each build


For 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  Smiley
 
Cheers!
Dr4ge.
DZPrince
Jr. Member
*
Offline Offline

Activity: 116
Merit: 8


View Profile
September 15, 2018, 02:37:16 AM
 #2

Hi Dr4ge,

I have followed your steps not skipping a step for my alt coin; however, when I was at the step of compiling, I did see a depends folder which does not exist for my altcoin.  The make file did not work.

I am running an Ubuntu vm on Windows 10 to compile a Windows version.

I do however have a .pro file in my altcoin directory.  Would I have to use qmake instead?


Sprouts Classic 2% Daily APR Interest, 730% a year https://bitcointalk.org/index.php?topic=4834 (https://bitcointalk.org/index.php?topic=4834706.0)
DZPrince
Jr. Member
*
Offline Offline

Activity: 116
Merit: 8


View Profile
September 15, 2018, 08:12:34 PM
 #3

Hi Dr4ge,

I have followed your steps not skipping a step for my alt coin; however, when I was at the step of compiling, I did see a depends folder which does not exist for my altcoin.  The make file did not work.

I am running an Ubuntu vm on Windows 10 to compile a Windows version.

I do however have a .pro file in my altcoin directory.  Would I have to use qmake instead?



Most developers provide building-instructions (at least for linux) on their github (often in the readme)

Yes.  I have tried the steps for my coin without any success in compiling it for Windows.  I tried with the Ubuntu app on Windows app then downloading Virtualbox to run a Ubuntu vm to cross compile.  I can compile it and run for Mac no problem.

I have Googled on how to cross compile the Windows wallet on Windows, using Ubuntu/Debian and also followed those steps.

Below is a link to my altcoin project source code on git:
https://github.com/skourdes/SproutsClassic

I don't know why all the compiling trouble for Windows.

Sprouts Classic 2% Daily APR Interest, 730% a year https://bitcointalk.org/index.php?topic=4834 (https://bitcointalk.org/index.php?topic=4834706.0)
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!