21 March 2012

Installing FLANN on Ubuntu 11.10

FLANN is a library for performing fast approximate nearest neighbor searches in high dimensional spaces. It contains a collection of algorithms we found to work best for nearest neighbor search and a system for automatically choosing the best algorithm and optimum parameters depending on the dataset. FLANN is written in C++ and contains bindings for the following languages: C, MATLAB and Python. 

I noticed two ways of installing FLANN on ubuntu namely the easy way and the hard way. Lets start with the hard way.

1. Install the basic dependencies
  • cmake
  • libhdf5-serial-dev
  • python-numpy (for python bindings)
  • python-h5py
2. Now download the latest version of flann from http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN. 
3. Extract it in a folder and run 'cmake' command in that folder.
    If all the dependencies and PATH are defined in your system, it will install neatly.
4. If it shows errors, open the Makefile and  check if you have defined all the paths. 'cmake' command will give you errors on which you may need to install other dependencies. Keep repeating until you make through. :-P

Easy way is to install FLANN from the PCL repository.
1. Open the terminal and type -
    sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
2. Now update your repository by typing -
    sudo apt-get update
3. Now go to your synaptic package manager, and search for flann. Check it and install it.