Installing up to date Cygwin

From TinyOS Wiki
Revision as of 05:45, 10 July 2014 by András Bíró (talk | contribs) (Installing Cygwin)
Jump to: navigation, search

This documentation was written and checked at January 2013, but tinyos will be probably compatible with newer cygwins as well.

Picking the right JDK

You could usually use the newest one, but currently you have to use the x86 version, even on a 64 bit Windows.

Installing Cygwin

Download setup.exe from Cygwin's Official Site and start it. Go through the installation, until the “Select Packages” window. Here, you will need the following extra packages for using tinyos:

  • gcc-core
  • make
  • python (currently, python installs python2. If there is a python2 package, install that)
  • perl
  • rpm

After that, you can install the tinyos rpms. If you’re using Windows Vista, or newer, you should start cygwin as root for tinyos-tools installation. If you forgot it, it doesn’t matter, you can run tos-install-jni later manually to install the missing files.

If you want to install cygwin packages later just run the setup.exe again, and go through the installation until the "Select Packages" window.

Extra packages

There are some useful packages you might want to install:

  • git (to use the tinyos repository directly from cygwin)
  • bash-completion (completes your command if you press tab)
  • mc (midnight commander, great file manager)

To generate the tinyos rpms, you need some more:

  • autoconf
  • automake
  • bison
  • flex
  • libiconv
  • patch
  • util-linux
  • wget
  • rpm-build
  • rsync

There are some more modern compilers you might want to use, but currently they're not needed for tinyos:

  • gcc4
  • mingw-gcc-core
  • mingw64-x86_64-gcc-core
  • mingw64-i686-gcc-core (mingw-w64 originally forked to add 64 bit support to mingw, but they provide 32 bit compilers as well)

TinyOS environment variables

I usually create the file cygwin/etc/profile.d/tinyos.sh with the following contents

export TOSROOT="/opt/tinyos-2.x"
export CLASSPATH="$CLASSPATH;c:\cygwin\opt\tinyos-2.x\support\sdk\java\tinyos.jar;."
export MAKERULES="$TOSROOT/support/make/Makerules"
export TOSDIR="$TOSROOT/tos"

export PATH=:$PATH:`/usr/bin/tos-locate-jre --java`:`/usr/bin/tos-locate-jre --javac`