Installation for Windows

Prerequisites for Windows users

If not already installed:

  1. Install git
  2. Optionally you can install SourceTree to manage your repositories
  3. Install Visual Studio 2015 Community Be sure to launch it at least once while being logged with your user account. Doing so will ensure that Visual Studio is correctly registered, because otherwise, the build of some dependencies may fail.
  4. Install Python 2.7
  5. Install CMake
  6. Install jom
  7. Install ninja

Qt is an external library used in FW4SPL. For the successful compilation of Qt for FW4SPL, please see the following requirements:

FW4SPL installation

Good practice in FW4SPL recommend to separate source files, build and install folders. So to prepare the development environment:

  • Create a development folder (Dev)

  • Create a build folder (Dev\Build)

    • Add a sub folder for Debug and Release.
  • Create a source folder (Dev\Src)

  • Create a install folder (Dev\Install)

    • Add a sub folder for Debug and Release.

To prepare the third party environment:

  • Create a third party folder (BinPkgs)

  • Create a build folder (BinPkgs\Build)

    • Add a sub folder for Debug and Release.
  • Create a source folder (BinPkgs\Src)

  • Create an install folder (BinPkgs\Install)

    • Add a sub folder for Debug and Release.

directories

Set the environment for a x64 version. To compile BinPkgs and sources, you must use the ‘VS2015 x64 Native Tools Command Prompt’

Dependencies

  • Clone the following repository in the (BinPkgs/Src) source folder:

> cd Deps/BinPkgs/Src
> git clone https://github.com/fw4spl-org/fw4spl-deps.git

Note

Optionnal: You can also clone this extension repository: fw4spl-ext-deps

You’ll need it if you want to add extension to fw4spl (like fw4spl-ar).

  • Check if all the cloned repositories are on the same branch.
  • Update the cloned repositories to the lastest stable tag.

Warning

Be sure to be in the ‘VS2015 x64 Native Tools Command Prompt’

Note

Make sure that CMake executable (cmake.exe and cmake-gui.exe)location is present in your PATH environment variable.

  • SET PATH=%PATH%;D:ToolsCMakebin

Note

Make sure that JOM executable (jom.exe) location is present in your PATH environment variable.

  • SET PATH=%PATH%;D:Toolsjom
  • Call the cmake-gui by executing command : cmake-gui
> cmake-gui
  • Set the wanted Build directory (e.g. Dev\BinPkgs\Build\Debug or Release)

  • Set the wanted Source directory (e.g. Dev\BinPkgs\Src\fw4spl-deps)

  • During Configure, choose the generator ‘NMake Makefiles JOM’.

  • Set the following arguments:

    • CMAKE_INSTALL_PREFIX: set the install location (e.g. Dev\BinPkgs\Install\Debug).
    • CMAKE_BUILD_TYPE: set to Debug or Release.
    • ADDITIONAL_DEPS: you can leave it empty, it is only needed if you have an extra source location like fw4spl-ext-deps or a custom repository.

Warning

ENABLED_PCL_DEPS, ENABLE_LIBSGM and ENABLE_OPENCV_CUDA need Cuda library before. If you install Cuda during the process, you must re-open the ‘VS2015 x64 Native Tools Command Prompt’ to update your PATH.

  • Set the following options (some of the options will be needed for the optional source):

    • ENABLED_INFINITAM: set to ON to build infinitam.
    • ENABLED_BUILD_ORB_SLAM2: set to ON to build ORB Slam 2
    • ENABLED_OGRE_DEPS: set to ON to build ogre.
    • ENABLED_PCL_DEPS: set to ON to build PCL.
    • ENABLED_REALSENSE: set to ON to build librealsense.
    • ENABLED_SOFA_DEPS: set to ON to build sofa.
    • ENABLE_EXPERIMENTAL_DEPS: set to ON to build experimentals libraries.
    • ENABLE_LIBSGM: set to ON to build libSGM dependencies.
    • ENABLE_ODIL: set to ON to build Odil dependencies.
    • ENABLE_OPENCV_CONTRIB: set to ON to build OpenCV contrib extra modules.
    • ENABLE_OPENCV_CUDA: set to ON to build OpenCV with CUDA support.
    • ENABLE_OPEN_MP: set to ON to enable OpenMP.
    • ENABLE_PCL_CUDA: set to ON to build PCL with CUDA support.
  • Generate the code.

  • Compile the FW4SPL dependencies using jom in the console:

    • go to the build directory (e.g. Dev\BinPkgs\Build\Debug or Release)
    • Use “jom all” to compile all the dependencies
    • Use “jom name_of_target” to compile only the wanted target
> cd Dev\BinPkgs\Build\Debug
> jom all
  • All the generate library are in the install directory (e.g. DevBinPkgsInstallDebug or Release)

Note

To prevent any futur problemes with source generation, check if all of the library has been compiled

Source

  • Clone the following repositories in the (DevSrc) source folder:
> cd Deps/Src
> git clone https://github.com/fw4spl-org/fw4spl.git

Note

  • Optionnal: You can also clone these extension repositories:
  • Check if all the cloned repositories are on the same branch.
  • Update the cloned repositories to the same tag as dependencies.

Warning

Be sure to be in the ‘VS2015 x64 Native Tools Command Prompt’

Note

Make sure that CMake executable (cmake.exe and cmake-gui.exe)location is present in your PATH environment variable.

  • SET PATH=%PATH%;D:ToolsCMakebin

Note

Make sure that Ninja executable (ninja.exe) location is present in your PATH environment variable.

  • SET PATH=%PATH%;D:Toolsninja
  • Call the cmake-gui.
> cmake-gui
  • Set the wanted Build directory (e.g. Dev\Build\Debug or Release)

  • Set the wanted Source directory (e.g. Dev\Src)

  • During configure step, choose the generator ‘Ninja’ to compile FW4SPL sources.

  • Set the following arguments:

    • ADDITIONAL_PROJECTS: set the source location of fw4spl-ar, fw4spl-ext and fw4spl-ogre, separated by ”;”.
    • CMAKE_INSTALL_PREFIX: set the install location (e.g. Dev\Install\Debug).
    • CMAKE_BUILD_TYPE: set to Debug or Release.
    • EXTERNAL_LIBRARIES: set the install path of the dependencies install directory (e.g. Dev\BinPkgs\Install\Debug or Release).
    • PROJECT_TO_BUILD: set the names of the applications to build (see DevSrcApps or DevSrcSamples, ex: VRRender, Tuto01Basic ...), each project should be separated by ”;”.
    • ECLIPSE_PROJECT: check this box if you want to generate an Eclipse project.
  • If you want to generate installers:
    • PROJECT_TO_INSTALL: set the names of the applications you want to install (i.e. VRRender).

Note

  • If PROJECT_TO_BUILD is empty, all application will be compiled
  • If PROJECT_TO_INSTALL is empty, no application will be installed

Warning

Make sure the arguments concerning the compiler (advanced arguments) point to Visual Studio.

  • Generate the code.

  • Compile the FW4SPL source using ninja in the console:

    • go to the build directory (e.g. Dev\Build\Debug or Release)
    • Use “ninja” if you want to compile all the applications set in CMake.
    • Use “ninja name_of_application” to compile only one of the applications set in CMake.
> cd Dev\Build\Debug
> ninja

Launch an application

After a successful compilation the application can be launched with the fwlauncher.exe from FW4SPL. Therefore the profile.xml of the application in the build folder has to be passed as argument.

Note

Make sure that the external libraries directory is set to the path (set PATH=<FW4SPL Binpkgs path>\Debug\bin;<FW4SPL Binpkgs path>\Debug\x64\vc12\bin;%PATH%).

../../_images/launchApp.png

Generate an installer

After setting the applications for which you want to generate installers in the PROJECT_TO_INSTALL variable of CMake and generating the code, follow these two steps:
  • Run ninja install application_to_install in the Build directory
  • Run ninja package in the Build directory

The installer will be generated in the Build directory.