I was thinking a long time ago to write a HOWTO for building OSSIM. Unfortunately it didn’t happened. One reason for not writing is that OSSIM wiki has some tutorials and wiki pages dedicated for this purpose.
So, everything is there.. all you need to do is install a couple of libraries which by the way are available via package manager in every linux distro. (cmake, geotiff, jpeg, png, zlib, qt, ffmpeg). Then configure using cmake and run make, and finally make install!.
Well, cmake configure won’t work straight away with OSSIM. It fails with a bunch of error messages and these are not that helpful and a bit cryptic for a new user. But Once you set the proper module path then nothing to worry.
So What is the big deal with a new HOWTO? It seems trivial or maybe redundant.!. There is already enough material from developer team. Anyway today I decided to overcome these inner voice and here we are..
Do not confuse with another library with same name. This happened recently on OSSIM list
I will start by installing dependencies for OSSIM , checkout sources, cmake configure, build, test and finish by installing OSSIM.
OSSIM requires some external libraries for reading and writing images. For convenience, I will show how to install them on Ubuntu and Fedora. If you are using another distro, then please find the correct package manager and library names(see the difference in Ubuntu vs Fedora)
sudo apt-get install -f subversion cmake libgeotiff-dev libtiff-dev libpng-dev libjpeg-dev zlib-dev libopenthreads-dev
sudo yum install -y subversion cmake libgeotiff-devel libtiff-devel libpng-devel turbojpeg-devel zlib-devel OpenThreads-devel
You can download OSSIM as compressed file (zip/tar). but we are not going to do that. We checkout it using subversion. I checkout my sources into a sub directory in my home (~/packages)
svn co http://svn.osgeo.org/ossim/trunk/ ossim_trunk
I checkout the trunk branch(active development) but you checkout a release branch or a specific tag. See (http://svn.osgeo.org/ossim/ [branches]/[tags])
All configuration and build files are kept in a seperate directory. This is not mandatory in case of OSSIM library and cmake does not prevent in-source-builds. But we do this to have clean source tree.
mkdir ~/packages/build-ossim && cd ~/packages/build-ossim
OSSIM library sources are inside OSSIM sub-directory. ossim_trunk directory which we checked out contains a lot of other libraries such as ossimPlanet, ossimPredator, ossimPlanetQt, ossimGui etc.. We don’t need them to build OSSIM. But the vice-versa is not true.
So we run cmake in the OSSIM sub-directory (~/sources/ossim_trunk/ossim)
Usually running cmake with default option is as easy as:
But in case of OSSIM this command gives a bunch of error messages as I explained in the introduction part. You need to update cmake module path. (CMAKE_MODULE_PATH)
Now, Where are these files? Why are they not included in OSSIM? Why can’t they be auto-detected during configure?
If you are asking above questions, I can try to answer.
Q. Where are these files?
A. These files are in the ossim repository!. They are inside ossim_trunk/ossim_package_support/cmake/CMakeModules
Q. Why are they not included in OSSIM?
A. Maybe(yes!. I said I can try) ossim developers don’t want to have take up space inside the sources!
Q. Why can’t they be auto-detected during configure?
A. Yes. I am there with you for this. But it is up to ossim developers to make this happen. Even though a patch seems trivial.
cmake ~/packages/ossim_trunk/ossim -DOSSIM_MODULE_PATH=~/packages/ossim_trunk/ossim_package_support/cmake/CMakeModules
Start building library using make
Test if everything is fine before installing. Here I run ossim-info on a sample tif image available with OSSIM.
image0.geometry.decimations: (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.projection.ellipse_name: WGS 84
sudo make install
This will install ossim usually to /usr/local.
Done!. Comments or suggestions are most welcomed.
Last Updated: 01/11/2014