Compiling documentation

From OTBWiki
Jump to: navigation, search

Requirements

You will need a version of OTB compiled with the following variables set to ON:

  • BUILD_EXAMPLES
  • All OTB_USE_* variables (i.e. build all OTB modules)
  • OTB_WRAP_PYTHON

Additionally you will need the following packages (for fedora):

texlive-scheme-full texlive-tex4ht xfig transfig ImageMagick latex2html

Checking out the repository

The documentation repository contains multiple projects, therefore an out of source build is recommended. Currently, the cookbook lives in otb-documents, while the software guide is in OTB main tree in Documentation/SoftwareGuide.

mkdir otb-documents
cd otb-documents
git clone https://git@git.orfeo-toolbox.org/git/otb-documents.git

Create a build directory and sub-directories for each project:

mkdir -p build/Cookbook
mkdir -p build/SoftwareGuide

Environment variables

In your shell, make sure that:

  • PYTHONPATH contains OTB's lib/otb/python install directory. For example, if OTB was installed to ~/install:
export PYTHONPATH=$PYTHONPATH:~/install/lib/otb/python
  • LD_LIBRARY_PATH contains the lib directory of OTB and all its dependencies (ITK, OSSIM...). In particular:
~/install/lib
~/install/itk/stable/Release/lib
~/install/ossim/stable/lib64

CMake cache variables

Make sure the following CMake variables are set:

  • ITK_DIR: ITK's directory containing the cmake config script (e.g. ~/install/itk/stable/Release/lib/cmake/ITK-4.7)
  • OTB_DATA_ROOT: directory containing the otb-data repository
  • OTB_DATA_LARGEINPUT_ROOT: LargeInput directory (e.g. /media/TeraDisk2/LargeInput)
  • OTB_DIR: OTB's directory containing the cmake config script (e.g. ~/install/lib/cmake/OTB-5.0)
  • OTB_SOURCE_DIR: directory containing the otb repository

You can set it manually or prepopulate the cache with cmake -C your_configuration.cmake.

Compiling

Cookbook

If you are using the suggested directory structure:

cd otb-documents/build/Cookbook
cmake -C your_configuration.cmake ../../otb-documents/Cookbook
make

You will also need to set OTB_PYTHON_PATH and maybe OpenCV_DIR.

Software Guide

First, set BUILD_FIGURES to ON in the CMake cache. Then, if you are using the suggested directory structure:

cd build/SoftwareGuide
cmake -C your_configuration.cmake ../../otb/Documentation/SoftwareGuide
make
make

More than one make may be necessary to ensure the generation of the index.

If BUILD_FIGURES is set to ON, the examples source files are parsed for command line argument tags and if found executed to generate output images, if not the images are expected to be present in the Art/ folder in PNG/XFIG/JPEG/EPS format. Since generating figures may take a while, you may set BUILD_FIGURES to OFF. In this case, all figures are expected to be present in the Art/ folder in PNG/XFIG/JPEG/EPS format.

If you cannot compile the Software Guide or Cookbook following this procedure please send a message to the otb-developers mailing list.

Common compilation errors

Cookbook

Traceback (most recent call last):
  File "/home/poughonv/cnes/ap/otb/otb-documents/otb-documents/CookBook/Scripts/otbGenerateWrappersLatexDoc.py", line 2
, in <module>
    import otbApplication
ImportError: No module named otbApplication
Latex/CMakeFiles/AppRefDocTex.dir/build.make:57: recipe for target 'Latex/CMakeFiles/AppRefDocTex' failed
make[2]: *** [Latex/CMakeFiles/AppRefDocTex] Error 1
CMakeFiles/Makefile2:95: recipe for target 'Latex/CMakeFiles/AppRefDocTex.dir/all' failed
make[1]: *** [Latex/CMakeFiles/AppRefDocTex.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Make sure that your PYTHONPATH contains OTB's lib/otb/python install directory.


***
*** This file requires `listings.sty' version 1.5c.
*** You have a serious problem, so I'm exiting ...
***

Delete CookBook/Latex/listings.sty in the source directory, and delete Latex/listings.sty in the build directory.

Software Guide

   /bin/sh: /home/poughov/build/SuperBuild-develop/install/bin/ImageAdaptor4: Aucun fichier ou dossier de ce type
   make[2]: *** [Art/Generated/ImageAdaptorThresholdingA.png] Erreur 127
   make[1]: *** [Examples/CMakeFiles/SoftwareGuideExamples.dir/all] Erreur 2
   make: *** [all] Erreur 2

Make sure OTB is built with BUILD_EXAMPLES=ON.