I use cygwin quite a bit when I need to emulate Linux functionality in a windows environment. We've managed to get the OMG code bundle compiled and running in a cygwin environment also (with help from Mark Paton at IVS3D). Here's a little "how-to" to help you get up and running with cygwin.
- There is a set of "must-have" packages when installing cygwin for OMG purposes, I've taken the liberty of making a small .zip file with these packages to save you the trouble of finding out which packages are necessary by trial and error. The packages are available here, download the file and unzip it somewhere handy. I usually make a c:\installs\ directory and then put all installation files in there. This directory contains the files to be installed and is distinctly different from the folder in which you'll install cygwin.
- Go to www.cygwin.com, download setup executable and run it (or get the latest version that I've used here).
- When running the setup program, it will prompt for an "internet installation" or a "local installation". Choose "local installation". If you want to do an internet installation, follow the instructions here.
- Once packages have been selected and downloaded (or you're installing from a local directory), select the cygwin installation directory (default is C:\cygwin). The defaults work fine at this point.
- If installing from a local directory, browse for the downloaded packages files directory at this next step, you'll need to point it to the folder where you unzipped the packages and NOT the "release" directory within the unzipped package folder.
- Select ALL packages for installation at the next step, you can do this by clicking on the word "Default" at the top of the list until it reads "Install".
- The installation will take a few minutes so go grab a coffee.
If you decide to do an internet installation, you'll need to select several packages. If you want to run swathed/jview and other OMG command line programs, choose the following packages:
If you want to compile OMG software, you'll need the following in addition to above:
- gcc for c/c++ compilation (under development section)
- OpenGL (under graphics section)
- libglitz-glx1 (under X11 section)
- glitz (under X11 section)
Other handy packages:
Setting up OMG working environment
Double-click the cygwin icon on the desktop (or hunt for it in the start menu). This will fire up a dos prompt in which cygwin will be started. The first time you run it, it will create a home directory for you in C:\cygwin\home\username. If you have a space in your username, you'll have a tough time getting OMG code to compile. The default installation of cygwin will run with a bash shell but most of us work in a tcsh environment in OMG. If you want to use tcsh, you'll need to do the following stuff.
- Open up a file browser and navigate to c:\cygwin. Open the cygwin.bat file in notepad for a bit of editing (only differences are in the last line, change bash to tcsh):
- Close notepad, make sure to save changes.
- Copy over this .cshrc file into your new cygwin home directory. Depending on what type of browser you're using, the .cshrc file might have a strangely different name once downloaded. You'll need to rename it to .cshrc in order for it to work.
- Start cygwin from the programs menu in the start menu.
Getting an X environment working
- Start cygwin if it isn't started already.
- Copy /etc/X11/xinit/xinitrc to ~/.xinitrc by typing the following command:
cp /etc/X11/xinit/xinitrc ~/.xinitrc
- If you're a sucker for tcsh, then edit ~/.xinitrc, and change the last line to run an xterm with a tcsh shell instead of the default bash shell:
exec xterm -e /usr/bin/tcsh -l
- Now type "startx" to get an X server running. Windoze may warn you about firewalls, etc...you'll need to allow X to have access in order for it to work. You should be able to run jview, swathed, etc, in the newly opened shell.
Setting up the OMG programming environment
- Download the latest code bundle from our software portal. The password is only available to members and sponsors of the OMG.
- Copy over the code bundle into your new cygwin home directory and unpack it:
tar -zxvf code_20080521.tgz
- Make your way to the code directory and execute the following command:
This script will make a "local" directory in your home directory and put everything that it compiles into there. It will
warn you to add the local directory to your path and setting a few environment variables, you can ignore this if you used the .cshrc file provided in the "how-to" as they are set for you already.
- Type "rehash" to refresh your path with all the new programs.
- do_backup: this script backs up a local directory into another directory, most likely a network drive or USB disk. The script only backs up files whose size change (so that you don't copy over files that have been backed up already). You can have the script repeat the backup after waiting a specified number of seconds. This is particularly useful for backing up data during acquisition.
Uninstall of cygwin
- You can delete the install directory, usually C:\cygwin if you followed the defaults during the installation. This will delete your home directory as well.
- If you REALLY want to clean up after cygwin, you can remove a few cygwin related entries in the registry using regedit4. Look for the following registry entries and remove them.
Last updated by J. Beaudoin, May 29, 2008