Installing from SCM

From TinyOS Wiki
Revision as of 23:21, 13 December 2009 by RazvanM (talk | contribs) (Step 1: Install the nesc compiler)
Jump to: navigation, search

Step 1: Install the nesc compiler

Using the Stanford repository:

 apt-get install nesc

To get the latest nesc (1.3.1):

Debian/Ubuntu (32-bit):

wget http://cs.jhu.edu/~razvanm/wsn/debian/nesc-1.3.1.deb
dpkg -i nesc-1.3.1.deb

Debian/Ubuntu (64-bit):

wget http://cs.jhu.edu/~razvanm/wsn/debian/nesc-1.3.1.deb
dpkg -i nesc-1.3.1.deb

Step 2: Install the crosstools

Debian MSP430:

apt-get install msp430-binutils-tinyos msp430-gcc-tinyos msp430-libc-tinyos

Debian AVR:

apt-get install avr-binutils-tinyos msp430-gcc-tinyos msp430-libc-tinyos

Step 3: Checkout the TinyOS 2.x source tree

cd ~
mkdir -p local/src
cd local/src
cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co -P tinyos-2.x

If you want to use git then instead of the last command you can do:

git clone git://hinrg.cs.jhu.edu/git/tinyos-2.x.git

Step 4: Compile the TinyOS tools

 cd tinyos-2.x/tools
 ./Bootstrap
 ./configure --prefix=$HOME/local
 make all
 make install

A few ENTERs will be required by the last two commands.

Step 4: Set the environment variables

Add the following to .profile (or .bash_profile or .bashrc depending on your system):

export PATH=$HOME/local/bin:$PATH
export TOSROOT=$HOME/local/src/tinyos-2.x
export TOSDIR=$TOSROOT/tos
export MAKERULES=$TOSROOT/support/make/Makerules
export CLASSPATH=$TOSROOT/support/sdk/java/tinyos.jar:.
export PYTHONPATH=.:$TOSROOT/support/sdk/python:$PYTHONPATH
export PATH=$HOME/local/src/tinyos-2.x/support/sdk/c:$PATH