
Installation
------------

<!--
### Downloading ###

Download with SVN, using the following:

	$ svn checkout --username ANTANI svn://net143-184.mclink.it/csm

where `ANTANI` is your surname (you should have received a password). 

This will checkout both the source code
and some files used for experiments, that might be slightly slow to download.
If you are only interested in  the source code, use:

	$ svn checkout --username ANTANI svn://net143-184.mclink.it/csm/csm
-->

### Required software dependencies ###

This software has been tested on Mac OS X, Linux, and Windows XP (using Cygwin).
It compiles with GCC (3.3 or 4.x) and the Intel C++ Compiler (ICC).

Required software:
* The build system is based on `cmake`, which is available at <http://www.cmake.org/>.
* The GSL, Gnu Scientific Library, available at <http://www.gnu.org/software/gsl/>.
* (optional) For `log2pdf` and other visualization applications, you will need the Cairo graphics library, available at <http://cairographics.org>. The recommended version is the stable 1.4.12.

**Linux**. CMake, Cairo, and GSL are probably already packaged for your Linux distribution. For example, in Ubuntu, you can simply enter this command to install all dependencies:

	$ sudo apt-get install build-essential cmake libgsl0-dev libcairo2-dev 

**OS X**. You can install GSL using [Fink](http://finkproject.org/). You have to install Cairo manually. 

**Windows XP, using Cygwin**. CSM runs fine on Cygwin, but very slow compared to Linux/OS X.
Make sure you install the Cygwin packages `cairo`, `gsl`, `gsl-apps`, `gsl-devel`.

**Windows XP, using Visual Studio**. CSM doesn't compile yet on this platform. CMake can theoretically create
Visual Studio projects, but I could not manage to do it. Also, some CMake code is probably Unix-specific.

### Compiling ###

If you are lucky, this should be it:

	$ cmake .
	$ make

If you want to install this library system-wide, you could use:

	$ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local .
	$ make 
	$ make install

as the first step.


For installing the Ruby wrapper, refer to the separate instructions.
If you want to use the Ruby wrapper, I suggest to install the source
code in a `deploy` sub-directory of `csm`:

	csm/
		docs/
		csm/
		rsm/
		deploy/     <---  here

To do this, use:

	$ cmake -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/deploy .
	$ make 
	$ make install

(you have to give a complete path to `-DCMAKE_INSTALL_PREFIX:PATH`).

Later, remember to set your `PATH` variable to `csm/deploy/bin`. 

### Getting started ###

You might get started by doing this:

	$ sm2 < in.log > out.log

where `in.log` is a Carmen-format log file. 

You can find one in the top-level `experiments` directory: it is called `laserazosSM3.log`.
So, if you installed the Cairo library, you can see the result with:

	$ sm2 < in.log > out.log
	$ log2pdf -use odometry -in out.log -out out-odometry.pdf
	$ log2pdf -use estimate -in out.log -out out-estimate.pdf




