Skip to content

Linux build notes v1.6 on Ubuntu 20

Lennart Lopin edited this page Jan 27, 2022 · 10 revisions

Build Marscoin for Linux (Full Build including QT GUI) using Ubuntu 20

Using Ubuntu 20.04 LTS 64bit

Supports OpenSSL v.1.1.1 and Boost v.1.70+

1. Update OS

sudo apt-get update
sudo apt-get upgrade

2. Set up Build Environment

Set up core Linux tools

sudo apt-get install git build-essential pkg-config autoconf automake libtool libboost-all-dev libssl-dev

3. (Optional) Build DB4 Dependency

wget http://download.oracle.com/berkeley-db/db-4.8.30.zip
unzip db-4.8.30.zip
cd db-4.8.30
cd build_unix/
../dist/configure --prefix=/usr/local --enable-cxx
make
make install

This installs DB4's lib in /usr/local/lib and headers in / usr/local/includes. You can also use this script to install DB4.

4. Checkout the Marscoin repo

git clone https://github.com/marscoin/marscoin.git
cd ./marscoin

5. Switch to the latest Marscoin version

git checkout master-1.6

6. Build Marscoin!

./autogen.sh
./configure
make

This will build the marscoind node, the marscoin-cli command line interface and marscoin-tx.

Building the QT GUI client

1. Get the necessary modules/components

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

2. Re-configure to support GUI client build

./configure --with-gui=qt5
make

Issues with Berkley?

This can be fixed by doing the following:

cd ~/db-4.8.30.NC/build_unix make 
sudo make install

Check that there is a BerkeleyDB.4.8 folder in /usr/local

ls /usr/local

then create a symbolic link:

ln -s /usr/local/BerkeleyDB.4.8 /usr/include/db4.8
ln -s /usr/local/db4.8/include/* /usr/include ln -s /usr/local/db4.8/lib/* /usr/lib

When running into an atomic.h issue, apply this patch:

sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' db-4.8.30.NC/dbinc/atomic.h