Compiling PCL and its dependencies from MacPorts and source on Mac OS X — Point Cloud Library 0.0 documentation (original) (raw)

This tutorial explains how to build the Point Cloud Libraryfrom MacPorts and source on Mac OS X platforms, and tries to guide you through the download and building of all the required dependencies.

Mac OS X logo

Prerequisites

Before getting started download and install the following prerequisites for Mac OS X:

PCL Dependencies

In order to compile every component of the PCL library we need to download and compile a series of 3rd party library dependencies. We’ll cover the building, compiling and installing of everything in the following sections:

Required

The following libraries are Required to build PCL.

Optional

The following libraries are Optional and provide extended functionality within PCL, ie Kinect support.

Advanced (Developers)

The following libraries are Advanced and provide additional functionality for PCL developers:

Building, Compiling and Installing PCL Dependencies

By now you should have downloaded and installed the latest versions of XCode and MacPorts under the Prerequisites section. We’ll be installing most dependencies available via MacPorts and the rest will be built from source.

Install CMake

$ sudo port install cmake

Install Boost

$ sudo port install boost

Install Eigen

$ sudo port install eigen3

Install FLANN

$ sudo port install flann

Install VTK

To install via MacPorts:

$ sudo port install vtk5 +qt4_mac

To install from source download the source fromhttp://www.vtk.org/VTK/resources/software.html

Follow the README.html for compiling on UNIX / Cygwin / Mac OSX:

$ cd VTK $ mkdir VTK-build $ cd VTK-build $ ccmake ../VTK

Within the CMake configuration:

Press [c] for initial configuration

Press [t] to get into advanced mode and change the following:

VTK_USE_CARBON:OFF VTK_USE_COCOA:ON VTK_USE_X:OFF

Note

VTK must be built with Cocoa support and must be installed, in order for the visualization module to be able to compile. If you do not require visualisation, you may omit this step.

Press [g] to generate the make files.

Press [q] to quit.

Then run:

Install Qhull

$ sudo port install qhull

Install libusb

$ sudo port install libusb-devel +universal

Install Patched OpenNI and Sensor

Download the patched versions of OpenNI and Sensor from the PCL downloads pagehttp://pointclouds.org/downloads/macosx.html

Extract, build, fix permissions and install OpenNI:

$ unzip openni_osx.zip -d openni_osx $ cd openni_osx/Redist $ chmod -R a+r Bin Include Lib $ chmod -R a+x Bin Lib $ chmod a+x Include/MacOSX Include/Linux-* $ sudo ./install

In addition the following primesense xml config found within the patched OpenNI download needs its permissions fixed and copied to the correct location to for the Kinect to work on Mac OS X:

$ chmod a+r openni_osx/Redist/Samples/Config/SamplesConfig.xml $ sudo cp openni_osx/Redist/Samples/Config/SamplesConfig.xml /etc/primesense/

Extract, build, fix permissions and install Sensor:

$ unzip ps_engine_osx.zip -d ps_engine_osx $ cd ps_engine_osx/Redist $ chmod -R a+r Bin Lib Config Install $ chmod -R a+x Bin Lib $ sudo ./install

Building PCL

At this point you should have everything needed installed to build PCL with almost no additional configuration.

Checkout the PCL source from the Github:

Create the build directories, configure CMake, build and install:

$ mkdir build $ cd build $ cmake .. $ make $ sudo make install

The customization of the build process is out of the scope of this tutorial and is covered in greater detail in the Customizing the PCL build process tutorial.

Using PCL

We finally managed to compile the Point Cloud Library (PCL) for Mac OS X. You can start using them in your project by following the Using PCL in your own project tutorial.

Advanced (Developers)

Testing (googletest)

API Documentation (Doxygen)

Install Doxygen via MacPorts:

$ sudo port install doxygen

Or install the Prebuilt binary for Mac OS X (http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc)

After installed you can build the documentation:

Tutorials (Sphinx)

In addition to the API documentation there is also tutorial documentation built using Sphinx. The easiest way to get this installed is using pythonseasy_install:

The Sphinx documentation also requires the third party contrib extensionsphinxcontrib-doxylink (https://pypi.python.org/pypi/sphinxcontrib-doxylink) to reference the Doxygen built documentation.

To install from source you’ll also need Mercurial:

$ sudo port install mercurial $ hg clone http://bitbucket.org/birkenfeld/sphinx-contrib $ cd sphinx-contrib/doxylink $ python setup.py install

After installed you can build the tutorials:

Note

Sphinx can be installed via MacPorts but is a bit of a pain getting all the PYTHON_PATH’s in order