Chapter 3
Compiling ICE and Monteverdi from source

3.1 Linux and Mac OS X

Compiling ICE and Monteverdi from source follows the same procedure as a regular CMake project: setup a directory for an out-of-source build, configure and compile.

3.1.1 ICE

Setup an out-of-source build environment (this guide uses /ICE but feel free to choose anything):

$ mkdir ~/ICE  
$ cd ~/ICE  
$ git clone https://git@git.orfeo-toolbox.org/git/ice.git  
$ mkdir build  
$ mkdir install

Remember to checkout the develop branch if you want the current development version:

$ cd ~/ICE/ice  
$ git checkout develop

CMake will need to be able to find your OTB installation location. Ensure the OTB_DIR variable is set to FindOTB.cmake file location. For example, if you installed OTB in /OTB/install:

$ cd ~/ICE/build  
$ cmake -DCMAKE_INSTALL_PREFIX=~/ICE/install \\  
        -DOTB_DIR=~/OTB/install/lib/cmake/OTB-5.0 \\  
        ../ice  
$ make  
$ make install

3.1.2 Monteverdi

Make sure OTB is compiled with OTB_USE_QT4 set to ON. Setup another out-of-source build environment for Monteverdi:

$ mkdir ~/monteverdi  
$ cd ~/monteverdi  
$ git clone https://git@git.orfeo-toolbox.org/git/monteverdi2.git  
$ mkdir build  
$ mkdir install

Remember to checkout the develop branch if you want the current development version:

$ cd ~/monteverdi/monteverdi2  
$ git checkout develop

CMake needs to find both OTB, ICE and QWT installation locations. For example, set an CMake cache pre-population script with the following content:

# monteverdi-configuration.cmake  
set(CMAKE_INSTALL_PREFIX "~/monteverdi/install" CACHE STRING "" FORCE)  
set(OTB_DIR "~/OTB/install/lib/cmake/OTB-5.0" CACHE STRING "" FORCE)  
set(ICE_INCLUDE_DIR "~/ICE/install/include" CACHE STRING "" FORCE)  
set(ICE_LIBRARY  "~/ICE/install/lib/libOTBIce.so" CACHE STRING "" FORCE)  
set(QWT_INCLUDE_DIR "/usr/include/qwt5-qt4" CACHE STRING "" FORCE)  
set(QWT_LIBRARY "/usr/lib64/libqwt.so.5" CACHE STRING "" FORCE)

Configure and compile monteverdi:

$ cd ~/monteverdi/build  
$ cmake -C monteverdi-configuration.cmake ../monteverdi2  
$ make  
$ make install

3.2 Windows

Everything that is needed for Ice and Monteverdi development on Windows, including compiling from source, is covered in details on the OTB wiki at:

http://wiki.orfeo-_toolbox.org/index.php/OTB_development_on_Windows