Request for Changes-23: Ice as an Orfeo ToolBox module
Contents
Status
- Author: Julien Michel
- Submitted on 28.01.2016
- Proposed target release: 5.4
- Corresponding git branches:
- Ice: https://git.orfeo-toolbox.org/ice.git/shortlog/refs/heads/ice-as-a-module
- OTB: https://git.orfeo-toolbox.org/otb.git/shortlog/refs/heads/ice-as-a-module and https://git.orfeo-toolbox.org/otb.git/shortlog/refs/heads/ice-as-a-module-full
- Monteverdi: https://git.orfeo-toolbox.org/monteverdi2.git/shortlog/refs/heads/ice-as-a-module
Summary
This RFC is about bringing back Ice inside OTB as a set of modules. This will be a lot simpler for developers and even users.
Rationale
Ice has been a separated project since its creation. There are two main reasons for that:
- Ice has been started as a side project,
- When Ice has been created, we had finally removed all OpenGl stuff from OTB, and did not want to bring them in again.
However, having Ice as a side-project causes a lot of troubles:
- All development process (testing, documentation, packaging ...) have to be duplicated for Ice,
- Ice follows its own version number,
- It causes git branch hell when Monteverdi feature branch requires an ice feature branch that requires an OTB feature branch ...
Now, with OTB 5.0, we moved to a modular architecture, which soften most of the issues we wanted to avoid by bringing Ice into OTB:
- Third parties are deactivated by default
- Module dependency management allow to cleanly and automagically deactivate modules if required third parties are not available
Implementation details
New Modules
Third Party modules
Ice is composed of Ice library and Ice viewer.
Ice library requires the following third parties:
- OpenGL
- Glew
Ice Viewer requires the following third parties:
- GLFW
- GLUT
The 4 new third party have been included as separate modules in Modules/ThirdParty.
New modules and new group
A new group is created in Modules folder : Visualization.
In this Visualization group, two modules can be found:
- Ice: depends on a bunch of OTB modules + OpenGL and Glew
- IceViewer: depends on a bunch of OTB modules + OTBIce + GLFW + GLUT
Changes
Here is the workflow I followed to implement this RFC:
- ice-as-a-module git branch in OTB repo adds the third-party modules and prepare for the 2 new modules in Visualization group (Ice and IceViewer),
- ice-as-a-module git branch in Ice repo contains Ice and IceViewer ready to use modules.
There are not much changes required, only moving files around and creating the necessary files for modules. Sources remain untouched but:
- I took the opportunity to remove some files (namely notesWinRaoul.txt and the NonOptGlActor class which is an old, not fully functioning part of Ice)
- When I first compiled Ice in OTB, I saw a bunch of warnings due to the stricter setup of gcc in OTB project. I also fixed them.
Git dark magic to preserve Ice history
If you checkout ice-as-a-module branch in OTB, and then check out the ice-as-a-module Ice branch in Modules/Visualization, you will get a fully functioning OTB including Ice as modules.
Now the question is: we need to commit the new modules code into OTB repo, so how do we preserve Ice commits history ?
As often, stackoverflow got me the answer:
# Add Ice repo as a new remote repository $ git remote add ice https://git@git.orfeo-toolbox.org/git/ice.git
# Fetch Ice history $ git fetch ice
# Checkout ice-as-a-module Ice branch into a new OTB branch $ git checkout -b ice-as-a-module-import ice/ice-as-a-module
# Move Ice modules to Visualization folder $ mkdir Modules/Visualization $ git mv Ice Modules/Visualization/Ice $ git mv IceViewer Modules/Visualization/IceViewer
# Commit changes $ git commit -m "ENH: Moving Ice files to the Visualization group"
# Create a new branch from the ice-as-a-module one $ git checkout ice-as-a-module $ git checkout -b ice-as-a-module-full
# Merge ice-as-a-module-import branch in it $ git merge ice-as-a-module-import
# Delete ice-as-a-module-import branch and remove remote repo $ git branch -D ice-as-a-module-import $ git remote rm ice
After all those steps, the ice-as-a-module-full branch contains the changes to get Ice as modules in OTB + the full Ice commits history. This process has been done with this revision of the ice-as-a-module Ice branch.
As a side note, this process could be useful in other contexts (for instance when merging a remote module in OTB).
Changes in Superbuild
This is an open issue: I do not know what should be done for OTB Superbuild. Do we leave it as is ? Do we add options to activate the new third parties ? Do we add some of those third parties to external projects ?
Changes in Monteverdi
A small patch is needed to remove all Ice-specific cmake lines and add OTBIce as a required OTB component instead. This patch can be found in ice-as-a-module branch of Monteverdi repo.
Additional notes
- Ice as only very little testing. It would be wise to add some tests.
- Why stopping here ? We could also have in OTB: monteverdi, software guide, cookbook ...