Skip to content

Installation of fmm (cpp)

Can Yang edited this page Aug 28, 2019 · 16 revisions

Requirements

  • C++ Compiler supporting c++11
  • GDAL >= 2.2: IO with ESRI shapefile, Geometry data type
  • Boost Graph >= 1.54.0: routing algorithms used in UBODT Generator
  • Boost Geometry >= 1.54.0: Rtree, Geometry computation
  • Boost Serialization >= 1.54.0: Serialization of UBODT in binary format

Ubuntu platform

Install requirements with

sudo apt-get install libboost-dev gdal-bin libgdal-dev libeigen3-dev

Install the program with

  # Under the project folder
  mkdir build
  cd build
  cmake ..
  make install

It will build executable files under the build folder, which are installed to /usr/local/bin:

  • ubodt_gen: the Upper bounded origin destination table (UBODT) generator (precomputation) program
  • ubodt_gen_omp: the parallel Upper bounded origin destination table (UBODT) generator (precomputation) program.
  • fmm: the map matching program (single processor)
  • fmm_omp: parallel map matching implemented with OpenMP.

These executable files will be copied into the ~/bin path, which should be added to the PATH variable by default.

Verfication of installation

Open a new terminal and type fmm, you should see the following output:

------------ Fast map matching (FMM) ------------
------------     Author: Can Yang    ------------
------------   Version: 2017.11.11   ------------
------------     Applicaton: fmm     ------------
No configuration file supplied
A configuration file is given in the example folder
Run `fmm config.xml`

To run the program, check run map matching in C++.

Windows platform

Mac platform

Install requirements with

  brew install -v boost gdal eigen

Install the program with

  # Under the project folder
  mkdir build
  cd build
  cmake ..
  make install

Installation of Python program

Requirements

In addition to the requirements of the c++ program, the python extension requires

  • Linux/Unix environment (tested on Ubuntu 14.04)
  • swig 4.0.0
  • Python 2.7

Installation

To install the python extension, run

    cd python
    make

Add the dist folder (Update the path PATH_TO_DIST_FOLDER below) to the environment variable PYTHONPATH:

    echo 'export PYTHONPATH=${PYTHONPATH}:PATH_TO_DIST_FOLDER' >> ~/.bashrc
    source ~/.bashrc

Verification of installation

    python -c "import fmm"

Check the jupyter notebook file fmm_demo.ipynb for a demo.

Swig installation

Install SWIG, download the swig file as swig-4.0.0.tar.gz

tar -xf swig-4.0.0.tar.gz
cd swig-4.0.0/
./configure
sudo make
sudo make install

Verification of installation

$ swig -version
SWIG Version 4.0.0
Compiled with g++ [x86_64-pc-linux-gnu]
Configured options: +pcre
Please see http://www.swig.org for reporting bugs and further information

Common error with installation

If an error pops as missing libpcre.so.1, we can copy from anaconda

sudo mv ~/anaconda2/lib/libpcre.so.* /usr/lib

Reference