Request for Changes-43: Update SuperBuild cmake script and thirdparty versions

From OTBWiki
Jump to: navigation, search

[Request for Changes - 43] Update SuperBuild cmake script and thirdparty versions

Status

  • Author: Rashad Kanavath
  • Additional Contributors: none
  • Submitted on 21/06/2016
  • Proposed target release : 5.6
  • Adopted : +3 from Victor, Guillaume, Julien
  • Merged : 2dd4bcc0d8438260a56678fc0c1f6257141ae49e

Summary

This RFC propose update of superbuild script with support for msvc2015 and some third party library upgrades. There are lot of improvement in superbuild with this RFC.

Rationale

SuperBuild is tough if not handled with atmost care. This is not on us but split across different third party libraries and pile of compiler and platform otb currently supports. It make users easy to install OTB without worrying about if version x.y.z.1234 work with ITK, OSSIM, GDAL which are used directly in OTB. At the same time, there is cost of maintaining build scripts for all these libraries. we had updated superbuild to ease writing of cmake scripts, patching third party sources.

Implementation details

Below is a list of important changes:

  • CMake generator from the parent is passed to all third party libraries. This is important if you use a non-default CMAKE_GENERATOR. In normal case, it must be passed to all other cmake build.
  • general cmake options such as build_type, shared_libs, install_prefix are prepared and passed to CMAKE_CACHE_ARGS automatically.
  • INCLUDE_ONCE_MACRO does the header guard in single line using cmake's return if system lib is used
  • SUPERBUILD_PATCH_SOURCE grabs the diff files in SuperBuild/patches/<PROJECT>/ and apply them to source tree. This helps to read patches easily and knows if it breaks. This seems better than copying. For instance, in Boost we still copy(patch) 1.54 boost headers with 1.50!. Such copy may lead to serious error and waste more time.
  • OTB_USE_OPENJPEG cmake option is removed for SuperBuild. This is because we already have a gdal with openjpeg and that is sure case.

Third party upgrades

  • GEOS - 3.4.2 -> 3.6.0 with git tag 714127e (for MSVC)
  • Boost - 1.50 -> 1.60 (only for windows)
  • ITK - 4.8.1 -> 4.10.0
  • oepnjpeg - 2.1 -> git revision d0babeb6f6cdd1887308137df37bb2b4724a6592 (including patch from E. Rouaul - pull request 486)

Classes and files

M    SuperBuild/*

Tests

experimental build will be added

Documentation

patch will be an external dependency for SuperBuild.

Additional notes

All patches for a project should go into SuperBuild/patches/project/ directory Naming of patches in SuperBuild:

<project-name-lower-case>-<patch-number>-<a-tiny-description>-<platform-key>.diff

a-tiny-description can be as simple as "fixes"

platform-key must be one of the following for different platforms

  • Windows: win
  • Linux: linux
  • MacOSX: macx

If the patch is to be applied on all platforms then you can use "all". (Thanks to manuel for the fix)

Sample:

  • gdal-1-fixes-macx.diff: This will be applied only to osx
  • ossim-1-fix_cmake-all.diff: This will be applied on all platform
  • ossim-2-fixes-win.diff; This will be applied after ossim-1-fix_cmake-all.diff but only on windows

TODO:

  • add python bindings in OTB build. (for packaging python)
  • check generate package with msvc