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:
- GNU's C++ compiler, called g++ (version 4.1 or higher on Linux, 3.4.4 or higher on Cygwin)
- OpenGL (comes with windows)
- freeglut (library for OpenGL, >= version 3.8)
- bison (compiler compiler, >= version 2.4)
- flex (lexigraphical analyzer, >= version 2.5)
- make
- gdb (GNU's debugger for g++)
- 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
- Using windows explorer create a directory c:\cygwin
- Go to http://www.cygwin.com
and download setup.exe to c:\cygwin
- Run c:\cygwin.exe
- Choose "Installation from Internet"
- press <next> button
- Type "c:\cygwin" as the root directory
- Leave the "all Users" and "Unix/binary" buttons checked
- press <next> button
- Use c:\cygwin as the package directory (this should be the
default)
- press <next button>
- Leave the "Direct Connection" button checked
- press <next> button
- select a web-site to download from. Usually
mirrors.xmission.com works for me... but not always.
- press <next> button and wait
- You should now see a menu of items to select for download.
When you click on a "+" it opens the sub-directory.
- from the Devel menu select
- bison
- ddd
- flex
- gcc
- g++
- gdb
- make
- makedepend
- from the editors menu select
- gvim
- nano
- from the graphics menu select
- freeglut
- opengl
- from the Utils menu select
- cygutils
- from the Net menu select
- openssh
- press the next button and wait for all of cygwin to install
- 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.