Skip to content
Gav Wood edited this page Jun 30, 2014 · 75 revisions

Below are the build instructions for the latest versions of Ubuntu. Older versions or Ubuntu-based distributions like Linux Mint should work very similarly, but they may need updated buildtools.

Note: The best supported platform as of June 2014 is Ubuntu 14.04. Documentation for older versions may be patchy and you are encouraged to update this guide with improvements according to your experiences.

##Dependencies from repositories

Before you begin, update your repositories:

sudo apt-get update && sudo apt-get upgrade

Install the package dependencies. This is slightly different between Ubuntu versions.

Trusty 14.04

For the essentials; you need only this if you're only wanting the LLL & Serpent tools:

sudo apt-get install build-essential g++-4.8 git cmake libboost-all-dev

For the main Ethereum library and GUI clients:

sudo apt-get install automake unzip libgmp-dev libtool libleveldb-dev yasm libminiupnpc-dev libreadline-dev scons

For the NCurses-based GUI:

sudo apt-get install libncurses5-dev 

For the Qt-based GUIs:

sudo apt-get install qtbase5-dev qt5-default qtdeclarative5-dev libqt5webkit5-dev

To enable the remote-JavaScript API:

sudo apt-get install libcurl4-openssl-dev

For convenience, here's all the above compacted into a single command:

sudo apt-get install build-essential g++-4.8 git cmake libgmp-dev \
libboost-all-dev automake unzip libtool libleveldb-dev yasm libminiupnpc-dev \
libreadline-dev scons libncurses5-dev qtbase5-dev qt5-default qtdeclarative5-dev \
libqt5webkit5-dev libcurl4-openssl-dev

Wheezy 13.04 and Saucy 13.10

Install Repos

sudo apt-get install build-essential g++-4.8 git cmake libboost1.53-all-dev # for build
sudo apt-get install libncurses5-dev automake libtool unzip libgmp-dev libleveldb-dev yasm libminiupnpc-dev libreadline-dev scons # for ethereum
sudo apt-get install libcurl4-openssl-dev # for json-rpc serving client

Web Install QT 5.2

QT is for the GUI. It's not needed for the headless build. You can download it from their website instead of using wget. And follow along from chmod +x. If the version listed here is outdated the url may be empty.

wget http://download.qt-project.org/official_releases/online_installers/qt-opensource-linux-x64-1.6.0-3-online.run
chmod +x qt-opensource-linux-x64-1.6.0-3-online.run
./qt-opensource-linux-x64-1.6.0-3-online.run

You can install just 5.2.1 with GNU 64-bit support.

Precise 12.04

incomplete For this release we need some backports. see http://www.swiftsoftwaregroup.com/upgrade-gcc-4-7-ubuntu-12-04/ for GCC 4.7, which is required.

sudo apt-add-repository ppa:ubuntu-sdk-team/ppa && sudo apt-add-repository ppa:apokluda/boost1.53
wget http://launchpadlibrarian.net/148520969/libleveldb-dev_1.13.0-1_amd64.deb && wget http://launchpadlibrarian.net/148520968/libleveldb1_1.13.0-1_amd64.deb && sudo dpkg -i libleveldb*1.13.0-1*deb

Cryptopp 5.6.2 install from source

NOT NEEDED IF YOU JUST WANT SERPENT/LLL TOOLS

You'll need to grab, build, and install the latest Crypto++ library. Note that even on Ubuntu 14.04, ubuntu package for libcrypto++-dev has Crypto++ v5.6.1 only. You definitely need 5.6.2.

Install cryptopp from https://github.com/mmoss/cryptopp and build it with SCons:

git clone https://github.com/mmoss/cryptopp.git
cd cryptopp
sudo scons --shared --prefix=/usr
cd ..

JSONRPC build from source

NOT NEEDED IF YOU JUST WANT SERPENT/LLL TOOLS

To enable the remote-JavaScript API functionality, you must have the JSON-RPC library installed:

git clone git://github.com/cinemast/libjson-rpc-cpp.git
cd libjson-rpc-cpp/build
cmake .. && make
sudo make install
sudo ldconfig
cd ..

To test this is working after you lunched eth, check the coinbase with cURL:

curl -X POST --data '{"jsonrpc": "2.0","method": "coinbase","params": null,"id": 1}' http://localhost:8080

Unit tests support

NOT NEEDED IF YOU JUST WANT SERPENT/LLL TOOLS

To enable support for the common Ethereum unit tests (CEUT), clone the tests repository into the same path as cpp-ethereum and checkout the develop branch:

git clone https://github.com/ethereum/tests
cd tests
git checkout develop
cd ..

Sorting the source

First grab/unpack the sources. If you want to build the latest version, clone the repository:

git clone https://github.com/ethereum/cpp-ethereum
cd cpp-ethereum
git checkout develop

If you have a prepackaged source distribution from code.ethereum.org, then simply unpack:

tar xjf cpp-ethereum-<version>.tar.bz2
cd cpp-ethereum-<version>

Building Serpent/LLL tools

IF YOU JUST WANT SERPENT/LLL TOOLS:

Create and configure the build environment and the build inside the cpp-ethereum directory:

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DLANGUAGES=1 && make

Building the client

If you want to build the full client, first create the build directory:

mkdir build
cd build

Then run cmake and make:

cmake .. -DCMAKE_BUILD_TYPE=Release && make

If you're not interested in the GUI parts of Ethereum, then you can compile the command line interface (CLI) client with a headless build:

cmake .. -DCMAKE_BUILD_TYPE=Release -DHEADLESS=1 && make

If you do a headless build, there's no need to install the Qt dependencies mentioned earlier.

If later, you change your mind and you want to build the full version with the GUI, use:

cmake .. -DCMAKE_BUILD_TYPE=Release && make

To build a debug build, exchange Release for Debug:

cmake .. -DCMAKE_BUILD_TYPE=Debug && make

VM tracing (useful for cross-implementation VM debugging) and additional run-time checks can be enabled with the VMTRACE and PARANOIA flags:

cmake .. -DCMAKE_BUILD_TYPE=Debug -DVMTRACE=1 -DPARANOIA=1 && make

Start

Command line interface client (see Using Ethereum CLI Client):

cd eth
./eth

Once done, you might then Configure a Server and start a Local Test Net.

Start AlethZero to run the experimental Ethereum GUI client (also see Using AlethZero).

cd alethzero
alethzero

If you're updating from a previous version and you find you get errors when running, delete your old block chain before restarting:

rm -rf ~/.ethereum
Clone this wiki locally