Compiling OSSIM on a 64 bit machine Date written 20 Jul 2008 Mark Lucas, with assistance from Garrett Potts, Scott Bortman, Patrick Depret, and Nikki Burns Installing the Source Code: Assuming a default installation from source in your home directory: {{{ cd mkdir Development cd Development mkdir ossimsource cd ossimsource }}} for a system install {{{ cd /usr/local su chgrp -R mlucas /usr/local mkdir ossim chown mlucas ossim (use your user name instead of mlucas) chgrp staff /usr/local/ossim (or an appropriate group for access) chmod 775 ossim exit }}} This approach will allow you to install with out super user privs into /usr/local/ossim To check out the entire source code tree from svn, you must be connected to the internet and type: {{{ svn co http://svn.osgeo.org/ossim/trunk .      (note the trailing dot) }}} Alternatively, if you have a packaged source files: Copy and unpack the files in the Development directory, for example: * Locate the source files * Copy to the source file location * uncompress them * set up the target directory for the ossim install (/usr/local/ossim shown above) * ensure that all required compiler packages are available on your system * Verify that all required complier components exist on the system. If the target OS is Redhat Enterprise 5, any missing packages can be obtained from the Install DVD #1 of 1 (for 64 bit AMD and Intel64). Note, some of the underscores may be dashes and vice versa. The rpm installs were on a RHEL 5 server with no development libraries installed. If the packages are already on the machine, the following commands will simply report that it is already installed. No harm will come from running these items. If there is arequired package that is not available, the rpm program will report this as well. In that event, just find the required packages, install and add it to the list below: {{{ cd /media/RHEL_5x86_64DVD/Server rpm -i glibc-devel-2.4-12.x86-64.rpm rpm -i glibc-headers-2.4-12.x86_64.rpm rpm -i libgomp-4.1.1-53.e15.x86_64.rpm rpm -i gcc-4.1.1-52.e15.x86_64.rpm rpm -i libstdc++-devel-4.1.1-52.e15.x86_64.rpm rpm -i gcc-c++-4.1.1-52.e15.x86_64.rpm rpm -i libjpeg-devel-6b-37.x86_64.rpm rpm -i pcre-devel-6.6-2.el5_1.7.x86_64.rpm rpm -i ant - 1.6.5-2jpp.2.x86_64 (need later version 1.7) }}} ossimbashrc Under the ossim_package_support directory is an ossimbashrc file. These build instruction assume the use of the ossimbashrc file. It includes a number of environmental variables and alias’s that are used in the build instructions. When you open a terminal to perform these instructions, be sure to source the file: {{{ source ossimbashrc }}} (alternatively you can add this line to your .bashrc file) Instructions for building the OSSIM distribution on unix systems. This tutorial tracks an install of the OSSIM distribution from July 2008 on a freshly installed version of Red Hat Enterprise 5.0 x86-64. This tutorial assumes a build out of a home directory Development folder with default installation at /usr/local/ossim as defined by the INSTALL_HERE environmental variable. The entire OSSIM distribution contains many source directories and dependencies. Proper set up of the environmental variables used during the build is key to a successful build from source code. Please source the ossimbashrc file. {{{ cd mv .bashrc bashrc.old vi .bashrc cd /Users/Shared/Development/ossimsource svn update . cd ossim_package_support/ cp ossimbashrc ~/ cd }}} Now edit the ossimbashrc file to point to your Development directory. This is the directory where all of the source code exists. The default ossimbashrc defaults to Development in your home directory. {{{ vi .bashrc i source ossimbashrc :wq source .bashrc }}} Now we’ll check and use the ‘dev’ alias to change directories {{{ dev }}} The prompt should echo back Development Directory and list any files that are in that directory. The following dependencies are need to build and can be downloaded into the source directory. URLs are provided Look at http://ossim.telascience.org/ossimdata/sourcesnaps where these dependencies have been provided for your convenience. {{{ expat http://sourceforge.net/projects/expat/ openmpi http://www.open-mpi.org/software/ompi/v1.2/openmpi-1.2.6.tar.gz gdal http://trac.osgeo.org/gdal/wiki/DownloadSource geotiff ftp:://ftp.remotesensing.org/geotiff libtiff (with bigtiff support) http://ossim.telascience.org/ossimdata/sourcesnaps/libtiff-4.0.0.tgz Qt4 http://trolltech.com/downloads OpenSceneGraph 2.6.1 http://www.openscenegraph.org/projects/osg/wiki/Downloads OpenThreads use the one from OpenSceneGraph collada for OpenSceneGraph colladadom_21.tgz in snapshots ffmpeg svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg }}} Make an ossim_dependencies directory {{{ dev cd ossimsource mkdir ossim_dependencies ozd (should move you to ossim_dependencies directory) }}} move and uncompress all of the dependencies into this directory {{{ ozd tar xvf cmake-2.6.0.tar tar xvfz colladadom_21.tgz tar xvfz expat-2.0.1.tar.gz unzip ffmpeg.zip tar xvfz gdal-1.5.1.tar.gz tar xvfz libgeotiff-1.2.3.tgz tar xvfz libtiff-4.0.0.tgz tar xvfz openmpi-1.2.6.tar.gz unzip OpenSceneGraph-2.4.0.zip tar xvf qt-x11-opensource-src-4.4.0.tar unzip OpenSceneGraph-Data-2.4.0.zip tar xvfz jpegsrc.v6b.tar.gz }}} libjpeg to make sure we are picking up 64 bit version {{{ ozd cd jpeg-6b which libtool ln -s /usr/bin/libtool . ls ./configure --prefix=/usr/local --enable-static --enable-shared make make install }}} ffmpeg {{{ ozd cd ffmpeg ./configure --prefix=${INSTALL_HERE} --disable-vhook --disable-mmx --enable-shared --disable-static make make install }}} The include files don’t line up with code, in the install location created ffmpeg dir and moved the libavs down into it. {{{ cd ${INSTALL_HERE}/include mkdir ffmpeg mv libav* ffmpeg cd ffmpeg cp libavcodec/* . cp libavdevice/* . cp libavformat/* . cp libavutil/* . }}} EXPAT Downloaded from http://sourceforge.net/project/downloading.php?group_id=10127&use_mirror=internap&filename=expat-2.0.1.tar.gz&87780402 {{{ ozd cd expat-2.0.1 ./configure --prefix=${INSTALL_HERE} make make install }}} libtiff (bigtiff) {{{ ozd cd libtiff-4.0.0 chmod +x configure ./configure --prefix=${INSTALL_HERE} make make install cd libtiff cp *.h /usr/local/include }}} Geotiff {{{ ozd cd libgeotiff-1.2.3 ./configure --prefix=${INSTALL_HERE} --with-libtiff=${INSTALL_HERE} rm config.status ./configure --prefix=${INSTALL_HERE} --with-libtiff=${INSTALL_HERE} make clean make make install cd ${INSTALL_HERE}/lib ls (should see the installed libtiff and libgeotiff libs) }}} GDAL {{{ ozd cd gdal-1.5.1 ./configure --prefix=${INSTALL_HERE} --with-libtiff=${INSTALL_HERE} --with-libgeotiff=${INSTALL_HERE} --with-expat-inc=${INSTALL_HERE}/include --with-expat-lib=${INSTALL_HERE}/lib --with-expat=${INSTALL_HERE) make clean; make make install }}} OpenMPI {{{ ozd cd openmpi-1.2.6 ./configure (had to run this without args first) ./configure --prefix=${INSTALL_HERE} make make install }}} CMake Will need to make sure that cmake is on the system, if not download and install it {{{ ozd cd cmake-2.6.0 ./bootstrap --prefix=${INSTALL_HERE} make make install }}} ColladaDOM 2.1 The Linux build needs libxml, PCRE, and boost filesytem development files installed on your machine to build the DOM. {{{ pcre-devel-6.6-2.el5_1.7.x86_64.rpm (install this through the package manager) pcre-6.6-2.el5_1.7.x86_64.rpm ozd cd colladadom_21m cd dom make all ih cd include mkdir colladadom ozd; cd colladadom/dom edit the Makefile line 179 to read: prefix :=/usr/local make install (gets the headers in place then fails) cd build cd linux-1.4/ cp -r libcollada14dom* ${INSTALL_HERE}/lib/ }}} OpenSceneGraph Note: On the mac, just build OpenSceneGraph with the included xcode project. Follow the default install instructions which install in /usr/local on unix: {{{ ozd cd OpenSceneGraph ./configure (first time error’d out ) ./configure make }}} Next steps require admin privileges {{{ make install exit ozd su cp -r OpenSceneGraph-Data /usr/local/share exit }}} To see if you have OpenSceneGraph installed and running: {{{ ozd cd OpenSceneGraph-Data osgviewer cow.osg press to quit }}} OSSIM {{{ oz ./configure --prefix=${INSTALL_HERE} --with-libtiff=${INSTALL_HERE} --with-geotiff=${INSTALL_HERE} --with-freetype=/usr --with-mpi=${INSTALL_HERE} --with-openthreads=${INSTALL_HERE} make depends make make install }}} libwms need to manually copy lib/include to INSTALL_HERE {{{ oz cd ../libwms make cd bin cd Linux64/ cp * ${INSTALL_HERE}/bin/ cd ${OSSIM_DEV_HOME}/libwms/src/Linux64.Opt (build location for RH E) cp libwms.so ${INSTALL_HERE}/lib/ cd ../../include/ cp -r * ${INSTALL_HERE}/include/ }}} ossim_plugins {{{ ozd cd ../ossim_plugins make all make install }}} typing {{{ cd ${INSTALL_HERE}/lib ls *_plugin.so }}} should return the installed, built plugins libossimcontrib_plugin.so libossimgdal_plugin.so libossimpng_plugin.so move them into an ossim_plugins directory {{{ mkdir ossim_plugins (if necessary)opt mv -r *_plugins.so ossim_plugins }}} ossimPredator {{{ oz cd ../ossimPredator mkdir lib cd src make cd ../lib cp libossimPredator.so ${INSTALL_HERE}/lib }}} ossimPlanet {{{ opt cd Make }}} edit the makedefs file and uncomment the DEV += -DOSSIMPLANET_ENABLE_PREDATOR line. {{{ opt make cd src/ossimPlanet/Linux64.Opt (for RH E 5.0) cp libossimPlanet.so ${INSTALL_HERE}/lib opt cd examples/ossimplanetviewer/Linux64.Opt cp ossimplanetviewer ${INSTALL_HERE}/bin opt cd include cp -r ossimPlanet ${INSTALL_HERE}/include }}} Copy the reference data in place from the ossim_package_support directory, do a recursive copy of the images directory to the install location for future retrival, {{{ cd mkdir .ossim opt cd ../ossim_package_support cp -r fonts icons geoids images ${INSTALL_HERE}/dotossim }}} make a copy in the install location so other users can copy it {{{ cp -r ${INSTALL_HERE}/dotossim ~/.ossim }}} Trolltech QT 4 This is a fairly lengthy install, so we use the --fast switch to install the minimum. QT is the cross platform GUI system used by imagelinker, iview and ossimplanet. Be sure to configure with the complete path /usr/local/ossim/Trolltech/Qt-4.4.0. {{{ ozd cd qt-x11-opensource-src-4.4.0 ./configure --prefix=${INSTALL_HERE}/Trolltech/Qt-4.4.0 --fast make make install }}} Verification: {{{ which qmake }}} should return: {{{ /usr/local//Trolltech/Qt-4.4.0/bin/qmake }}} OSSIM_QT4 {{{ oqt qmake make cd bin mv * ${INSTALL_HERE}/bin/ cd ../include/ mv * ${INSTALL_HERE}/include/ cd ../lib mv * ${INSTALL_HERE}/lib/ cd which imagelinker imagelinker }}} ossimPlanetQt {{{ oz cd ../ossimPlanetQt cd src vi src.pro /INSTALL_PREFIX :177 }}} uncomment the lines 162, 179 to define INSTALL_PREFIX and LOCAL_ROOT to $INSTALL_HERE At this approximate location you can uncomment the INSTALL_PREFIX assignment to install at your variable location e.g. INSTALL_PREFIX=/usr/local/lib uncomment the INSTALL_PREFIX=$$ also change the LOCAL_ROOT by uncommenting the one with INSTALL_PREFIX :159 LOCAL_ROOT=/usr/local/ {{{ cd .. make clean qmake make make install }}} Changing the src.pro install doesn’t get the application, copy manually {{{ cp ossimplanet ${INSTALL_HERE}/bin }}} Line 184 the -L for LOCAL_ROOT was not in parenthesis and not being picked up. Same with the include line added -L$$(INSTALL_PREFIX)/lib in LIBS += lines to use the ossim commands, the startup environment will need to be modified for any user that wants to use them.  Need to have LD_LIBRARY_PATH variable set in the appropriate shell file (.cshrc or .bashrc).  Any custom ossim_preferences should be in a local version of the ossim_preferences in a users home directory.  Otherwise, all preferences will come from the system level file. OMS - OSSIM Mapping Services {{{ oz cd ../oms/com make make install (might put it in /usr/local/ossim move includes and libs to /usr/local) cd ../joms ant dist }}} needed to update ant to 1.7 ossim preferences file setup There is a template under ossim/etc/templates need to fill this out, save (~/ossim_preferences) and make sure that {{{ export OSSIM_PREFS_FILE=~/ossim_preferences }}} is set in your bashrc or ossimbashrc file. Note, the ~.ossim subdirectory (dotossim) will be picked up by default in the home directory ~/.ossim