CygwinInstallationDetails

Using OMNeT++ on Windows with the Cygwin platform

1. Introduction

CYGNUS Solutions (now part of RedHat Inc.) produces a Unix-like development environment for Microsoft Windows, based around the GNU compiler and binary utilities. Cygwin includes the following packages:

  • Development tools: binutils, bison, byacc, dejagnu, diff, expect, flex, gas, gcc, gdb, itcl, ld, libstdc++, make, patch, tcl, tix, tk, ...

  • User tools: ash, bash, bzip2, diff, fileutils, findutils, gawk, grep, gzip, m4, sed, shellutils, tar, textutils, time, ...

The list is ever growing. The inclusion of bison, flex, tcl and tk make this development environment a good candidate for running OMNeT++ on Windows. Cygwin is released under the GPL license, which means it is free and the source code is available. Further details and downloading instructions may be found on the web at http://www.cygwin.com.

Due to the differences between Windows and Unix, Cygwin has some quirks compared to Unix systems. This document explains how to work around these problems to complete the installation.

2. Installing CYGWIN

Cygwin must be installed before OMNeT++. First you should download setup.exe which is then used to download and install the packages. When you start setup.exe, it offers three possibilities:

  1. install from internet
  2. download from internet
  3. install from local directory

I suggest you first download the packages and then install them from the local directory.

You will need to be logged into the Administrator account before starting the installation. Setup will ask:

  • the root directory. Enter the directory where you want Cygwin to be installed. The installer will create a Unix-like file system in this directory, with the familiar bin/, etc/, home/, lib/, usr/, var/ directories.
  • install for all users/just me. This affects visibility of environment variables and Start Menu icons.
  • default text file type DOS/Unix. If you select DOS, the Cygwin DLL (the layer between the Windows API and the Cygwin programs) will transparently convert text files between CR/LF and LF line terminators for Cygwin programs, allowing these programs to 'see' LF line endings in files that have really CR/LFs on the disk. I recommend you use DOS file type.

When selection packages to install, be sure to include the following ones:

  • gcc-g++
  • make
  • bison
  • flex
  • tcltk
  • xorg-x11-base

The installer will create a `Cygwin bash shell' entry in a folder called `Cygnus Solutions' and also a desktop icon called `Cygwin'.

If you should ever want to uninstall the tools, you may do so via the "Add/Remove Programs" control panel.

Starting Cygwin will pop up a bash shell with all special environment variables set up for you.

Within the bash shell, the installation directory will appear as "/". Your Windows drives will appear as /cygdrive/c/, /cygdrive/d/, etc. (Don't be surprised when you don't see a /cygdrive directory in the file system though!) The cygpath program allows you to convert between Cygwin-style and Windows style directory names.

It is a good idea to create a .bash_profile for each user who will use Cygwin. This should be stored in the user's home directory (i.e. /home/you). For example, an initial .bash_profile may contain:

    export PS1='# '
    alias ls='ls -aF'
    alias ll='ls -l'
    export TCL_LIBRARY=c:/cygwin/usr/share/tcl8.5

TCL_LIBRARY is necessary to allow Tcl/Tk to operate correctly.

An editor will be required during the installation. For Unix diehards, Cygwin contains vi, or you can download emacs.

3. Getting Tcl/Tk to work

The Tcl/Tk libs seemingly don't recognize Cygwin paths. For TCL_LIBRARY, be sure to use a Windows-style directory name, e.g. use

   TCL_LIBRARY=c:/cygwin11/usr/share/tcl8.5

and not

   TCL_LIBRARY=/usr/share/tcl8.5     ;# WRONG!

Another issue is that Cygwin misses X11 headers that are normally required to build programs with Tcl/Tk. If you're getting compilation errors like

   /usr/include/tk.h:77: X11/Xlib.h: No such file or directory 

while building Tkenv, download X11inc.zip from the omnetpp.org download area, and extract it to your /usr/include/X11 directory.

You'll also need BLT, which can be obtained from the omnetpp.org download area.

4. Installing OMNeT++

Open a Cygwin bash shell, then follow the instructions in the InstallingOnUnix page.

5. Comments

Any questions concerning the use of Cygwin should be directed to the Cygwin mail list at gnu-win32@cygnus.com. OMNeT++ specific questions should be directed to the omnetpp mailing list.

If you find any errors in this document please edit the page.

Based on a description from Richard Lyon.

Edit - History - Print - Recent Changes - Search
Page last modified on April 01, 2006, at 10:45 PM