Skip to content

Latest commit

 

History

History
123 lines (73 loc) · 5.3 KB

CompilationWindows.md

File metadata and controls

123 lines (73 loc) · 5.3 KB
Tutorials Home Next

Compiling and Installing libpointmatcher on Windows

Compiling using MSVC (Microsoft Visual Studio)

In Short...

If you are used to development project, here is what you need:

Name Link Version
(Tested December 29, 2018)
Windows 10
git https://git-scm.com/ v2.20.1
libpointmatcher sources https://github.com/anybotics/libpointmatcher
libnabo sources https://github.com/anybotics/libnabo
Visual Studio https://visualstudio.microsoft.com/ Visual Studio 2017 15.9.4
CMake https://cmake.org/ v3.13.2
Eigen 3 http://eigen.tuxfamily.org/index.php v3.3.7
Boost https://www.boost.org/ v1.69.0

The rest of this tutorial will guide you through the different requirements step by step.

Building Boost

  1. Open a console that knows the path to the MSVC compiler command (cl). We suggest using Windows PowerShell. An alternative is Developer Command Prompt, which can be located in the Start menu in the Visual Studio section.

  2. Go to your Boost source directory, and do:

    $ .\bootstrap.bat
    $ .\b2.exe install --prefix=build address-model=64
    
  3. It may take a while to finish.

Build libnabo

You may need to install grep to build libnabo. You can get the Windows version here.

  1. Start CMake GUI

  2. Add the path of your libnabo source folder in the field Where is the source code.

  3. Add a folder named build in the field Where to build the binary. This will allow you to do out-of-source compilation.

  4. Click on the button Configure

    1. Select the generator for the project (Visual Studio 15 2017 Win64)
    2. Typically you will select "Use default native compilers" for the generator
    3. Click "Finish"
    4. An error will be reported, because CMake does not know yet where to find the libraries. The next steps will tell it where to find them.
  5. Locate your eigen folder in the field EIGEN_INCLUDE_DIR

  6. Add the following boolean variable and set it to true: Boost_USE_STATIC_LIBS

  7. Add the following PATH variable and set it to (your boost folder)/build: BOOST_ROOT

  8. Change the variable CMAKE_CONFIGURATION_TYPES to RelWithDebInfo

  9. Click on the button Configure, then on Generate. Here is an example of what your CMake should look like:

    alt text

  10. Locate the Microsoft Visual Studio Solution file (libnabo.sln) in your build folder and open it. Visual Studio should open.

  11. Build the solution: BUILD -> Build Solution

    Alternatively, you can build the solution from the command line. In (your libnabo folder)/build:

    $ msbuild /m:2 libnabo.sln
    

    (Note that the flag /m:X defines the number of cores msbuild will use while building the solution.)

Build libpointmatcher

  1. Start CMake GUI, follow the same steps to configure the source and build folders for libpointmatcher, then click the Configure button.

  2. Locate your eigen folder in the field EIGEN_INCLUDE_DIR

  3. Add the following boolean variable and set it to true: Boost_USE_STATIC_LIBS

  4. Add the following PATH variable and set it to (your Boost folder)/build: BOOST_ROOT

  5. Add the following PATH variable and set it to (your libnabo source folder): NABO_INCLUDE_DIR

  6. Add the following FILEPATH variable and set it to (your libnabo source folder)/build/RelWithDebInfo/nabo.lib: NABO_LIBRARY

  7. Change the variable CMAKE_CONFIGURATION_TYPES to RelWithDebInfo

  8. Click on the button Configure, then on Generate. Here is an example of what your CMake should look like:

    alt text

  9. In Visual Studio, build the solution: BUILD -> Build Solution

    Alternatively, you can build the solution from the command line. In (your libpointmatcher folder)/build:

    $ msbuild /m:2 libpointmatcher.sln
    

    (Note that the flag /m:X defines the number of cores msbuild will use while building the solution.)

Reporting Issues

Currently, we don't have a developer fully supporting compilation on Windows. If you can help refreshing this documentation, your help is more than welcome.

Before reporting new building issues, have a look in the current/past list of issues. Add as much details as you can since you will most probably receive answers from developers that cannot reproduce the problem on their side. Here are some of them:

  • Your directory structure need to be well organized as mention in Issue #136.
  • There might be some problems related to libnabo as mention in Issue #128.

Special Thanks

Special thanks to the following users in helping us with the Windows support: