Cygwin Installation Guide

For Tekkotsu Development

Cygwin is only required for Windows-based development. It provides a UNIX-style style environment to give windows users access to a variety of tools available on unix-based platforms, such as gcc.

If you are using a Mac OS X or Linux based system, you do not need to install Cygwin because your system already supports these tools.

Before you begin, make sure you wouldn't rather set up some kind of virtual machine environment, with a "real" linux installation (or just switch to running Linux or OS X directly). Cygwin is an impressive project, but it's still far from the features, ease of use, compatability or performance of running on an actual Unix-based system.

In particular, although Cygwin supports cross-compilation for running onboard robots like the Aibo, it does not support Tekkotsu execution on the local host, which is a valuable tool for simulation and debugging. Details of the problem are listed below.

If you still wish to continue with Cygwin:

  1. Download setup.exe from
  2. Run setup.exe, stepping through the screens of the installer:
    1. [Title screen]
    2. Choose "Install from Internet"
    3. Defaults are recommended (install to "C:\cygwin")
    4. Choose a location for temporary package installation files
    5. Choose your internet connection (probably best to leave it with the default "Direct Connection" unless you know better)
    6. Choose a mirror ( near the bottom works well for us)
    7. Select custom packages, make sure the following are selected:
      • make, gcc-g++, flex from the "Devel" section
      • rsync from the "Net" section
      • util-linux from the "Text" section
      In addition, these are highly recommended:
      • cvs, patchutils from "Devel"
      • openssh from "Net"
      ...feel free to choose additional packages you would like to have!
  3. Stick the setup.exe into the cygwin installation directory (C:\cygwin). You can re-run it later to install new packages if you find something missing, or update your currently installed ones.
  4. Open a cygwin terminal. (the installer probably put an icon on your desktop)
    1. Type 'echo $PATH'
    2. Take a look at the output -- this is the list of directories which will be searched for executables, and they will be searched in the order listed. If it looks like the WINDOWS/system32 directory will override /usr/bin (i.e. it comes earlier in the list), you will need to fix that.
      • Fix #1: If /etc/profile is missing, copy it from /etc/defaults/etc/profile
      • Fix #2: Edit/create either /etc/profile or .bash_profile in your home directory, and add a line:
        export PATH=/usr/bin:$PATH
    3. If you have Java installed and don't see a java-related directory on the PATH, you may need to add it to the PATH. You can double check if this is needed by running 'which javac' -- this will tell you if it can find the java compiler or not.
      • Fix #1: Right click "My Computer", select Properties, then click "Advanced", followed by "Environment Variables", select the Path entry (probably want to do it system-wide, but you could do it for just your own user account) and add the path to the Java bin directory (see below)
      • Fix #2: Add something like the following to either /etc/profile or .bash_profile in your home directory:
        export PATH=/cygdrive/c/Program\ Files/Java/jdk1.5.0_07/bin:$PATH
    4. Type 'echo $CLASSPATH' -- this is the list of directories that Java searches for its objects.
      • If you just get a blank line, that's fine.
      • If you get a series of ';' separated strings, as long as you see '.' among them, that's fine.
      • If you get a non-empty string which does not include an entry for '.', you will need to add it, using either of the previous methods (Window's Environment variables, or a bash profile override).
        ( is the big offender here -- QuickTime apparently "takes over" the classpath setting when you install its Java components, causing other Java tools (like ours) to have issues because the current directory (.) is no longer checked for packages.)
  5. Tekkotsu has a local execution mode which allows you to run your behaviors on your desktop PC, running through pre-recorded log data, or directly interfacing with hardware connected to the machine. However, the Tekkotsu is currently not supported under Cygwin. The primary reason is that Tekkotsu makes use of Inter-Process Communication services, provided by the 'cygserver' background daemon, and cygserver appears to have a bug which causes it to hang, blocking all IPC requests and causing client software to hang as well.

    This is exacerbated by the debugger (GDB) not being able to perform a stack trace or other basic debugging inqueries/operations under cygwin (reported twice: [1] [2]). Otherwise we might have been able to track this down and find a workaround, but as it stands it is practically impossible to find the source of the problem.

    More importantly to the Cygwin user however, is that without a functional debugger, working with the local executable is of limited usefulness, since a primary point of the simulator was to provide a more powerful development environment than embedded systems like the Aibo can provide. Cygwin's lack of that environment makes its use unattractive for you, and thus a low support priority for us.

    To summarize, Cygwin users can cross-compile for external targets just fine, they are just unable to run locally on the development machine. Switching platforms or running a virtual machine with a unix-based OS is recommended.

    If you wish to try for yourself (perhaps take a shot at finding a work around?), install the following packages:
    • gdb, libxml2-devel from "Devel"
    • jpeg, libpng12-devel, zlib from "Libs"
      Don't confuse 'jpeg' with the 'libjpeg62' or 'libjpeg6b' packages -- the latter two won't give you what you need (development header files). No harm in grabbing them all though.
    In addition, you will need to enable the Cygwin server, which provides Inter-Process Communication (IPC) services.
    1. Run /usr/bin/cygserver-config script once initially to create default configuration files and install 'cygserver' as a service in Windows.
    2. Add the string "server" to the CYGWIN environment variable. It is easiest to do this in the main cygwin batch file (/cygwin.bat) by adding: set CYGWIN=server (There are other options which may also be listed, but "server" is all you need for our purposes.)
    3. In /etc/cygserver.conf, set kern.ipc.semmns to at least 512 and kern.ipc.semmsl to 250.
      • Be sure to uncomment each of the lines you edit! By default, each setting in the file is commented out, merely reporting the default value. Remove the '#' at the beginning of the line as well as changing the value.
    4. In order for the cygserver.conf changes to take effect, you must restart the cygserver process. The easiest way to do this is to reboot your machine. Alternatively, close all Cygwin windows, go to Start menu -> Control Panels -> Administrator Tools -> Services, and select "CYGWIN cygserver", and click restart.
    5. For more information, refer to Cygwin's Cygserver Usage page.

  6. Build Aibo toolchain and install OPEN-R SDK.


Last modified: 2007-08-21