Spatial C++ Library
Generic Multi-Dimensional Containers and Spatial Operations
Compiling the Unit Tests and the Examples

The Unit Tests

The unit tests base their sources on the library files contained in the directory src/ at the top of the source package. In other words, the unit tests are testing the library contents itself.

To compile the unit tests, you will need CMake and and a dynamic library version of Boost.Test. Most Linux distributions will provide these tools within their standard repositories. On Windows, you will probably have to install the pre-build binaries of the Boost.Test library and download CMake from it's official website. Once you have the necessary tools, you can generally type (assuming that you are in the top directory of the distributed package):

$ cd tests
$ mkdir build
$ cd build
$ cmake ..
$ make

The steps are mostly similar on Windows, except for the last one, if you are using Visual Studio C++, you should compile through the user interface.

The last step may take a long time, depending on the performance of your machine. If you encounter some error or warning during the compilation of the unit test, please inform the maintainers immediately, via the mailing lists.

Once compilation is over, run the unit tests with:

$ ./verify

That should run and return without errors. If you do encounter some errors, please inform the maintainers immediately, via the mailing lists.

If you are a contributor to the library, running the unit tests is mandatory before submitting a patch. If your patch breaks the unit tests, it will be rejected.

The Examples

Contrary to the unit tests, the examples assume that you have already installed the library in the default include path of your compiler and named spatial. They behave as close as possible to your own installation.

The Examples require the following tools to compile:

  • CMake
  • libkdtree++
  • Boost.Geometry.Index

Similarly you can generally execute:

$ cd examples
$ mkdir build
$ cd build
$ cmake ..
$ make

The steps are mostly similar on Windows, except for the last one, if you are using Visual Studio C++, you should compile through the user interface.

The examples are organized in different directory to help you navigate through their contents by topic.