OTB development on Linux
Setting up a development environment on Linux is very easy now. This wiki page is written based on OTB 5.4.0 release but the steps below apply to all version since 5.4.0.
Make sure you have the below packages installed in your system.
- cmake 3.0 or higher
- gcc 4.6 or higher
- OTB XDK (5.4.0 or higher)
- git (optional, if you are using source archives from orfeotoolbox.org/packages/
- any IDE(emacs, vim, CodeBlocks, KDevelop, Eclipse) [optional]
cd /opt wget https://www.orfeo-toolbox.org/packages/xdk/OTB-5.4/OTB-5.4.0-xdk-Linux64.run chmod +x OTB-5.4.0-xdk-Linux64.run ./OTB-5.4.0-xdk-Linux64.run
You now will have a directory /opt/OTB-5.4.0-xdk-Linux64
mkdir -p /opt/OTB/build && cd /opt/OTB git clone --depth=1 --branch=develop https://email@example.com/git/otb.git source
Tip: Anonymous fast checkout using --depth and --branch
By default, all OTB_USE_* variables in OTB are unchecked except for 6S and SiftFast. This is discussed in otb-developers thread in May 2015.
You can check/activate them in your cmake-gui/ccmake. Possible options that can be activated when using XDK are listed below.
OTB_USE_CRUL OTB_USE_MUPARSER OTB_USE_MUPARSERX OTB_USE_OPENCV OTB_USE_LIBKML OTB_USE_SIFTFAST
Attention: Below cmake options are not tested. You can activate them if you need.
OTB_WRAP_PYTHON (untested. If you have python installed on your system. You can test this. But let us know if that works!) OTB_WRAP_JAVA (same reason as python) OTB_USE_OPENJPEG (must be OFF. openjpeg is processed via gdal openjpeg driver. The XDK version of gdal has this driver enabled) OTB_USE_MAPNIK (must be OFF. development files not distributed with XDK)
cd /opt/OTB/build cmake /opt/OTB/source -DCMAKE_PREFIX_PATH=/opt/OTB-5.4.0-xdk-Linux64 make && make install
Tip: Set make -jN where N is the number of cores to speed up your build
Tip: You can also set CMAKE_PREFIX_PATH environment varible using export CMAKE_PREFIX_PATH=/opt/OTB-5.4.0-xdk-Linux64 and run cmake /opt/OTB/source