GPL Software Installation Instructions

You can write the GPL project on windows, linux, or OSX.  If you already use linux, I suggest you use linux.  If you are a windows user, I suggest you use windows.  Ubuntu makes is very easy to install Linux.  Unbuntu can install itself on a windows machine and leave windows in tact.  It will repartition the drive and then install Ubuntu.  Then when you boot the computer you will be asked if you want to book windows or Ubuntu.

IMPORTANT: You must use the GNU compiler.  You cannot use any other compiler (Visual C++, Borland C++, etc).

You will need the following software:
  1. GNU's C++ compiler, called g++ (version 4.1 or higher on Linux, 3.4.4 or higher on Cygwin)
  2. OpenGL (comes with windows)
  3. freeglut (library for OpenGL, >= version 3.8)
  4. bison (compiler compiler, >= version 2.4)
  5. flex (lexigraphical analyzer, >= version 2.5)
  6. make
  7. gdb (GNU's debugger for g++)
  8. an editor (see last section)

Ubuntu Installation 

Using the apt-get software installer, install the following packages:

$ sudo -i
$ apt-get install bison
$ apt-get install flex
$ apt-get install g++
// the following is for the utility makedepend
$ apt-get install xutils-dev
$ apt-get install freeglut3-dev

If when you run glut based applications (such as gpl), if the window frame is not displayed you need to turn off the visual effects:

Select the "Preferences" entry in the "System" menu
Select the "Visual Effects" tab
Select none



OSX installation

I don't have an OSX machine, so the following came from students over the years.  Some/all of it might be out of date

OpenGL and Glut should already be installed.

Some students report that makedepend is already installed.  Some say it isn't.  One student sent me the following link:

                    http://llg.cubic.org/docs/makedepend.zip

Another student said:

makedepend isn't installed by default on all machines.

makedepend is part of Apple's port of the X11 system/library, which  is not installed by default on any machine. Users using OS X 10.4  (Tiger), can install it from the system DVD that shipped with their  machines. Users using OS X 10.3 (Panther), can download it from  Apple's site:

http://www.apple.com/downloads/macosx/apple/x11formacosx.html



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, Vista, and Windows 7.  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 create 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. bison
      2. ddd
      3. flex
      4. gcc
      5. g++
      6. gdb
      7. make
      8. makedepend
    2. from the editors menu select
      1. gvim
      2. nano
    3. from the graphics menu select
      1. freeglut
      2. opengl
    4. from the Utils menu select
      1. cygutils
    5. 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.
Potential Problem

The PATH variable might not include the current directory.  That means if you try to execute a file in the current directory, the shell will not find it:

$ ls
a.exe
$ a.exe
bash: a.exe: command not found
$

If this happens you can execute the command by adding a "./" before it.

$ ./a.exe
the program is running
$

You can modify the PATH variable so it include the current directory.  Search for PATH on this cygwin documentation page to find out how to change it.



Editor

You will also need to install an editor to create and edit files.  I use vim.  It is very fast to use, but takes some time to learn.  It is available on all platforms.

An easy to use editor on Linux is gedit (it is automatically installed with the Gnome based distributions (such as Ubuntu)).  Another easy to use editor is scite ($ sudo apt-get install scite).

For cygwin I recommend using Scite or Notepad++.  If you put a copy of the executable in cygwin's bin directory, then you can use it from the command line.  For example:

    If you download the scite executable:    http://prdownloads.sourceforge.net/scintilla/Sc202.exe

    After you download it, move it to the directory c:/cygwin/usr/bin/scite.exe

    Now in a cygwin window you can use scite like this:

$ scite hello.cpp &

The "&" allows you to keep using the cygwin window to enter commands while the editor window is open.


vim Users

If you are a vim user, a former student (Tim Chaplin) wrote a vim syntax definition for gpl.  Once you install this syntax definition, vim will use syntax highlighting when you edit a file with the ".gpl" extension.

Step 1:  In your home directory create a directory named  .vim  and inside that directory make a directory syntax
Step 2:  Copy gpl.vim into your ~/.vim/syntax directory
Step 3: add the following line to your ~/.vimrc file (if you don't have one, create one)

    au BufRead,BufNewFile *.gpl    set filetype=gpl

Now when you use vim to edit a file with a ".gpl" extension, the code will have syntax highlighting.  Let me know if it does not work.