OTB development on MacOSX

From OTBWiki
Revision as of 12:19, 27 January 2017 by Thhomas (Talk | contribs) (Prerequisites)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This wiki page is written based on OTB 5.4.0 release but the steps below apply to all version since 5.4.0. This is a brief steps on setting up XDK on MacOX. We haven't tested with XCode or such Mac specific IDE. But it will work now. If you prefer to have an XCode project with XDK, let us know through otb-developers list Link title Make sure you have the below packages installed in your system.

Prerequisites

  • cmake 3.0 or higher
  • AppleClang
  • OSX 10.9 / OSX 10.10
  • OTB XDK (5.4.0 or higher) packages/xdk/
  • git (optional, if you are using source archives from orfeotoolbox.org/packages/

Optionally

  • any IDE(emacs, vim, CodeBlocks, KDevelop, Eclipse) [optional]

Extract XDK

cd /opt
wget https://www.orfeo-toolbox.org/packages/xdk/OTB-5.4/OTB-5.4.0-xdk-Darwin64.run
chmod +x OTB-5.4.0-xdk-Darwin64.run
./OTB-5.4.0-xdk-Darwin64.run

You now will have a directory /opt/OTB-5.4.0-xdk-Darwin64

Configure OTB

mkdir -p /opt/OTB/build && cd /opt/OTB
git clone --depth=1 --branch=develop https://git@git.orfeo-toolbox.org/git/otb.git source

Tip: Anonymous fast checkout using --depth and --branch

Enable OTB_USE_*

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)

Build

cd /opt/OTB/build
cmake /opt/OTB/source -DCMAKE_PREFIX_PATH=/opt/OTB-5.4.0-xdk-Darwin64
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

References

develop/.travis.yml

develop/Utilities/Maintenance/TravisBuild.sh

develop/Utilities/Maintenance/TravisBuild.cmake