Post

Compiling stellard on Ubuntu 12.04

There’s nothing quite like showing up to work and reading that Jed McCaleb, the inventor of Ripple, has forked Ripple into a new project. His new project is called Stellar and has received a $3M loan from Stripe to fund development.

The build instructions from the Stellar wiki look pretty straight forward, more or less what’s used for rippled.

My first issue was that libsodium was missing:

1
2
3
4
5
6
7
8
9
bash <<EOF
 wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz && \
 tar xzf LATEST.tar.gz && \
 cd libsodium-0.6.1/ && \
 ./configure && \
 make && \
 make check && \
 sudo make install
EOF

The second problem is that gcc 4.8.1 or later is required and I have 4.6.3.

1
2
3
4
5
6
bash <<EOF
 echo | sudo add-apt-repository ppa:ubuntu-toolchain-r/test
 sudo apt-get update
 sudo apt-get install -y gcc-4.8
 sudo update-alternatives —install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
EOF

Even after installing gcc 4.8 from the toolchain, scons complains that it’s missing. From the Ripple wiki we see that you can forcefully switch to gcc 4.8.

1
sudo update-alternatives —install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 —slave /usr/bin/g++ g++ /usr/bin/g++-4.8

Compiling requires more memory than my AWS instance has, so I also create a swap file:

1
2
3
4
5
6
sudo bash <<EOF
 dd if=/dev/zero of=/swap bs=1024 count=1M
 mkswap /swap
 swapon /swap
 echo “/swap swap swap sw 0 0" >> /etc/fstab
EOF

Now we can build:

1
2
3
4
5
6
7
8
9
10
11
12
bash <<EOF
 echo | sudo add-apt-repository -y ppa:boost-latest/ppa && \
 sudo apt-get update && \
 sudo apt-get -y upgrade && \
 sudo apt-get -y install git scons ctags pkg-config protobuf-compiler libprotobuf-dev libssl-dev python-software-properties libboost1.55-all-dev nodejs && \
 git clone https://github.com/stellar/stellard.git && \
 cd stellard/ && \
 git checkout master && \
 sudo update-alternatives —install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 —slave /usr/bin/g++ g++ /usr/bin/g++-4.8 &&
 scons
EOF

stellard is now inside the build folder. Compilation took several hours on my EC2 instance.

This post is licensed under CC BY 4.0 by the author.