CTG user guide

David Adams
04mar05


Introduction

CTG is an implementation of the CTEST interface that makes us of the GNU code development tools make, autoconf, automake and libtool. Software modules meeting the CTEST interface can be built and combined to create software packages that advertise their external dependencies and provide setup scripts.

CTG dependencies

CTG is mostly a collection o simple shell scripts and depends on other tools to do most of the work. The following are expected to be available on the command line when CTG is set up.

pkgmgr
Pkgmgr is an interface for locating and instaling software packages. CTG uses it to locate external software, i.e. packages named in CTEST external/NAME configuration files.

pkgmgr_util
Utilities to aid in setting up software. These include libpath, exepath and pkgsetup.

make
Recent versions, in particular 3.79.1, of the GNU flavor of make are known to work.

The following must be installed and registered as pkgmgr packages. See the script ctgsetup.sh for the most recent list. The CTG setup will fail if any are missing.

m4-1.4.2
GNU scripting language.

autoconf-2.59
GNU tools for configuring software.

automake-1.9.4
GNU tool for building makefiles.

libtool-1.5.10
GNU tool for builing shared libraries.

And of course you must have a C++ compiler and, if needed, a FORTRAN compiler.

Configuring a CTG build

CTG development is normally done in a dedicate directory called the build directory. This directory contains two configuration files that specify how a package is to be built.

ctgconf
This is a shell script to be sourced that defines the following enviromental variables:

The last two of these may be defined elsewhere as long as they are exported before CTG setup.

ctgpkgs.dat
List of modules in this software package. These correspond to names specified in the CVS repository.

Building

A CTG build is partitioned into modules and build steps. The command ctg may be used to execute one or build steps on a given module with the syntax
> ctg -flags pkgdir/pkgname
where flas are any of the flags listed below and pkgdir/pkgname is the full package name. The command ctg_build may be used to build multiple packages with the syntax
> ctg_build -flags pkglist
with the same choice of flags and pkglist being a list of package names separated with spaces. The names must appear in the file ctgpkgs.dat which also dictates the build order. The names need not be qualified with directories. A range of packages may be indicated with pkg1:pkg2, :pkg1 or pkg1: where the second incicates all packages up to and including pkg1 and the last all packages from pkg1 onward. the package directory. If the pkglist is omitted, then all the packages are built.

The flags and their meanings are as follows:

  u - Check out or update from CVS.
  g - Create the platform-independent build structure
  d - Create the platform-dependent build structure
  b - Build including compilation, linking and local installation
  t - Run component and binary tests
  i - Install
Instructions for building each package are taken from the CTEST configuration files appearing in the modules. See the CTEST specification.

All building is done within the modules. The full dependency list is in FULLDEPS and the input files for auotmake and autoconfiguration are in gbuild. The software build, local installation and testing are done in subdirectories of the build directory.


dladams@bnl.gov