OTB development on Windows

From OTBWiki
Jump to: navigation, search

We had a wiki page OTB development on Windows With Eclipse to build older version of OTB with Eclipse, mxe, gcc, mingw. You could try same procedure with newer versions. Making same tutorial to work with last OTB release can be done but one has to jump through some hoops.

So.. if that scares you, then use otb with msvc2015. This is tested on a daily basis on Windows 7 & 8.1 VM.

All you have to have is MSVC2015, OTB xdk, and tools archive for windows.

Here is list of steps you can follow:

install msvc2015. Select custom installation and make sure you install c++ compiler


  • download and install python 2.7 to C:\Python27_x64 or C:\Python27_x86

Building OTB with MSVC

  • open cmd.exe and run below code snippets

Setup environment

  set TOOLS_DIR=C:\Tools
  set SYSPATH=C:\Windows\system32;C:\Windows
  set PATH=%PATH%;%TOOLS_DIR%\CMake-3.5.2\bin
  set PATH=%PATH%;%TOOLS_DIR%\patch-2.5.9-7\bin
  set PATH=%PATH%;%TOOLS_DIR%\wget-1.11.4-1\bin
  set PATH=%PATH%;%TOOLS_DIR%\Git-2.9.0\bin
  set PATH=%PATH%;%TOOLS_DIR%\ninja
  set PATH=%PATH%;%TOOLS_DIR%\jom\bin
  set PATH=%PATH%;%TOOLS_DIR%\7zip-16.02
  set PATH=%PATH%;C:\Tools\swigwin-3.0.10
  set PATH=%PATH%;C:\Python27_%COMPILER_ARCH%;C:\Python27_%COMPILER_ARCH%\Scripts

  call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %COMPILER_ARCH%

Configure & Build OTB

   cd c:/dashboard/otb
   git clone --branch=develop https://git.orfeo-toolbox.org/git/otb.git src

  set CMAKE_PREFIX_PATH=c:/dashboard/otb/xdk/OTB-5.9.0-xdk-win64
  cmake ..\src -GNinja