ColdFrame: Installation



Installation under Linux

You need

The following installation notes match what's provided in the supplied Makefile-unix. If you install software elsewhere, you'll need to adjust the Makefile (it has hooks for you to use environment or command line variables).

[incr Tcl]

This one is a bit puzzling. I'd thought that you needed to build [incr Tcl] over your Tcl/Tk installation, but it seems that recent releases of Tcl/Tk have included [incr Tcl] in the baseline.

TclXML

May already be part of your Tcl distribution.

The archive should contain path information, so unpack it at /usr/local/lib. The Makefile assumes /usr/local/lib/tclxml-2.1theta.

Saxon

The archive doesn't contain path information. A possible installation route (for Saxon 6.5.1) is

   # cd /usr/local/lib
   # mkdir saxon-6.5.1
   # ln -sf saxon-6.5.1 saxon
   # cd saxon
   # unzip /your/download/directory/saxon6_5_1.zip

GNAT

The supplied Makefile assumes only that gnatchop is on your PATH.

You may find it useful to use gnatfe to manage installing GNAT while retaining your standard gcc compiler. If you do this, customize ada-prj-default-comp-cmd so that the compiler is gnatgcc.

Booch Components

Install under /usr/local/lib:

   # cd /usr/local/lib
   # tar zxvf /your/download/directory/bc-yyymmdd.tgz

installs the BCs in /usr/local/lib/bc-yyymmdd.

ColdFrame

Install under /usr/local/lib:

   # cd /usr/local/lib
   # tar zxvf /your/download/directory/cf-yyymmdd.tgz

installs ColdFrame in /usr/local/lib/cf-yyymmdd (Ada source is in the lib and project subdirectories).

Environment variables

Setting these environment variables will simplify matters. Later sections assume these settings.
Variable Use Typical
AUNIT Directory name for AUnit aunit-1.01
BC Directory name for the Booch Components bc-20040319
BUILD_BASE Where your Ada library files (.ali, .o) go ~/.build
COLDFRAME Directory name for ColdFrame cf-20040319
COLDFRAMEOUT Where the extractor script places output from Rose  
TOP The place where the software is installed /usr/local/lib
ADA_PROJECT_PATH Where your GNAT Project .gpr files are. $TOP/$COLDFRAME

Your Makefile

The Rose extraction script needs to be told where to place the extracted files:

  1. If the Rose Path Map variable COLDFRAMEOUT is set, the files are placed in the named directory
  2. Otherwise, if the environment variable COLDFRAMEOUT is set, the files are placed in the named directory (strongly recommended)
  3. Otherwise, the files are put somewhere, at Rose's whim.

Create a Makefile in the directory where your generated Domain.gen/ files (will) live (next to your implementation Domain.impl/ files). Its purpose is to call up the Makefile that ColdFrame provides.

It should contain at least

   include $(TOP)/$(COLDFRAME)/Makefile-unix

which means you need to type

   $ make Domain.gen

If you want to make life even easier, you can change your Makefile to

   include $(TOP)/$(COLDFRAME)/Makefile-unix
   all:: Domain_1.gen
   all:: Domain_2.gen

etc, after which you only need to say

   $ make

(until, of course, you find you need to add Domain_3).

If you're prepared to issue a slightly more complex command to build, you can get away without a Makefile at all:

   $ make -f $TOP/$COLDFRAME/Makefile-unix Domain.gen

(note, no brackets).

Creating your build directories

Assuming you have the environment variables set up, say

   $ $TOP/$COLDFRAME/create-build-directories

Creating a GNAT Project file

If you don't need to override any of the ColdFrame.Project source, your project file can be pretty simple: the supplied Regressions.gpr (in the test/ subdirectory) is

   with "Options";
   with "ColdFrame";
   with "BC";
   with "AUnit";

   project Regressions is

     for Main use ("regression_tests");

     for Exec_Dir use ".";

     for Source_Dirs use
       (
	"Compilation_Regressions.impl",
	"Compilation_Regressions.gen",
	"Regressions.impl",
	"Regressions.gen"
       );

     for Object_Dir use Options'Object_Dir & "/main";
     package IDE renames Options.IDE;
     package Builder renames Options.Builder;
     package Compiler renames Options.Compiler;
     package Binder renames Options.Binder;
     package Linker renames Options.Linker;

   end Regressions;

Add further domains as required, of course.

Overriding ColdFrame.Project source

If you need to override some of the Ada source code in the $(TOP)/$(COLDFRAME)/project directory, life becomes complicated because you have to avoid circularity and having multiple occurrences of the same file; you can't use the supplied ColdFrame.gpr.

Suppose your overriding source is in ~/Base/Build/ColdFrameProject/project; change directory to ~/Base/Build/ColdFrameProject and say

   $ make -f $TOP/$COLDFRAME/Makefile-unix install

This will place those of ColdFrame's files that you haven't overridden in ~/Base/Build/ColdFrameProject/inherited.

The project file now looks like

   with "Options";
   with "BC";
   with "AUnit";

   project Regressions is

     for Main use ("regression_tests");

     for Exec_Dir use ".";

     Project_Base = external ("HOME") & "/Base/Build/ColdFrameProject";

     for Source_Dirs use
       (
	"Regressions.impl",
	"Regressions.gen",
	external ("TOP") & "/" & external ("COLDFRAME") & "/lib",
	Project_Base & "/project",
	Project_Base & "/inherited"
       );

     for Object_Dir use Options'Object_Dir & "/main";
     package IDE renames Options.IDE;
     package Builder renames Options.Builder;
     package Compiler renames Options.Compiler;
     package Binder renames Options.Binder;
     package Linker renames Options.Linker;

   end Regressions;

Installation under Windows

You need

Drive

This note is written assuming that everything is installed on the C: drive at the top level. Alternate locations are possible.

Cygwin

This is required to allow you to use Make. At some stage I may look into a Tk-based build process.

There are no special installation requirements.

[incr Tcl]

This needs installing into C:\Tcl (not the default Program Files location).

You need to select a full installation to get the [incr Tcl] components.

TclXML

May already be part of your Tcl distribution.

This archive already contains a directory name; C:\tclxml-2.1theta is what the Makefile assumes.

Saxon

This needs unpacking into C:\Saxon.

GNAT

There are no special installation requirements. However, unless you are strongly wedded to the student AdaGIDE environment, I'd recommend using Emacs (I know 20.7 needs some minor tweaks, 21.1 should be OK) and ada-mode.

If you do use AdaGIDE, you'll probably need to use the ADA_INCLUDE_PATH environment variable.

Booch Components

This needs unpacking into C:\bc-yyyymmdd.

ColdFrame

This needs unpacking into C:\cf-yyyymmdd (Ada source is in the lib and project subdirectories).

Environment variables

Setting these environment variables (in My Computer / Properties / Envronment) will simplify matters. Later sections assume these settings.
Variable Use Typical
AUNIT Directory name for AUnit aunit-1.01
BC Directory name for the Booch Components bc-20040319
BUILD_BASE Where your Ada library files (.ali, .o) go C:/Temp/.build
COLDFRAME Directory name for ColdFrame cf-20040319
COLDFRAMEOUT Where the extractor script places output from Rose  
TOP The directory (or just disk drive) on which the software is installed c:
ADA_PROJECT_PATH Where your GNAT Project .gpr files are. %TOP%/%COLDFRAME%

Extraction

See notes on fitting the "extractor" add-in to Rose.

Your Makefile

The Rose extraction script needs to be told where to place the extracted files:

  1. If the Rose Path Map variable COLDFRAMEOUT is set, the files are placed in the named directory
  2. Otherwise, if the environment variable COLDFRAMEOUT is set, the files are placed in the named directory (strongly recommended)
  3. Otherwise, the files are put somewhere, at Rose's whim.

Create a Makefile in the directory where your generated Domain.gen/ files (will) live (next to your implementation Domain.impl/ files). Its purpose is to call up the Makefile that ColdFrame provides.

It should contain at least

   include $(TOP)/$(COLDFRAME)/Makefile-winnt

(you really do need forward slashes here) which means you need to type

   $ make Domain.gen

If you want to make life even easier, you can change your Makefile to

   include $(TOP)/$(COLDFRAME)/Makefile-winnt
   all:: Domain_1.gen
   all:: Domain_2.gen

etc, after which you only need to say

   $ make

(until, of course, you find you need to add Domain_3).

If you're prepared to issue a slightly more complex command to build, you can get away without a Makefile at all:

   $ make -f $TOP/$COLDFRAME/Makefile-winnt Domain.gen

(note, no brackets).

Creating your build directories

Assuming you have the environment variables set up, say

   $ $TOP/$COLDFRAME/create-build-directories

Creating a GNAT Project file

If you don't need to override any of the ColdFrame.Project source, your project file can be pretty simple: the supplied Regressions.gpr (in the test/ subdirectory) is

   with "Options";
   with "ColdFrame";
   with "BC";
   with "AUnit";

   project Regressions is

     for Main use ("regression_tests");

     for Exec_Dir use ".";

     for Source_Dirs use
       (
	"Regressions.impl",
	"Regressions.gen"
       );

     for Object_Dir use Options'Object_Dir & "/main";
     package IDE renames Options.IDE;
     package Builder renames Options.Builder;
     package Compiler renames Options.Compiler;
     package Binder renames Options.Binder;
     package Linker renames Options.Linker;

   end Regressions;

Add further domains as required, of course.

Overriding ColdFrame.Project source

If you need to override some of the Ada source code in the $(TOP)/$(COLDFRAME)/project directory, life becomes complicated because you have to avoid circularity and having multiple occurrences of the same file; you can't use the supplied ColdFrame.gpr.

Suppose your overriding source is in ~/Base/Build/ColdFrameProject/project; change directory to ~/Base/Build/ColdFrameProject and say

   $ make -f $TOP/$COLDFRAME/Makefile-winnt install

This will place those of ColdFrame's files that you haven't overridden in ~/Base/Build/ColdFrameProject/inherited.

The project file now looks like

   with "Options";
   with "BC";
   with "AUnit";

   project Regressions is

     for Main use ("regression_tests");

     for Exec_Dir use ".";

     Project_Base = external ("HOME") & "/Base/Build/ColdFrameProject";

     for Source_Dirs use
       (
	"Regressions.impl",
	"Regressions.gen",
	external ("TOP") & "/" & external ("COLDFRAME") & "/lib",
	Project_Base & "/project",
	Project_Base & "/inherited"
       );

     for Object_Dir use Options'Object_Dir & "/main";
     package IDE renames Options.IDE;
     package Builder renames Options.Builder;
     package Compiler renames Options.Compiler;
     package Binder renames Options.Binder;
     package Linker renames Options.Linker;

   end Regressions;


Simon Wright