Testing with scons
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.
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.
Testing with scons -- MTL 4 -- Peter Gottschling and Andrew Lumsdaine
-- Gen. with
rev. 7542
on Sat Aug 11 2012 by doxygen 1.7.6.1 -- © 2010 by SimuNova UG.