We tried to keep the CMake configuration as simple as possible while keeping the features of a regular library.
This code uses C++11 so a compiler g++ 4.8 or equivalent is required. With GCC 4.7 some runtime problems can occur.
Additional dependencies: Boost, imagemafick and CImg.
$ sudo apt-get install imagemagick libboost-all-dev cimg-dev
For the impatient:
$ mkdir build $ cd build $ make -j4
This will compile the library, the benchmark tool, and the examples. The rest of the instructions assume the terminal is on the build
folder.
Select build type:
$ cmake .. -DCMAKE_BUILD_TYPE=Release (Release, RelWithDebInf or Debug, Release by default)
Do not compile examples:
$ cmake .. -DBUILD_EXAMPLES=false
To build latest the documentation:
$ cd doc $ doxygen
Go into the HTML folder and open index.html
in your browser.
You can install the library in your system by doing:
$ sudo make install
And uninstall it:
$ sudo make uninstall
Default installation folder is/usr/local
for Linux distributions (or equivalent on other OS). Libraries are installed in subfolder lib
, together with CMake modules. All the includes are installed under include
subfolder. Additionally, in the share
subfolder the helper scripts and some samples of benchmark configurations files are installed. Finally, the benchmark binary is installed in bin
.
In order to change the default installation folder you can do:
$ cmake ../.. -DCMAKE_INSTALL_PREFIX=<your folder>
In this case, you will have to adapt your environment variables so that the libraries and CMake modules are found.
The examples folder contains a CMakeLists.txt.template
which can be used as a reference for using the library in your own project once it is installed in your system.
The examples folder contains four examples that are compiled by default. Once they are compiled, you can run them:
$ ./examples/test_fm
$ ./examples/test_fm2 -map ../data/map2.png
$ ./test_fm_benchmark
$ ./examples/full_example -map1 ../data/testimg.png -map2 ../data/map.png -vel ../data/velocities.png
See the detailed benchmark documentation.