Setting Up

This page explains the steps necessary to do a fresh setup of Cloud9 on your machine. For your convenience, these steps have been also put together in a setup automation script, courtesy of Andrei Costin.

Installing depot_tools

Cloud9 is made out of components that reside in different repositories, either under DSLab administration, or outside on the Internet. The repositories are put together with the help of an utility called depot_tools, originally developed for Google's Chromium project.
  1. Check out the depot_tools code somewhere on your machine (for instance, in your home directory):
    $ svn co http://src.chromium.org/svn/trunk/tools/depot_tools
  2. Add depot_tools to your path:
    $ export PATH="$PATH":$(pwd)/depot_tools
    (You may want to make this permanent by adding it to your Bash profile script)

Installing Prerequisite Packages

Cloud9 works on 64-bit Linux distributions only. It has been tested on Ubuntu 10.04, 10.10, and 11.10, and it should work with other distros as well.

Install the required Ubuntu development packages:
$ sudo apt-get install dejagnu flex bison protobuf-compiler libprotobuf-dev \
  libboost-thread-dev libboost-system-dev build-essential libcrypto++-dev

Install Google's glog library:
$ wget https://google-glog.googlecode.com/files/glog-0.3.3.tar.gz
$ tar -xzvf glog-0.3.3.tar.gz && cd glog-0.3.3/
$ ./configure
$ make -j3
$ sudo make install
$ sudo ldconfig

The last command is necessary to force the linker cache to pick up the new library addition.

Checking out Cloud9

Create a fresh directory for the Cloud9 installation. We call this directory $CLOUD9_ROOT. In your terminal, execute the following:
$ cd $CLOUD9_ROOT
$ gclient config --name src git+https://github.com/dslab-epfl/cloud9-depot.git
$ gclient sync

The gclient config command generates in the current directory a .gclient file describing the managed repository:
solutions = [
  {
    "name" : "src",

    "url" : "https://github.com/dslab-epfl/cloud9-depot.git",
    "deps_file" : "DEPS",
    "managed" : True,
    "custom_deps" : {
    },
    "safesync_url": "",
  },
]

The gclient sync command takes a lot of time. It checks out the entire Cloud9 code, and executes several one-time hooks:
  • Download & build LLVM and Clang.
  • Download & build a custom version of Binutils
  • Generate project Makefiles for a subset of components.
The Cloud9 code structure is documented here.

Building Cloud9

Cloud9 uses Chromium's gyp for building its internal LLVM bitcode targets, and some other components. We are in the process of converting the entire Cloud9 codebase to gyp. Before that happens, you still need to perform manually the following building steps:
  1. Build Klee's uClibc:
    $ cd $CLOUD9_ROOT/src/klee-uclibc
    $ make -j3

  2. Build STP:
    $ cd $CLOUD9_ROOT/src/third_party/stp
    $ ./scripts/configure --with-prefix=$(pwd)
    $ make -j3

  3. Build Cloud9 itself:
    $ cd $CLOUD9_ROOT/src
    $ make -j3
    $ cd $CLOUD9_ROOT/src/cloud9
    $ ./configure \

        --with-llvmsrc=../third_party/llvm \
        --with-llvmobj=../third_party/llvm-build \
        --with-uclibc=../klee-uclibc \
        --enable-posix-runtime \
        --with-stp=../third_party/stp
    $ make -j3
NOTE 1: If you get a linking error related to missing Google glog symbols, make sure that you don't have installed the Gold version of the system's Binutils (remove them using sudo apt-get remove binutils-gold).
NOTE 2: Due to a bug in the build system, you may get missing header errors in the klee/data subdirectory. If this is the case, run first make -C lib/Data, and then build the rest of Cloud9.

Troubleshooting

Clang / Binutils are in an inconsistent state and need to be re-installed

  1. Remove some or all the generated files:
    src/thrid_party/.downloads
    src/third_party/binutils
    src/third_party/binutils-install
    src/third_party/llvm
    src/third_party/llvm-install
  2. Re-run gclient sync. This will force the build system to re-download the missing files, and build all necessary files.
ċ
build_install_cloud9.sh
(6k)
Stefan Bucur,
Nov 4, 2012, 8:14 AM
Comments