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.
- Install dependencies
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
- Download OSSIM
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)
cd ~/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.band0.max_value: 255 image0.band0.min_value: 1 image0.band0.null_value: 0 image0.band1.max_value: 255 image0.band1.min_value: 1 image0.band1.null_value: 0 image0.band2.max_value: 255 image0.band2.min_value: 1 image0.band2.null_value: 0 image0.driver: ossim_tiff image0.entry: 0 image0.geometry.decimal_degrees_per_pixel_lat: 0.133234641006662 image0.geometry.decimal_degrees_per_pixel_lon: 0.133283968900407 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.gsd: (14820.517849692,14815.032831983) image0.geometry.image_size: (2701,1351) image0.geometry.ll_lat: -89.933382679497 image0.geometry.ll_lon: -179.93335801555 image0.geometry.lr_lat: -89.933382679497 image0.geometry.lr_lon: 179.933358015549 image0.geometry.meters_per_pixel_x: 14820.517849692 image0.geometry.meters_per_pixel_y: 14815.032831983 image0.geometry.projection.central_meridian: 0 image0.geometry.projection.datum: WGE image0.geometry.projection.elevation_lookup_flag: 0 image0.geometry.projection.ellipse_code: WE image0.geometry.projection.ellipse_epsg_code: 7030 image0.geometry.projection.ellipse_name: WGS 84 image0.geometry.projection.false_easting_northing: (0,0) image0.geometry.projection.false_easting_northing_units: meters image0.geometry.projection.major_axis: 6378137 image0.geometry.projection.minor_axis: 6356752.3142 image0.geometry.projection.origin_latitude: 0 image0.geometry.projection.pcs_code: 4326 image0.geometry.projection.pixel_scale_units: degrees image0.geometry.projection.pixel_scale_xy: (0.133283968900407,0.133234641006662) image0.geometry.projection.srs_name: EPSG:4326 image0.geometry.projection.tie_point_units: degrees image0.geometry.projection.tie_point_xy: (-179.93335801555,89.9333826794967) image0.geometry.projection.type: ossimEquDistCylProjection image0.geometry.target_rrds: 0 image0.geometry.tie_point_lat: 89.9333826794967 image0.geometry.tie_point_lon: -179.93335801555 image0.geometry.type: ossimImageGeometry image0.geometry.ul_lat: 89.9333826794967 image0.geometry.ul_lon: -179.93335801555 image0.geometry.ur_lat: 89.9333826794967 image0.geometry.ur_lon: 179.933358015549 image0.lr_x: 2700 image0.lr_y: 1350 image0.number_decimation_levels: 10 image0.number_input_bands: 3 image0.number_lines: 1351 image0.number_output_bands: 3 image0.number_samples: 2701 image0.overview.type: ossimTiffTileSource image0.radiometry: 8-bit image0.type: ossimTiffTileSource image0.ul_x: 0 image0.ul_y: 0 number_entries: 1
- Install OSSIM
sudo make install
This will install ossim usually to /usr/local.
Done!. Comments or suggestions are most welcomed.
Last Updated: 01/11/2014