Sunday, March 1, 2015

How to build cpp-ethereum PoC-8

The instructions at this page:
https://github.com/ethereum/cpp-ethereum/wiki/Building-on-Ubuntu
are excellent, but are missing a few steps.

Before you begin, create a VirtualBox VM with Ubuntu 14.04.1 installed in it.
Before you begin take a snapshot of the VM. Name it: "Before poc-8".

I've shortened the instructions by only describing how to install on 64-bit Ubuntu (the whole process took me more than an hour):

sudo apt-get -y update && sudo apt-get -y dist-upgrade
sudo apt-get -y install language-pack-en-base

sudo dpkg-reconfigure locales
sudo apt-get -y install software-properties-common

wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -

sudo add-apt-repository -y "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.5-binaries main"

sudo add-apt-repository -y ppa:ethereum/ethereum
sudo add-apt-repository -y ppa:ethereum/ethereum-dev

sudo apt-get -y update

got a signature verification error, so "some index files failed to download"

sudo apt-get -y dist-upgrade

sudo apt-get -y install build-essential g++-4.8 git cmake libboost-all-dev automake unzip libgmp-dev libtool libleveldb-dev yasm libminiupnpc-dev libreadline-dev scons libncurses5-dev libcurl4-openssl-dev wget qtbase5-dev qt5-default qtdeclarative5-dev libqt5webkit5-dev libcryptopp-dev libjson-rpc-cpp-dev libmicrohttpd-dev libjsoncpp-dev libargtable2-dev clang-3.5 lldb-3.5

sudo apt-get -y install build-essential g++-4.8 git cmake libboost-all-dev automake unzip libgmp-dev libtool libleveldb-dev yasm libminiupnpc-dev libreadline-dev scons libncurses5-dev libcurl4-openssl-dev wget libjsoncpp-dev libargtable2-dev libcryptopp-dev libjson-rpc-cpp-dev libmicrohttpd-dev clang-3.5 lldb-3.5


Download the latest Qt:

mkdir -p ~/src && cd ~/src

wget http://download.qt-project.org/official_releases/online_installers/qt-opensource-linux-x64-online.run

chmod +x qt-opensource-linux-x64-online.run


For the following command, accept the installation defaults.
(This took more than ten minutes to complete.)

sudo ./qt-opensource-linux-x64-online.run

Add the following to ~/.bashrc (but replace the yellow highlight with the correct folder name):

export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=$QT_BASE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH

export CMAKE_PREFIX_PATH=~/Qt/5.4/gcc_64

Then close and re-open your Terminal window.


Build JSON-RPC library:
mkdir -p ~/src
cd ~/src
git clone https://github.com/cinemast/libjson-rpc-cpp
cd libjson-rpc-cpp && git checkout tags/v0.3.2
mkdir -p build && cd build && cmake .. && make
sudo make install
sudo ldconfig


Get the ethereum cpp source code and build it:
cd ~/src && git clone https://github.com/ethereum/cpp-ethereum
cd cpp-ethereum && mkdir -p build

Execute the following line any time you want switch to another PoC build, just replace the yellow highlight with the appropriate tag ID (call  git tag  to list all IDs):
cd ~/src/cpp-ethereum/build && git checkout poc-8-tag && cmake .. && make -j2

While building neth, I got these errors:
npm ERR! fetch failed https://registry.npmjs.org/win-release/-/win-release-1.0.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz



Take a snapshot of the VM. Name it "cpp-ethereum poc8".


Now you can call "alethzero" to run the GUI, or call "eth" for the command-line.
Read here for the CLI (command-line interface) instructions.

No comments:

Post a Comment