Skip to content

Compiling XGT

obskein edited this page Jun 16, 2021 · 3 revisions

These instructions walk through the process of building XGT and it's dependencies.

NOTE:: This document is being updated. Please check in with us on the discord in the mean time.

Debian script for installation on Ubuntu or other debs can be found here.

Download

Clone the repo:

git clone https://github.com/xgt-network/xgt.git
git clone https://github.com/xgt-network/xgt-ruby.git ../xgt-ruby
cd ../xgt
git checkout master

Setup dependencies

Install dependencies:

Mac dependencies

sudo xcodebuild -license accept
brew doctor
brew update
brew install \
    autoconf \
    automake \
    cmake \
    git \
    boost160 \
    libtool \
    openssl \
    snappy \
    zlib \
    bzip2 \
    ruby-dev \
    ccache \
    python3
pip3 install --user jinja2

Ubuntu dependencies

sudo apt-get install -y \
     autoconf \
     automake \
     cmake \
     g++ \
     git \
     libbz2-dev \
     libsnappy-dev \
     libssl-dev \
     libtool \
     make \
     pkg-config \
     python3 \
     python3-jinja2 \
     scrypt \
     dnsutils \
     ccache \
     libboost-all-dev \
     build-essential \
     curl \
     zlib1g-dev \
     libreadline-dev \
     libyaml-dev \
     libxml2-dev \
     libxslt-dev

Configure and build

Then you can use rake commands to configure and build.

# Set paths to libraries for building (OS X only)
brewroot() {
  ruby -e "puts Dir.glob( %(#{ %x(brew --prefix).chomp }/Cellar/$1/*) ).first"
}
export BOOST_ROOT=$(brewroot boost@1.60)
export OPENSSL_ROOT_DIR=$(brewroot openssl@1.1)
export SNAPPY_ROOT_DIR=$(brewroot snappy)
export ZLIB_ROOT_DIR=$(brewroot zlib)
export BZIP2_ROOT_DIR=$(brewroot bzip2)
# Then, verify
echo $BOOST_ROOT
echo $OPENSSL_ROOT_DIR
echo $SNAPPY_ROOT_DIR
echo $ZLIB_ROOT_DIR
echo $BZIP2_ROOT_DIR

rake configure
THREAD_COUNT=2 rake make

Run XGT

Finally, to run:

rake run

Clone this wiki locally