To install the library just move the include
folder into a proper place,
e.g. /usr/local/include
in Unix-alike systems. Alternatively, one can use
CMake (2.8 or later required),
cd /path_to_vSMC_source
mkdir build
cd build
cmake ..
sudo make install
To make the documentations one need Doxygen 1.8.1 or later.
make docs
The documentation can also be found here.
This library has two mandatory requirements other than standard libraries: the Eigen linear algebra library and Random123 parallel random number library. Both of them are very portable.
In addition, the library use the <functional>
, <random>
and <type_traits>
headers, which are parts of the C++11 standard libraries or can be found in
Boost. By default the library will use the Boost library. But
if the C++ implementation has them correctly implemented, the standard headers
can also be used.
Note that this library is only tested with Boost 1.49 or later. Also
not all C++11 (or C++0x) implementations of <functional>
, <random>
and
<type_traits>
work properly.
To build test examples,
make buildtests
To run the tests,
make test
Or
ctest
Note that CMake generated Makefile
does not build test executables
before run ctest
in the test
target, so you need run make buildtests
before make test
or ctest
.
make buildtests
will also build the examples, one is a simple particle
filter, in test/pf
, the others are a Gaussian mixture model and Positron
Emission Tomography compartmental model with SMC, in test/gmm
and test/pet
respectively. The examples may take some non-trivial run-time, therefore they
are not run when invoking make test
or ctest
. To run the example, one can
invoke ctest -C Release
. Alternatively, one can use
make check
to build all tests and examples, and run all of them.
Without CMake one can go to the test
directory and build the
examples manually. For example,
cd test/pf
g++ -std=c++0x -O3 \
-I /path_to_v_smc_headers \
-I /path_to_eigen_headers \
-I /path_to_random123_headers \
-I /path_to_tbb_headers -L /path_to_tbb_libraries -ltbb \
-o pf_tbb pf_tbb.cpp
There are some other more complex realistic examples and other configurations for the simple particle filter. They may require additional optional libraries.
The library itself only use standard C++98 features and is fairly portable.
For compiler support of Eigen and Random123 see their
pages respectively. In C++11 mode, the usability of <functional>
, <random>
and <type_traits>
headers distributed with various implementations differs
significantly. However Boost can be used as a replacement and which is
well known for portability.
-
Linux
- GCC 4.4, 4.5, 4.6,
- Intel icpc 12.0, 12.1
- Clang 2.8, 2.9, 3.0, 3.1, SVN
-
Mac OS X
- Clang 3.1
- Intel icpc 12.1
-
Windows
- MSVC 2010
The vSMC library is distributed with a two-clauses BSD license which can be found in the COPYING file distributed with the source.