Skip to content

Latest commit

 

History

History
166 lines (125 loc) · 7.48 KB

Compilation.md

File metadata and controls

166 lines (125 loc) · 7.48 KB
Tutorials Home Next

Compiling and Installing libpointmatcher on your Computer

######Latest update January 9, 2014 by Samuel Charreyron

Foreword

*The following instructions are aimed at users of Ubuntu Linux. The steps from this tutorial were performed on Ubuntu 13.10 (Saucy Salamander). These instructions should be identical previous versions of Ubuntu. Other Linux variants or nix operating systems should follow a very similar process.

Note: we only support 64-bit systems because of some issues with Eigen.

Option 1: Installing libpointmatcher from Pre-built Binaries (Ubuntu)

We recommand to compile from source to access the latest bug fixes, but for convenience a pre-built version of the library is available on the following Personal Package Archive (PPA). Instructions on how to add a PPA to Ubuntu can be found here. Once the PPA has been added to your system, simply run:

sudo apt-get install libpointmatcher-dev

to install libpointmatcher to your system.

Option 2: Detailed Installation Instructions

Some Basic Requirements

a. Installing Boost

Boost is a widely-used C++ library and is included in most Linux distributions. You can quickly check if Boost is installed on your system by running

ldconfig -p | grep libboost

If you see a list of results then you can skip to the next section. If not, you most likely have to install Boost.

Instructions for downloading and installing boost to Unix systems can be found here. Boost can also be installed as a package by running

sudo apt-get install libboost-all-dev

b. Installing Git

Git is a version control system similar to SVN designed for collaboration on large code projects. Because libpointmatcher is hosted on Github, you should the git application to keep track of code revisions, and bug fixes pushed to the public repository.

Git should already be installed on your system but you can check if it is by running

git --version 

If Git is installed, you should see a message of the form

git version 1.8.3.2

If not refer to the Git homepage for installation instructions or install via the package manager by running

sudo apt-get install git-core

c. Installing CMake

CMake is a cross-platform build system and is used for building the libpointmatcher library. Refer to the homepage for installation instructions, or you can once again use the package manager

sudo apt-get install cmake cmake-gui

NOTE: CMake has a GUI called cmake-gui which can be useful for configuring builds. We recommend you install this as well since it will be referred to in this tutorial.

NOTE 2: Some functionalities like find_package() (only useful if you intent to link with your own project) will only work if you have CMake 2.8.11 or over. On Ubuntu 12.04, only 2.8.7 is available using apt-get. If you intent to use such functionality, you will have to compile CMake from sources.

1. Installing Eigen

The Eigen linear algebra library is required before installing libpointmatcher and can be found here. Either download and compile Eigen following instructions from the package website or simply install package via apt by running:

sudo apt-get install libeigen3-dev

2. Installing libnabo

libnabo is a library for performing fast nearest-neighbor searches in low-dimensional spaces. It can be found here. Clone the source repository into a local directory of your choice.

mkdir ~/Libraries/
cd ~/Libraries
git clone git://github.com/ethz-asl/libnabo.git
cd libnabo

Now you can compile libnabo by entering the following commands

SRC_DIR=`pwd`
BUILD_DIR=${SRC_DIR}/build
mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ${SRC_DIR}
make
sudo make install

This will compile libnabo in a /build directory and install it on your system.

Note: If Eigen or Boost are not in their regular system locations you will have to indicate their location by setting the corresponding CMake flags.

4. Compiling the Documentation

Libpointmatcher is documented directly in the source-code using Doxygen. If Doxygen is installed on your system, an html version of the documentation will be compiled in /usr/local/share/doc/libpointmatcher/. To install Doxygen in Ubuntu, run:

sudo apt-get install doxygen

Once you have compiled libpointmatcher in step 6, you can simply open /usr/local/share/doc/libpointmatcher/api/html/index.html in a browser to view the API documentation.

5. Installing libpointmatcher

Clone the source repository into a local directory. As an example we reuse the Libraries directory that was created to contain the libnabo sources.

cd ~/Libraries/
git clone git://github.com/ethz-asl/libpointmatcher.git
cd libpointmatcher

Now, libpointmatcher is compiled into a /build directory.

SRC_DIR=`pwd`
BUILD_DIR=${SRC_DIR}/build
mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ${SRC_DIR}
make

You can optionally verify that the version of libpointmatcher you have compiled is stable by running the unit tests.

utest/utest --path [libpointmatcher root]/examples/data/

Finally, to install libpointmatcher to your system run the following:

sudo make install

Possible Caveats

If Eigen, libnabo, yaml-cpp are not found during the installation, you will have to manually supply their installation locations by setting the CMake flags. You can do so using the CMake GUI.

cd build
cmake-gui .

alt text

You can then set EIGEN_INCLUDE_DIR, NABO_INCLUDE_DIR, NABO_LIBRARY, yaml-cpp_INCLUDE_DIRS, yaml-cpp_LIBRARIES to point to your installation directories as shown in the screenshot above. Then, generate the make files by clicking generate and rerun the following inside /build:

make
sudo make install