When the installer asks how you want to get the Cygwin files, select the first option. This will download the files you pick and then install them automatically.
Click Next.
Cygwin Notes |
Home Class Info Links |
Lectures Newsgroup Assignments |
This course uses the gcc compiler and, to a lesser extent, the Unix or Linux environment, both for consistency, and to expose you to the platform used by many practitioners in computer science. Unix / Linux and gcc are available automatically on Linux and MacOS X machines, and Windows, using Cygwin. This page is about setting up Cygwin for Windows.
Cygwin is a Linux-like environment for Windows. It can be downloaded for free from http://www.cygwin.com. This is the environment that will be used to demonstrate things in class.
You need Windows XP or Vista. Like MacPorts, Cygwin comes with an installer that lets you get just the tools you need. For this course, you only need the Gnu C++ compiler and some standard tools, like CppUnit, which requires about 150 megabytes.
Cygwin is fairly simple to install. You first download a small installer program. Then you run this installer to download the Cygwin packages you need. The installer takes care of downloading and installing not only the files you ask for, but any files those files require.
The instructions below should get you going. If you'd like more information, see the Cygwin setup notes.
When the installer asks how you want to get the Cygwin files, select the first option. This will download the files you pick and then install them automatically.
Click Next.
When the installer asks where you want to put the Cygwin files on your machine, you can use the default c:\cygwin, or any other place where you have a reasonable amount of space.
You can also specify whether text files should be generated using DOS (Windows) or Unix line terminators. If you're going to use a Cygwin editor like vi or emacs (recommended, since we will be using the emacs editor in lab sessions), leave this as Unix. If you're going to use some Windows editor, select DOS instead.
VISTA USERS: Check the Just Me option, not All Users.
Click Next.
When the installer asks where you want to put Cygwin's temporary files, you can use the default, which will be a directory in your user document and settings directory. These files can be deleted later if you need the space.
Click Next.
When the installer asks what kind of connection you want, just use the default first option.
Click Next.
When the installer asks which site to download from, pick a location near you. I chose Argonne National Laboratory.
Click Next.
Now the installer asks which packages to download. This dialog box is like a Windows Explorer directory tree.
The tools you must have are under Devel, which stands for "Development." If you want to download a unix editor (recommended), it is under Editors.
To see things better, first enlarge the dialog box to full screen.
Click on the plus (+) sign to the left of Devel to view the development packages. Each package has a small icon with arrows in a circle. The default status is Skip, i.e., don't download. To select a package to download, click on the icon once. This selects the current stable release of that package.
Warning: Click just once to select a package. If you click again, you'll cycle through other options. This can cause other subpackages to be automatically selected. The installer does not unselect subpackage when you change the selection. Hence if you click multiple times you may end up downloading unnecessary, even inconsistent, packages. If you select the wrong thing by accident, I recommend cancelling and starting over.
Packages are stored under categories. Here are the ones you need for this course and what category they appear under:
| Category | Package | What is it |
|---|---|---|
| Archive | zip and unzip | Programs to compress and decompress files and directories |
| Devel | cppunit | a package for writing C++ test code |
| Devel | g++ | the Gnu C++ compiler |
| Devel | gdb | the Gnu C++ debugger |
| Devel | make | a standard Unix tool for managing applications with multiple files |
| Editors | (optional) emacs, xemacs, or vim | if you don't want to use Code::Blocks |
Click Next.
The Cygwin installer will now download the requested packages and install them. When it's done, it will ask you if you want to create a desktop icon for the Cygwin command shell, and an entry in the Windows Start menu. I recommend that you at least take the desktop icon.
To start the Cygwin shell, just double-click the desktop icon. This will open a command window, similar to Microsoft's DOS shell, but instead of DOS commands, you have Unix, including the Gnu C++ compiler.
Unix, and therefore Cygwin, starts you off in your "home" directory when you open the shell window. Cygwin by default will create a home directory for you inside the Cygwin directory, which can be a problem if you need to reinstall Cygwin later. Therefore, it's better to define a home directory in a safer place, such as your EECS 211 projects directory.
You do this by defining a Windows environment variable called HOME.
Right-click on your My Computer icon and select Properties from the menu. The System Properties dialog box will appear. Click on the Advanced tab.
Click on Environment Variables.
Click New under User variables.
Type HOME into the Variable name field and whatever directory you are using for EECS 211 code into the Variable value field.
Click OK to save your changes.
Now when you open a Cygwin window, it will put you in the directory you specified in HOME.
Comments?
Contact the Prof!