Linux How-To
Below are the steps that worked in February, 2011 with RHEL Linux and Java 1.6.
See
Ptolemy II PtinyOS Domain Installation Notes for details.
- Download the devel via svn and build. See
http://chess.eecs.berkeley.edu/ptexternal:
svn co https://source.eecs.berkeley.edu/svn/chess/ptII/trunk ptII
cd ptII
export PTII=`pwd`
./configure
make
- Set up ptinyos1.x:
cd $PTII
mkdir -p vendors/ptinyos
cd $PTII/vendors/ptinyos
wget http://ptolemy.berkeley.edu/viptos/viptos1.0/tinyos-1.x-2007-01-17.tar.gz
tar -zxf tinyos-1.x-2007-01-17.tar.gz
- Download nesc 1.2.8 from http://sourceforge.net/projects/nescc/files/nescc/v1.2.8/. We use nesc-1.2.8 to avoid
/usr/include/pthread.h:502: requested alignment is not a constant
, see
http://bugs.gentoo.org/145870.
cd $PTII/vendors/ptinyos
wget "http://downloads.sourceforge.net/project/nescc/nescc/v1.2.8/nesc-1.2.8a.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fnescc%2Ffiles%2Fnescc%2Fv1.2.8%2F&ts=1298084236&use_mirror=superb-sea2"
tar -zxf nesc-1.2.8a.tar.gz
cd nesc-1.2.8
./configure
make
sudo make install
Set up the environment variables
-
export TOSROOT=$PTII/vendors/ptinyos/tinyos-1.x
export TOSDIR=$TOSROOT/tos
export PTINYOS_MOMLROOT=$PTII/vendors/ptinyos/moml
- Reconfigure:
cd $PTII
./configure
- Configure and install the TinyOS 1.x nesC tools.
cd $TOSROOT/tools/src/ncc
./Bootstrap
./configure
make
sudo make install
- See if you have installed TinyOS 1.x and nesC correctly
cd $TOSROOT/apps/Blink
make pc
./build/pc/main.exe 1
- Unzip the pre-generated libraries and applications
cd $PTII/vendors/ptinyos
cat $PTII/ptolemy/domains/ptinyos/util/nc2moml/nc2moml-tinyos-1.1.15Dec2005cvs-1.tar.gz | gunzip | tar -xvf -
cd $PTII/vendors/ptinyos
cat $PTII/ptolemy/domains/ptinyos/util/ncapp2moml/ncapp2moml-tinyos-1.1.15Dec2005cvs-1.tar.gz | gunzip | tar -xvf -
- Run the demo, check standard output for errors. The LEDs in the icon should blink
$PTII/bin/viptos $PTII/ptolemy/domains/ptinyos/demo/SenseToLeds/SenseToLeds-InWireless.xml