Difference between revisions of "Installing from SCM"

From TinyOS Wiki
Jump to: navigation, search
Line 6: Line 6:
 
   
 
   
  
== Step 0: Enable the tinyos tools repository ==
+
== Enable the tinyos tools repository ==
  
 
Stanford hosts the primary Debian/Ubuntu tools repository.  HINRG at Johns Hopkins University hosts a backup tools repository.
 
Stanford hosts the primary Debian/Ubuntu tools repository.  HINRG at Johns Hopkins University hosts a backup tools repository.
Line 24: Line 24:
  
  
== Step 1: Install the nesc compiler ==
+
== Install the nesc compiler ==
  
 
  sudo apt-get install nesc
 
  sudo apt-get install nesc
Line 34: Line 34:
 
The John Hopkins repository contains the 1.3.0 which has a required dependency on sun-java5-jdk/sun-java6-jdk. If you are using a newer version of Ubuntu or Debian that doesn't provide this, you can install the nesc 1.3.1:
 
The John Hopkins repository contains the 1.3.0 which has a required dependency on sun-java5-jdk/sun-java6-jdk. If you are using a newer version of Ubuntu or Debian that doesn't provide this, you can install the nesc 1.3.1:
  
== Step 2: Install the crosstools ==
+
== Install the crosstools ==
  
 
Debian MSP430:
 
Debian MSP430:
Line 44: Line 44:
 
  sudo apt-get install avr-binutils-tinyos msp430-gcc-tinyos msp430-libc-tinyos
 
  sudo apt-get install avr-binutils-tinyos msp430-gcc-tinyos msp430-libc-tinyos
  
== Step 3: Checkout the TinyOS 2.x source tree ==
+
== Checkout the TinyOS 2.x source tree ==
 
Checkouts from TinyOS SVN repository are read-only.
 
Checkouts from TinyOS SVN repository are read-only.
 
  cd ~
 
  cd ~
Line 55: Line 55:
 
  git clone git://hinrg.cs.jhu.edu/git/tinyos-2.x.svn  tinyos-2.x
 
  git clone git://hinrg.cs.jhu.edu/git/tinyos-2.x.svn  tinyos-2.x
  
== Step 4: Compile the TinyOS tools ==
+
== Compile the TinyOS tools ==
 
   sudo apt-get install automake
 
   sudo apt-get install automake
 
   cd tinyos-2.x/tools
 
   cd tinyos-2.x/tools
Line 65: Line 65:
 
A few ENTERs will be required by the last two commands.
 
A few ENTERs will be required by the last two commands.
  
== Step 5: Set the environment variables ==
+
== Set the environment variables ==
  
 
Add the following to .profile (or .bash_profile or .bashrc depending on your system):
 
Add the following to .profile (or .bash_profile or .bashrc depending on your system):

Revision as of 01:45, 30 July 2011

NOTE: It is highly recommended to remove the system-wide tinyos-tools package when using the TinyOS from CVS/SVN/GIT. Git repositories mirroring the TinyOS CVS repository can be found at:


Enable the tinyos tools repository

Stanford hosts the primary Debian/Ubuntu tools repository. HINRG at Johns Hopkins University hosts a backup tools repository.

The TinyOS Ubuntu pool is the same across all current distributions. So specifing "lucid" works as the distribution specifier.

 sudo echo "deb http://tinyos.stanford.edu/tinyos/dists/ubuntu lucid main" >> /etc/apt/sources.list
 # or sudo apt-add-repository "deb http://tinyos.stanford.edu/tinyos/dists/ubuntu lucid main"


Alternatively:

 sudo echo "deb http://hinrg.cs.jhu.edu/tinyos lucid main" >> /etc/apt/sources.list
 # or sudo apt-add-repository "deb http://hinrg.cs.jhu.edu/tinyos lucid main"


 sudo apt-get update


Install the nesc compiler

sudo apt-get install nesc


Possible contingency

There may be a contigency between the repo, ubuntu version, nesc, and java. If so read on. If everything works then jump to step 2.

The John Hopkins repository contains the 1.3.0 which has a required dependency on sun-java5-jdk/sun-java6-jdk. If you are using a newer version of Ubuntu or Debian that doesn't provide this, you can install the nesc 1.3.1:

Install the crosstools

Debian MSP430:

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

Debian AVR:

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

Checkout the TinyOS 2.x source tree

Checkouts from TinyOS SVN repository are read-only.

cd ~
mkdir -p local/src
cd local/src
svn checkout http://tinyos-main.googlecode.com/svn/trunk/ 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.svn   tinyos-2.x

Compile the TinyOS tools

 sudo apt-get install automake
 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.

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=$TOSROOT/support/sdk/c:$PATH