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.
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)
- have a Windows compiler supported: Microsoft Visual Studio C++ 2010 (Express or Complete version)
You need also to install the following tool to configure and generate the Visual Studio solution of OTB (OTB.sln) and all the visual studio projects:
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:
- download the setup installer
- select the Advanced Install
- select Install from Internet
- 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:
- 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 :
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:
- 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):
- (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
- 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).
The Prose Version
Detailed instructions are available in the OTB Software Guide
Quick start instructions are given for the most common operating systems in the FAQ
Not using the recommended way of getting the dependencies on Windows is still possible, but is left at the user's discretion
FLTK is required for windowing and some GUI demos depend on it. This is included in the OTB repository and not needed separately.
Choose to generate appropriate MSVC project from CMake e.g. Visual Studio 9 2008 for MSVC 2008 Express. Open the project entitled ALL_BUILD and compile it to build the OTB source.
- Install TortoiseHG, MSVC Express, Osgeo4w, CMake
- TortoiseHG - lets you check out the latest code
- MSVC Express - Lets you compile the source
- Osgeo4w - provides dependency libraries for OTB
- CMake - lets you configure the compile system
- Configure the OTB code with CMAKE for building
- Open the solution produced with MSVC and compile/install.
- Repeat configure with cmake/compile with MSVC for Monteverdi
- Run otb/monteverdi from where ever they were installed.
You can also have a look at other Windows issues.