Installation of fmm in Windows#

Section author: Xingmin Wang <xingminw@umich.edu>

The implementation of the map matching is based on a thrid-party package called fast map matching [git] [wiki]. To install this package, you are recommended to use the Ubuntu system where the installation documentation can be found at the wiki page. However, the installation instruction of the Windows system does not work well.

Here is an documentation showing you how to install the fmm in the Windows system. The following installation is tested on Windows 10 x64 system with x64 Anaconda virtual environment. This installation is quite complicated, prepare yourself for a couple of hours and please read every comments and attentions carefully. Good luck!

Preparation#

Warning

If you have already create an environment, you don’t need create again. Just use conda activate $env_name$ to activate your environment.

  1. The installation is based on Anaconda, you are supposed to install Anaconda first and create a new virtual environment by using:

conda create -n $env_name$ python=3.8
conda activate $env_name$

Note

If not specified, we recommend you to run the command lines in Anaconda Prompt.

  1. Download and install Build Tools for Visual Studio [download link] [official-website] by selecting the download option (C++ build tools):

msvc download

  1. Download and install CMake (https://cmake.org/download/) and add it to system path:

cmake install

  1. Download and unzip swigwin (http://www.swig.org/download.html/)

swigwin

  1. Clone vcpkg given by [link]:

git clone https://github.com/microsoft/vcpkg
cd vcpkg
bootstrap-vcpkg.bat
  1. Install dependencies using vcpkg (within the path of vcpkg):

vcpkg install gdal boost-geometry boost-graph boost-serialization --triplet=x64-windows

Attention

triplet=x64-windows should be consistent with your anaconda platform version. Please check the installed anaconda platform version by using cmd conda info:

Check Conda version

Installation#

  1. Clone the FMM repo:

git clone https://github.com/cyang-kth/fmm

Attention

Please check PR [here] for an error you might encounter durnig the compile process. Probably you will need to change the file in python/CMakeLists.txt according to the pull request or you can directly pull the forked version in cmpute/fmm (use this branch).

  1. CMake (in the path of fmm):

Attention

you should use the Native Tools Command Prompt for VS that has the consistent platform version (x86 or x64).

cmake cmd
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=$vcpkg_path$/scripts/buildsystems/vcpkg.cmake -DSWIG_EXECUTABLE=$swigwin_path$/swig.exe -DCONDA_PREFIX=$anaconda_path$/envs/$env_name$ -DCMAKE_INSTALL_PREFIX=$anaconda_path$/envs/$env_name$ -G "NMake Makefiles"
nmake install

Tip

Please make sure that the path in the cmake command line; you need to carefully set the paths correctly one by one. Here is an example I used:

cmake .. -DCMAKE_TOOLCHAIN_FILE=F:/vcpkg/scripts/buildsystems/vcpkg.cmake -DSWIG_EXECUTABLE=F:/swigwin-4.0.2/swig.exe -DCONDA_PREFIX=C:/Users/xingm/.conda/envs/mtldp -DCMAKE_INSTALL_PREFIX=C:/Users/xingm/.conda/envs/mtldp -G "NMake Makefiles"
  1. (To be fixed in the future) move all the *.dll files in the build folder to $anaconda_path$/envs/$env_name$/bin (example in my desktop: C:/Users/xingm/.conda/envs/mtldp/bin).