800x600 1024x768 Navigation:    Home arrow News arrow Latest arrow How to Build NGI
How to Build NGI PDF Print E-mail

NGI has a build system based on Nant.

In order to simplify building, we have included Nant in the ngi repository (it's located in the ./toolkits/nant-0.85 directory.

Note: we use the ./ to denote the root directory where you have placed ngi.

Quick Start


1. Download Version Control Software

You need to download and install Subversion or TortoiseSVN or both on your machine in order to get all the files. Subversion is the name of the source code control system we use and also the name of a set of command line tools to access the code repository on the http://ngi.googlecode.com/ server. TortoiseSVN is the name of a tool that comes in the form of a Windows explorer extension and is easier to use than the subversion command line.

2. Get ngi Files

Use it to checkout all the files to a directory of your choice. I'm using

C:/_ngi

and I suggest you do so too, since there may still be some hardcoded pathnames somewhere. At least you cannot claim I didn't tell you, if you choose to do otherwise.

3. Documentation Tools

3.1. ngiBook

The ngiBook is built using Docbook tools in various formats (Html, HtmlHelp, PDF). The tools are included in the ngi repository. You only need to add the respective directory to the PATH (see below).

3.2. Reference Documentation

You need to download and install Doxygen and GraphViz on your machine in order to be able to build the reference documentation. Doxygen parses the source code and uses it's structure and special comments to produce reference documentation. It makes use of GraphViz to render various sorts of graphs included in the documentation. In case you do not want to build the reference documentation right now, you can choose to not install Doxygen.

4. Building

First add the ./toolkits/nant-0.85/bin and the ./toolkits/xsltproc directories to your PATH.
Then start a command prompt and go to the NGI root directory and type

nant build

This recurses through all subdirectories and will build all of NGI (samples, tests, documentation) from scratch.

Note: this assumes that the compiler and linker and other tools from Visual Studio 2005 or Visual Studio 2008 are properly installed, so that they can be found.

 

More Build Details


The build system has been implemented in a recursive way. There is a build file in the NGI root directory, and there are build files in every relevant directory below. On every level in the NGI directory hierarchy, you can simply type

nant build

and it will build the whole subordinate directory tree.

Note: the ./toolkits, ./tests and ./samples directories are special, since they need to be built first, in order to have the supporting infrastructure in place. The ngi.build script takes care of this, but you have to keep it in mind if you are building manually.

For example, if you want to build the samples only, you would type the following:

cd samples
nant build



The build system has several targets (clean, build, help) and various modes (debug, release, build-tests, build-docs, build-samples, build-boost, build-vtk, ngi-vs2005, ngi-vs2008).

Targets are just listed on the Nant command line:

nant clean build

The default target is help. The default target is used if you do not specify any target on the command line.

Modes are specified with the -D syntax on the Nant command line:

nant -D:debug=true -D:release=false ...

The default mode for debug is false and the default mode for release is true. The defaults are used if you do not specify anything on the Nant command line.

Here are some useful examples:

Clean everything

nant clean


Rebuild from scratch (release only)

nant clean build


Build debug only

nant -D:debug=true -D:release=false build


Default build with more compilers

nant -D:ngi-vs2005=true -D:ngi-vs2008=true build


Minimal build (no documentation, no tests, no samples)

nant -D:build-docs=false -D:build-tests=false -D:build-samples=false build


 
Next >