Skip to content
appenz edited this page Nov 17, 2010 · 26 revisions

Important Links

Building SNAC from the Source

Building SNAC currently requires a specific version of NOX 0.4 which is also hosted on github here , over time we plan to transition SNAC to be a module that runs on the latest NOX distribution. These instructions are for building on the Debian Lenny release. Additional instructions for building on other Linux distributions follow this section.

To build SNAC check out the source code from github:

$ git clone http://github.com/bigswitch/snac-nox.git
$ cd snac-nox/src/nox
$ git clone http://github.com/bigswitch/snac.git ext

Install the necessary pre-requisite pacakges for SNAC:

$ sudo apt-get install openssl libboost-test1.34.1 libboost-filesystem1.34.1 \
libboost-serialization1.34.1 libxerces-c28 python2.5 python-twisted \
python-simplejson python-mako python-openssl tmpreaper \
python-sphinx libldap2-dev \
libssl-dev libboost-test-dev libboost-filesystem-dev \
libxerces-c2-dev python2.5-dev libsqlite3-dev swig libboost-thread-dev \
autoconf automake autotools-dev libltdl3-dev libtool

Compiling SNAC requires Sun Java. This package is non-free, you may have to add the following to your /etc/apt/sources.list:

deb http://ftp.us.debian.org/debian/ lenny main contrib non-free

Now install Sun Java 1.6:

#apt-get update
#apt-get install sun-java6-jre

Make sure sun java (and not gnu) is the default version, otherwise the Dojo compile will stall. Instructions for making it the default are here .

Install necessary pre-requisite pacakges for SNAC to create the binary distribution:

$ sudo apt-get install dh-make devscripts fakeroot pbuilder \

Now cd back to the top level nox directory and build:

$ cd ../../
$ ./boot.sh --enable-ext
$ dpkg-buildpackage -rfakeroot

The first line is only needed the first time you build.

Note: dpkg-buildpackage will remove all the binaries and build from scrach. It takes time. So if you change some source codes and want to build again, run the following command. It will skip the unnecessary build.

$ fakeroot debian/rules binary

To install SNAC:

$ cd ..
$ dpkg -i *.deb

This should install the following packages:

  • noxcore_0.4.0~beta_i386.deb
  • nox-dbg_0.4.0~beta_i386.deb
  • noxext_0.4.0~beta_i386.deb
  • nox-monitor_0.4.0~beta_i386.deb
  • snacdocs_0.4.0~beta_i386.deb

For the above installation to work, you will also need to have OpenFlow and the openflow-pki packages installed. For more detailed instructions on installing and running SNAC look here .

Building SNAC on Ubuntu 9.10

Building on Ubuntu is mostly the same as building on Debian Lenny but with a few additional steps.

Ubuntu 9.10 defaults to g++/gcc 4.4, which gives compile errors when building SNAC/NOX, so you need to install the 4.3 version:

$ apt-get install g++-4.3

There are some additional dependencies that need to be installed before building:

$ apt-get install libboost1.38-dev autoconf autotools-dev libtool libssl-dev libboost-test-dev libboost-filesystem-dev libxerces-c2-dev python2.5-dev libsqlite3-dev swig libboost-thread-dev

Note that this is mixing 1.34.1 and 1.38 versions of boost components, which doesn’t seem completely kosher but seems to work OK. I couldn’t find a 1.34.1 version of the base dev package. Probably the clean way to do this would be to build/install from a consistent 1.34.1 source distribution of boost.

When building you need to override the CXX and CC environment variables to use the 4.3 versions of the compilers:

$ CXX=g++-4.3 CC=gcc-4.3 dpkg-buildpackage -rfakeroot

Before installing the the SNAC/NOX packages (but after building/installing the openflow packages, openflow-common and openflow-pki) tweak the /usr/sbin/ofp-pki script to use bash: change the first line to be “#! /bin/bash”. This is required because the shell script relies on bash features but /bin/sh links to dash, not bash on Ubuntu.

Clone this wiki locally