Installing Ada on your own Windows PC

We offer this set of clues on how to obtain and set up an Ada programming environment on your own machine comparable to that in the teaching lab.

The Short Version

Install GNAT, JEWL and AdaGIDE.

The Long Version

The Ada programming environment in the Level1 lab has four components:

These may be downloaded to a USB pen drive in the lab.

Of the four, the GNAT Ada95 compiler should be installed first.

Installing the GNAT Ada95 Compiler

Run the downloaded GNAT Ada95 installation program gnat-3.15p-nt.exe. Work your way through the installation wizard, clicking appropriate buttons.

You will be asked for a "Destination Folder". You can choose wherever you like (but make a note of it). However, I suggest (and will assume for the purposes of the remainder of this guide) that, where you are given the choice, components are placed within a folder "C:\local\".

The GNAT installer's default Destination Folder is "C:\GNAT". Click on "Browse..." and change "C:\GNAT" to "C:\local\GNAT". Click "Yes" if asked. Proceed through the wizard, clicking "Next".

Lots of files are then copied across into your Destination Folder. Eventually, click "Finish".

You have now installed the Ada compiler.

Installation will probably have updated your PATH environment variable to include the location of the compiler executable. (In our case the PATH would have C:\local\GNAT\bin prepended to it.) So long as you are planning to use Ada through the AdaGIDE interface, you should not need to worry about your PATH variable. We mention it as it can be worth knowing about should anything go wrong.

Installing GNAT Windows Programming Support

You will not need to use the Windows Programming Support directly in Level1, but the bindings are used by some parts of the JEWL library. Launch the downloaded installer gnatwin-3.15p.exe. The installer omits to ask for a Destination Folder and, in the absence of choice, uses C:\GNAT. Your PATH variable is automatically modified to incorporate this.

Installing AdaGIDE

Launch the downloaded AdaGIDE installer adagide-install.exe and work your way through the wizard. You will be asked regarding "Destination Directory": click "Change..." and replace "C:\Program Files\adagide" with "C:\local\adagide".

As you progress through the wizard, select "Typical" for the type of Setup. Continue through the wizard. Wait patiently while various things happen; eventually, click "Finish".

Installing the JEWL Library

Unpack the contents of the downloaded jewl-16.zip into "C:\local\jewl-16".

  • Launch AdaGIDE: For example, Start/Programs/adagide
  • Within AdaGIDE: File/Open... and select the file "C:\local\jewl-16\source\jewl-io.adb"
  • Within AdaGIDE: From the "Compile" menu, select "Build"

This builds the binaries for the JEWL library (it may take a while). And should incidentally convince you that your Ada programming environment is working.

If you open up one of the JEWL example programs in "C:\local\jewl-16\examples\", and try to build it, you'll find it fails. You need to tell the system where to find the JEWL library you've just built. There are two ways of doing this:

  1. Set two (Windows) environment variables, or
  2. Tell AdaGIDE.

Either way will work. If you know about setting environment variables then that is the best solution because it is a one-off change. In Windows 95/98 you would edit your autoexec.bat to include the two lines:


set ADA_INCLUDE_PATH=C:\local\jewl-16\source
set ADA_OBJECTS_PATH=C:\local\jewl-16\source

... and reboot.

In Windows NT you'd right-click "My Computer", thence Properties/Environment, and set the ADA_INCLUDE_PATH and ADA_OBJECTS_PATH variables appropriately. You will need to exit AdaGIDE and relaunch it to pick up the new settings.

Variables are set in Windows 2000 and XP in a similar way, but within "My Computer"/Properties/Advanced/"Environment Variables".

Alternatively, you can directly tell AdaGIDE where to look for libraries. Within AdaGIDE, open up: Tools/"Project settings in current directory...". In the "Compiler" pane, type the GNAT command line option "-IC:\local\jewl-16\source" (without the quotes).

Note however that this command line setting only applies to compilations made in the folder in which you are working at the time the setting is made (a settings file is written into it). For any one folder the setting sticks but if you start working in a new folder you'll need to explicitly set it for that new folder.

Corrections

Please let us know of any untruths, omissions or misleadings in the above so that we can correct them as soon as possible.

Paul Philbrow
pp@dcs.gla.ac.uk
10th, 13th, 25th October 2005


Comments to: teachadmin - email: teachadmin@dcs.gla.ac.uk
[Home] [Research] [Courses] [Contacts] [Search]
Department of Computing Science 17 Lilybank Gardens, Glasgow G12 8RZ
Tel: +(0)141 330 4256, Fax: +(0)141 330 4913