CSCI 112 software installation instructions

There are three options for implementing your 112 assignments:
  1. Use tiglon.ecst.csuchico.edu (Sun) or jaguar.ecst.csuchico.edu (Linux)  (connect from home via modem/DSL) using the program putty
  2. Use a linux computer at home
  3. Install the UNIX emulator Cygwin on your windows machine at home
The projects in this class will be written in C++.  There is an excellent C++ compiler called g++ available for free from GNU.  Your programs will be tested using the GNU compiler.  If you develop using a different compiler (e.g. Visual C++, Borland C++, etc.) your programs may not pass my testing.

You will need the following software:
  1. GNU's C++ compiler, called g++ (version 3.4 or higher)
  2. make (a utility for managing the compilation of programs)
  3. gdb (GNU's debugger for g++) and ddd (GNU's graphical debugger)
  4. an editor (nano and vim are the popular choices, scite is also a good option)
  5. scp or sftp so that you can turn in your programs
All of these are on the department Sun & Linux computers, and all are available for cygwin.

The rest of this file explains how to install cygwin UNIX emulator on your home computer.


Cygwin Installation (do this if you want to use windows)

If you choose to use windows, you will need to download the cygwin UNIX emulator.  Cygwin allows you to open UNIX-like windows on your PC running XP, ME, 2000, NT.  It will allow you to write your entire program on your computer and then copy it to the department machines for final testing and to turn it in.

Here are the steps for installing Cygwin on your windows machine

  1. Using windows explorer reate a directory c:\cygwin
  2. Go to http://www.cygwin.com and download setup.exe to c:\cygwin
  3. Run c:\cygwin.exe 
  4. Choose "Installation from Internet"
  5. press <next> button
  6. Type "c:\cygwin" as the root directory
  7. Leave the "all Users" and "Unix/binary" buttons checked
  8. press <next> button
  9. Use c:\cygwin as the package directory (this should be the default)
  10. press <next button>
  11. Leave the "Direct Connection" button checked
  12. press <next> button
  13. select a web-site to download from.  Usually mirrors.xmission.com works for me... but not always.
  14. press <next> button and wait
  15. You should now see a menu of items to select for download.  When you click on a "+" it opens the sub-directory.  
    1. from the Devel menu select
      1. ddd
      2. gcc
      3. g++
      4. gdb
      5. make
    2. from the editors menu select
      1. gvim
      2. nano
    3. from the Utils menu select
      1. cygutils
    4. from the Net menu select
      1. openssh
  16. press the next button and wait for all of cygwin to install
  17. I suggest you leave the "create icon on desktop" and "add icon to start menu" boxes checked and press finish.
  18. Using window's explorer, create a directory that Cygwin can use as your home directory.  I use C:\tyson
  19. Using window's notepad create a file named "profile" in the directory C:\cygwin\etc put in the following text but use the home directory and username you chose.  Make sure you see the "." after the PATH=  :
export PATH=.:/cygdrive/c/cygwin/bin:$PATH
export USER=tyson
export HOME=/cygdrive/c/tyson
cd $HOME

Now you are ready to use Cygwin.  If the following tasks work, you probably have Cygwin installed correctly:

  1. Open a Cygwin window by clicking on the Cygwin icon.  It should be a window with a black background and the prompt should be "bash-3.00$ "
  2. Type <pwd> return.  You should see the directory you specified as your HOME directory in the profile file.  If not, there is a problem with your profile file.
  3. Download a test C++ file from my website.  Replace the tyson@jaguar with your username @jaguar
    1. sftp tyson@jaguar.ecst.csuchico.edu
    2. answer yes to the security question
    3. enter your ecst password
    4. the prompt "sftp> " should be on the screen
    5. type the following EXACTLY:  /var/www/tyson/112/src/cygwin/hello.cpp
    6. type quit
  4. Now check to see if hello.cpp was downloaded to your current directory using the ls command:  $ ls
  5. If it is there you can compile and run it:
    1. $ g++ hello.cpp
    2. $ a.exe
  6. If you see "Hello world" on the screen your install is correct.