Contents

If you want develop into OTB, we highly recommend to made it with Linux platform.

Currently it is not possible to build OTB in Debug based on the OSGeo4W package.
If you want build OTB in Debug for Windows, you need to install manually each dependences needed by OTB (good luck...). Its also offers the possibility to use some other compilers.

This page is dedicated to people who want to install OTB on Windows to made their own developments based on it.

Install the latest release of OTB for Windows

No OTB standalone installer are provided for Windows, you must build the library from source and install it.

Build OTB under Windows OS to install the library and use it into your developments is currently more challenging than under Linux OS.
Therefore we advice to the beginners to go under Linux. For example, we provide OTB packages for Ubuntu. With these, you can easily test and discover OTB functionalities. Please go to section 2.1.3 of the SoftwareGuide.

We will describe here how to install the library with the typical functionalities in Release mode.

Preliminary Steps

To build OTB library under windows the followings conditions are mandatory:

have a Windows version supported: XP SP3 and Seven (these two versions are currently tested)

To manage correctly and easily the dependences of OTB under Windows we strongly recommend to install OSGeo4W tool. This software will provide you all the necessary dependences. Please follow the following steps:

keep as much as possible the default value about root directory and other parameters. You must have the write access to this root directory.

in the next screen, select a local package directory (idem you must have the write access to this directory)

select your Internet connection settings

select the following packages:

gdal

run the installation process

Create a repository (with write access) where store your work (for example at C:\path\to\MyORBDir).
Organize your repository as it :

MyOTBDir\src

MyOTBDir\build

MyOTBDir\install

Retrieve the latest release of OTB: currently 3.16 (you can find the latest source here) and unzip it into the previous src directory.

Configure the OTB solution for Visual Studio

Open a OSGeo4W shell, run the cmake-gui command and follow the following steps:

indicate where are your source (should be C:\path\to\MyORBDir\src)

indicate where to build the source (should be C:\path\to\MyORBDir\build)

run configure

select the appropriate generator ( it should be Visual Studio 10)

run the first configuration pass

you should encounter an error with FLTK, please set the variable OTB_USE_EXTERNAL_FLTK to OFF

CMake should now configure correctly the project

(optional) If you want get some examples to discover the library, you should activate the examples. Therefore set the BUIL_EXAMPLES variable to ON.

If you are interesting by only use OTB into your developments, you should configure only the Release mode. Therefore set the CMAKE_CONFIGURATION_TYPES variable to Release

run again the configure

If CMake indicate that the configuration is done correctly, you can generate the visual studio solution with Generate button.
You can verify that you find into you build directory (should be C:\path\to\MyORBDir\build) the OTB.sln file.

Build the OTB library

Open a OSGeo4W shell and run the following commands:

set the language used by the compiler:

set LANG=C

if you have used the standard OSGeo4W directory, you should run to set the correct environment (otherwise used the right path to o4w_env.bat):

call "C:\OSGeo4W\bin\o4w_env.bat"

(optional) if you have install the otb-bin package from OSGeo4W, you need to reset the following variables to avoid conflicts during the build

set ITK_AUTOLOAD_PATH=
set PYTHONPATH=

move to to your build directory

cd C:\path\to\MyORBDir\build

open the solution into to the OSGeo4W shell: write OTB.sln and push enter

build the OTB solution in Release. Remarks: it could be long.

(optional) in the OSGeo4W shell, move to the bin/Release directory into the build directory and run the Helloworld.exe example.

build the INSTALL project in Release.

you should now have all the OTB install in your install directory (should be C:\path\to\MyORBDir\install).

DEPRECATED

The Prose Version

The main external dependencies to Orfeo on Windows is GDAL. Download prebuilt binaries and headers as appropriate. They are provided by OSGeo4W.