Installation guide

MTL4 is a pure template library and only a download of the sources is required.

The Boost library is used and must also be downloaded. We used in the development and testing version 33.1 but the programs would probably compile with earlier versions, too. The parts of boost used in MTL4 do not need to be compiled but only included.

If you want to run the test programs, you need the build system scons. It is easy to install and takes only a few minutes. The scons-based build of MTL4 uses the environment variables MTL_BOOST_ROOT to locate the MTL directory and BOOST_ROOT to locate the Boost directory.

If you compile MTL4 with VS2005 or its free express version you need to install the SDK (some boost files access it). Please make sure that the compiler is in the path. Then scons will find it. Additionally, you have to tell the compiler where the header files and the libraries of VC and the SDK are located, i.e. declare the environment variables LIB and INCLUDE. For instance:
LIB=c:/Program Files/Microsoft Visual Studio 8/vc/lib;c:/Program Files/MicrosoftVisual Studio 8/vc/platformsdk/lib
INCLUDE=c:/Program Files/Microsoft Visual Studio 8/VC/include;c:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include
On some machines the compiler still did not find the files. For that reason the paths within these two variables are incorporated into the command line by our scons script.

To execute the test programs go in MTL4's test directory libs/numeric/mtl/test and type:
scons -D . check=1
If the building finishes all tests were passed. The building can be considerably speed up, esp. on multi-core processors, when scons is used with multiple processes. For instance, to run the tests with four processes (which works quite well on two processors) type:
scons -Dj 4 . check=1
The output will be quite chaotic but, again, when the building finishes all tests are passed.

Similarly, the example programs can be compiled. Go in directory libs/numeric/mtl/examples and type:
scons -D .
For the sake of simplicity, there are no checks in the examples (nevertheless an exceptions thrown in the examples help to fix a bug).

To compile (and test) all programs you can run scons in the main directory (then you do not need the -D option and the dot) or in any directory of the tree if you use -D and omit the dot. You can also compile single files if you specify the name of the executable (including .exe on windows).

If you want to use BLAS, you need to define the macro MTL_HAS_BLAS, e.g., by compiling your programs with -DMTL_HAS_BLAS, and link the appropriate libraries. Alternatively, you can use MTL4's build system with the flag with-blas=1 that will check if GotoBlas, ACML, or ATLAS is installed on your system (thanks to Torsten Hoefler who wrote the tests in scons). If scons does not find your BLAS library you can specify additional flags, see
scons -h
for details.

If you wish to generate the documentation locally on your system you need doxygen. When it is installed type doxygen in the main directory and the documentation will be written to libs/numeric/mtl/doc.

Resuming, for MTL4 you need to:

Supported compilers

The Matrix Template Library is written in compliance with the C++ standard and should be compilable with every compiler compliant with the standard. It has been tested (and passed) with the following compilers and architectures:

More compilers will be tested in the future.

Compilers that are not standard-compliant (e.g. VC 6.0 from VS 2003) are not subject to support.

Proceed to the IDE.






Installation guide -- MTL 4 -- Peter Gottschling and Andrew Lumsdaine -- Generated on 19 May 2009 by Doxygen 1.5.5 -- Copyright 2007 by the Trustees of Indiana University.