| 1 | Compiling OSSIM on a 64 bit machine |
| 2 | Date written 20 Jul 2008 |
| 3 | Mark Lucas, |
| 4 | with assistance from Garrett Potts, Scott Bortman, Patrick Depret, and Nikki Burns |
| 5 | |
| 6 | Installing the Source Code: |
| 7 | |
| 8 | Assuming a default installation from source in your home directory: |
| 9 | |
| 10 | cd |
| 11 | mkdir Development |
| 12 | cd Development |
| 13 | mkdir ossimsource |
| 14 | cd ossimsource |
| 15 | |
| 16 | for a system install |
| 17 | cd /usr/local |
| 18 | su |
| 19 | chgrp -R mlucas /usr/local |
| 20 | mkdir ossim |
| 21 | chown mlucas ossim (use your user name instead of mlucas) |
| 22 | chgrp staff /usr/local/ossim (or an appropriate group for access) |
| 23 | chmod 775 ossim |
| 24 | exit |
| 25 | |
| 26 | This approach will allow you to install with out super user privs into /usr/local/ossim |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | To check out the entire source code tree from svn, you must be connected to the internet and type: |
| 32 | |
| 33 | svn co http://svn.osgeo.org/ossim/trunk . (note the trailing dot) |
| 34 | |
| 35 | Alternatively, if you have a packaged source files: |
| 36 | Copy and unpack the files in the Development directory, for example: |
| 37 | |
| 38 | Locate the source files |
| 39 | Copy to the source file location |
| 40 | uncompress them |
| 41 | set up the target directory for the ossim install (/usr/local/ossim shown above) |
| 42 | ensure that all required compiler packages are available on your system |
| 43 | 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. |
| 44 | |
| 45 | 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: |
| 46 | |
| 47 | cd /media/RHEL_5x86_64DVD/Server |
| 48 | |
| 49 | rpm -i glibc-devel-2.4-12.x86-64.rpm |
| 50 | rpm -i glibc-headers-2.4-12.x86_64.rpm |
| 51 | rpm -i libgomp-4.1.1-53.e15.x86_64.rpm |
| 52 | rpm -i gcc-4.1.1-52.e15.x86_64.rpm |
| 53 | rpm -i libstdc++-devel-4.1.1-52.e15.x86_64.rpm |
| 54 | rpm -i gcc-c++-4.1.1-52.e15.x86_64.rpm |
| 55 | rpm -i libjpeg-devel-6b-37.x86_64.rpm |
| 56 | rpm -i pcre-devel-6.6-2.el5_1.7.x86_64.rpm |
| 57 | rpm -i ant - 1.6.5-2jpp.2.x86_64 (need later version 1.7) |
| 58 | |
| 59 | |
| 60 | ossimbashrc |
| 61 | Under the ossim_package_support directory is an ossimbashrc file. |
| 62 | 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: |
| 63 | |
| 64 | source ossimbashrc |
| 65 | |
| 66 | (alternatively you can add this line to your .bashrc file) |
| 67 | |
| 68 | 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. |
| 69 | |
| 70 | 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. |
| 71 | |
| 72 | |
| 73 | cd |
| 74 | mv .bashrc bashrc.old |
| 75 | vi .bashrc |
| 76 | cd /Users/Shared/Development/ossimsource |
| 77 | svn update . |
| 78 | cd ossim_package_support/ |
| 79 | cp ossimbashrc ~/ |
| 80 | cd |
| 81 | |
| 82 | 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. |
| 83 | |
| 84 | vi .bashrc |
| 85 | i |
| 86 | source ossimbashrc |
| 87 | <esc> |
| 88 | :wq |
| 89 | |
| 90 | source .bashrc |
| 91 | |
| 92 | Now we’ll check and use the ‘dev’ alias to change directories |
| 93 | |
| 94 | dev |
| 95 | |
| 96 | The prompt should echo back Development Directory and list any files that are in that directory. |
| 97 | |
| 98 | Gathering the Dependency Source Code |
| 99 | |
| 100 | dev |
| 101 | mkdir ossim_dependencies_source |
| 102 | ods cd ossim_dependencies_source |
| 103 | |
| 104 | |
| 105 | The following dependencies are need to build and can be downloaded into the source directory. URLs are provided |
| 106 | |
| 107 | |
| 108 | Look at http://ossim.telascience.org/ossimdata/sourcesnaps where these dependencies have been provided for your convenience. |
| 109 | |
| 110 | expat http://sourceforge.net/projects/expat/ |
| 111 | openmpi http://www.open-mpi.org/software/ompi/v1.2/ |
| 112 | openmpi-1.2.6.tar.gz |
| 113 | gdal http://trac.osgeo.org/gdal/wiki/DownloadSource |
| 114 | geotiff ftp:://ftp.remotesensing.org/geotiff |
| 115 | libtiff (with bigtiff support) http://ossim.telascience.org/ossimdata/sourcesnaps/libtiff-4.0.0.tgz |
| 116 | Qt4 http://trolltech.com/downloads |
| 117 | OpenSceneGraph 2.4 http://www.openscenegraph.org/projects/osg/wiki/Downloads |
| 118 | OpenThreads use the one from OpenSceneGraph |
| 119 | collada for OpenSceneGraph colladadom_21.tgz in snapshots |
| 120 | |
| 121 | ffmpeg svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg |
| 122 | |
| 123 | |
| 124 | Make an ossim_dependencies directory |
| 125 | |
| 126 | dev |
| 127 | cd ossimsource |
| 128 | mkdir ossim_dependencies |
| 129 | ozd (should move you to ossim_dependencies directory) |
| 130 | |
| 131 | move and uncompress all of the dependencies into this directory |
| 132 | |
| 133 | ozd |
| 134 | tar xvf cmake-2.6.0.tar |
| 135 | tar xvfz colladadom_21.tgz |
| 136 | tar xvfz expat-2.0.1.tar.gz |
| 137 | unzip ffmpeg.zip |
| 138 | tar xvfz gdal-1.5.1.tar.gz |
| 139 | tar xvfz libgeotiff-1.2.3.tgz |
| 140 | tar xvfz libtiff-4.0.0.tgz |
| 141 | tar xvfz openmpi-1.2.6.tar.gz |
| 142 | unzip OpenSceneGraph-2.4.0.zip |
| 143 | tar xvf qt-x11-opensource-src-4.4.0.tar |
| 144 | unzip OpenSceneGraph-Data-2.4.0.zip |
| 145 | tar xvfz jpegsrc.v6b.tar.gz |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | libjpeg to make sure we are picking up 64 bit version |
| 157 | |
| 158 | ozd |
| 159 | cd jpeg-6b |
| 160 | which libtool |
| 161 | ln -s /usr/bin/libtool . |
| 162 | ls |
| 163 | ./configure --prefix=/usr/local --enable-static --enable-shared |
| 164 | make |
| 165 | make install |
| 166 | |
| 167 | ffmpeg |
| 168 | ozd |
| 169 | cd ffmpeg |
| 170 | ./configure --prefix=${INSTALL_HERE} --enable-shared --disable-static |
| 171 | |
| 172 | Note, for mac osx you need to configure |
| 173 | ./configure --prefix=${INSTALL_HERE} --disable-vhook --disable-mmx --enable-shared --disable-static |
| 174 | |
| 175 | make |
| 176 | make install |
| 177 | |
| 178 | The include files don’t line up with code, in the install location created ffmpeg dir and moved the libavs down into it. |
| 179 | |
| 180 | cd ${INSTALL_HERE}/include |
| 181 | mkdir ffmpeg |
| 182 | mv libav* ffmpeg |
| 183 | cd ffmpeg |
| 184 | cp libavcodec/* . |
| 185 | cp libavdevice/* . |
| 186 | cp libavformat/* . |
| 187 | cp libavutil/* . |
| 188 | |
| 189 | EXPAT |
| 190 | Downloaded from http://sourceforge.net/project/downloading.php?group_id=10127&use_mirror=internap&filename=expat-2.0.1.tar.gz&87780402 |
| 191 | |
| 192 | ozd |
| 193 | cd expat-2.0.1 |
| 194 | ./configure --prefix=${INSTALL_HERE} |
| 195 | make |
| 196 | make install |
| 197 | |
| 198 | |
| 199 | libtiff (bigtiff) |
| 200 | |
| 201 | ozd |
| 202 | cd libtiff-4.0.0 |
| 203 | chmod +x configure |
| 204 | ./configure --prefix=${INSTALL_HERE} |
| 205 | make |
| 206 | make install |
| 207 | cd libtiff |
| 208 | cp *.h /usr/local/include |
| 209 | |
| 210 | Geotiff |
| 211 | |
| 212 | ozd |
| 213 | cd libgeotiff-1.2.3 |
| 214 | ./configure --prefix=${INSTALL_HERE} --with-libtiff=${INSTALL_HERE} |
| 215 | rm config.status |
| 216 | ./configure --prefix=${INSTALL_HERE} --with-libtiff=${INSTALL_HERE} |
| 217 | make clean |
| 218 | make |
| 219 | make install |
| 220 | |
| 221 | cd ${INSTALL_HERE}/lib |
| 222 | ls (should see the installed libtiff and libgeotiff libs) |
| 223 | |
| 224 | |
| 225 | |
| 226 | GDAL |
| 227 | |
| 228 | ozd |
| 229 | cd gdal-1.5.1 |
| 230 | ./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) |
| 231 | make clean; |
| 232 | make |
| 233 | make install |
| 234 | |
| 235 | OpenMPI |
| 236 | |
| 237 | |
| 238 | ozd |
| 239 | cd openmpi-1.2.6 |
| 240 | ./configure (had to run this without args first) |
| 241 | ./configure --prefix=${INSTALL_HERE} |
| 242 | make |
| 243 | make install |
| 244 | |
| 245 | OpenSceneGraph 2.4 |
| 246 | |
| 247 | CMake |
| 248 | Will need to make sure that cmake is on the system, if not download and install it |
| 249 | ./bootstrap --prefix=${INSTALL_HERE}; make ; make install |
| 250 | |
| 251 | ozd |
| 252 | cd cmake-2.6.0 |
| 253 | ./bootstrap --prefix=${INSTALL_HERE} |
| 254 | make |
| 255 | make install |
| 256 | |
| 257 | ColladaDOM 2.1 |
| 258 | |
| 259 | The Linux build needs libxml, PCRE, and boost filesytem development files installed on your machine to build the DOM. |
| 260 | |
| 261 | pcre-devel-6.6-2.el5_1.7.x86_64.rpm (install this through the package manager) |
| 262 | pcre-6.6-2.el5_1.7.x86_64.rpm |
| 263 | |
| 264 | ozd |
| 265 | cd colladadom_21m |
| 266 | |
| 267 | cd dom |
| 268 | make all |
| 269 | ih |
| 270 | cd include |
| 271 | mkdir colladadom |
| 272 | |
| 273 | ozd; cd colladadom/dom |
| 274 | edit the Makefile line 179 to read: |
| 275 | prefix :=/usr/local |
| 276 | make install (gets the headers in place then fails) |
| 277 | cd build |
| 278 | cd linux-1.4/ |
| 279 | cp -r libcollada14dom* ${INSTALL_HERE}/lib/ |
| 280 | |
| 281 | OpenSceneGraph |
| 282 | |
| 283 | Note: On the mac, just build OpenSceneGraph with the included xcode project. |
| 284 | |
| 285 | Follow the default install instructions which install in /usr/local |
| 286 | |
| 287 | on unix: |
| 288 | |
| 289 | ozd |
| 290 | cd OpenSceneGraph |
| 291 | ./configure (first time error’d out ) |
| 292 | ./configure |
| 293 | make |
| 294 | |
| 295 | Next steps require admin privileges |
| 296 | make install |
| 297 | exit |
| 298 | ozd |
| 299 | su |
| 300 | cp -r OpenSceneGraph-Data /usr/local/share |
| 301 | exit |
| 302 | |
| 303 | To see if you have OpenSceneGraph installed and running: |
| 304 | ozd |
| 305 | cd OpenSceneGraph-Data |
| 306 | osgviewer cow.osg |
| 307 | press <esc> to quit |
| 308 | |
| 309 | OSSIM |
| 310 | oz |
| 311 | ./configure --prefix=${INSTALL_HERE} --with-libtiff=${INSTALL_HERE} --with-geotiff=${INSTALL_HERE} --with-freetype=/usr --with-mpi=${INSTALL_HERE} --with-openthreads=${INSTALL_HERE} |
| 312 | make depends |
| 313 | make |
| 314 | make install |
| 315 | |
| 316 | libwms |
| 317 | |
| 318 | need to manually copy lib/include to INSTALL_HERE |
| 319 | |
| 320 | oz |
| 321 | cd ../libwms |
| 322 | make |
| 323 | cd bin |
| 324 | cd Linux64/ |
| 325 | cp * ${INSTALL_HERE}/bin/ |
| 326 | cd ${OSSIM_DEV_HOME}/libwms/src/Linux64.Opt (build location for RH E) |
| 327 | cp libwms.so ${INSTALL_HERE}/lib/ |
| 328 | cd ../../include/ |
| 329 | cp -r * ${INSTALL_HERE}/include/ |
| 330 | |
| 331 | ossim_plugins |
| 332 | |
| 333 | |
| 334 | ozd |
| 335 | cd ../ossim_plugins |
| 336 | make all |
| 337 | make install |
| 338 | |
| 339 | typing |
| 340 | cd ${INSTALL_HERE}/lib |
| 341 | ls *_plugin.so |
| 342 | |
| 343 | should return the installed, built plugins |
| 344 | |
| 345 | libossimcontrib_plugin.so libossimgdal_plugin.so libossimpng_plugin.so |
| 346 | |
| 347 | move them into an ossim_plugins directory |
| 348 | |
| 349 | mkdir ossim_plugins (if necessary)opt |
| 350 | mv -r *_plugins.so ossim_plugins |
| 351 | |
| 352 | |
| 353 | ossimPredator |
| 354 | |
| 355 | oz |
| 356 | cd ../ossimPredator |
| 357 | mkdir lib |
| 358 | cd src |
| 359 | make |
| 360 | cd ../lib |
| 361 | cp libossimPredator.so ${INSTALL_HERE}/lib |
| 362 | |
| 363 | ossimPlanet |
| 364 | |
| 365 | opt |
| 366 | cd Make |
| 367 | |
| 368 | edit the makedefs file and uncomment the DEV += -DOSSIMPLANET_ENABLE_PREDATOR |
| 369 | line. |
| 370 | |
| 371 | opt |
| 372 | make |
| 373 | cd src/ossimPlanet/Linux64.Opt (for RH E 5.0) |
| 374 | cp libossimPlanet.so ${INSTALL_HERE}/lib |
| 375 | |
| 376 | opt |
| 377 | cd examples/ossimplanetviewer/Linux64.Opt |
| 378 | cp ossimplanetviewer ${INSTALL_HERE}/bin |
| 379 | |
| 380 | opt |
| 381 | cd include |
| 382 | cp -r ossimPlanet ${INSTALL_HERE}/include |
| 383 | |
| 384 | Copy the reference data in place |
| 385 | from the ossim_package_support directory, do a recursive copy of the images directory to the install location for future retrival, |
| 386 | |
| 387 | cd |
| 388 | mkdir .ossim |
| 389 | opt |
| 390 | cd ../ossim_package_support |
| 391 | cp -r fonts icons geoids images ${INSTALL_HERE}/dotossim |
| 392 | |
| 393 | make a copy in the install location so other users can copy it |
| 394 | |
| 395 | cp -r ${INSTALL_HERE}/dotossim ~/.ossim |
| 396 | |
| 397 | |
| 398 | Trolltech QT 4 |
| 399 | |
| 400 | 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. |
| 401 | |
| 402 | Be sure to configure with the complete path /usr/local/ossim/Trolltech/Qt-4.4.0. |
| 403 | |
| 404 | ozd |
| 405 | cd qt-x11-opensource-src-4.4.0 |
| 406 | ./configure --prefix=${INSTALL_HERE}g/Trolltech/Qt-4.4.0 --fast |
| 407 | make |
| 408 | make install |
| 409 | |
| 410 | |
| 411 | Verification: |
| 412 | which qmake |
| 413 | should return: |
| 414 | /usr/local//Trolltech/Qt-4.4.0/bin/qmake |
| 415 | |
| 416 | OSSIM_QT4 |
| 417 | |
| 418 | oqt |
| 419 | qmake |
| 420 | make |
| 421 | cd bin |
| 422 | mv * ${INSTALL_HERE}/bin/ |
| 423 | cd ../include/ |
| 424 | mv * ${INSTALL_HERE}/include/ |
| 425 | cd ../lib |
| 426 | mv * ${INSTALL_HERE}/lib/ |
| 427 | cd |
| 428 | which imagelinker |
| 429 | imagelinker |
| 430 | |
| 431 | ossimPlanetQt |
| 432 | |
| 433 | oz |
| 434 | cd ../ossimPlanetQt |
| 435 | cd src |
| 436 | vi src.pro |
| 437 | /INSTALL_PREFIX |
| 438 | :177 |
| 439 | |
| 440 | |
| 441 | uncomment the lines 162, 179 to define INSTALL_PREFIX and LOCAL_ROOT to $INSTALL_HERE |
| 442 | |
| 443 | At this approximate location you can uncomment the INSTALL_PREFIX assignment to install at your variable location |
| 444 | |
| 445 | e.g. INSTALL_PREFIX=/usr/local/lib |
| 446 | uncomment the INSTALL_PREFIX=$$ |
| 447 | |
| 448 | also change the LOCAL_ROOT by uncommenting the one with INSTALL_PREFIX |
| 449 | :159 LOCAL_ROOT=/usr/local/ |
| 450 | |
| 451 | |
| 452 | cd .. |
| 453 | make clean |
| 454 | qmake |
| 455 | make |
| 456 | make install |
| 457 | |
| 458 | Changing the src.pro install doesn’t get the application, copy manually |
| 459 | |
| 460 | cp ossimplanet ${INSTALL_HERE}/bin |
| 461 | |
| 462 | Line 184 the -L for LOCAL_ROOT was not in parenthesis and not being picked up. Same with the include line |
| 463 | |
| 464 | added -L$$(INSTALL_PREFIX)/lib in LIBS += lines |
| 465 | |
| 466 | |
| 467 | |
| 468 | |
| 469 | These are some notes that I had on building the NTM plugin |
| 470 | |
| 471 | Compile and install the classified plugin (unix instructions) |
| 472 | |
| 473 | You will find the source for the classified plugin in both the talmage and mlucas accounts. Basically, set the environmental variables, copy it into the ossim_plugins source directory. |
| 474 | |
| 475 | As a user (ex: mlucas), not root |
| 476 | DEV_HOME=<your source tree> |
| 477 | cd $(DEV_HOME)/ossim/ossim_ntm_plugin |
| 478 | vi make.opt to modify the following values |
| 479 | |
| 480 | DEV_HOME=<your source tree> |
| 481 | OSSIM_HOME=$(DEV_HOME)/ossim/build/ossim |
| 482 | OP_DIRECTORY=$(DEV_HOME)/ossim/ossim_ntm_plugin |
| 483 | LD_LIBRARYPATH=${INSTALL_HERE}/lib |
| 484 | |
| 485 | Note: Make sure that these directories jive with the actual locations in the workspace. you will receive errors from the make command if they are incorrect. |
| 486 | |
| 487 | make |
| 488 | |
| 489 | make install |
| 490 | |
| 491 | |
| 492 | Set up ossim_preferences and local variables, copy the plugin to the ossim plugins directory to have it automatically picked up |
| 493 | |
| 494 | Verification, you can run imagelinker and verify that the plugin is loaded. also, |
| 495 | |
| 496 | Added with the 1.7.10 release there is an ossim_plugins command utility that will list the loaded plugins |
| 497 | |
| 498 | |
| 499 | 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. |
| 500 | |
| 501 | OMS - OSSIM Mapping Services |
| 502 | |
| 503 | oz |
| 504 | cd ../oms/com |
| 505 | make |
| 506 | make install (might put it in /usr/local/ossim move includes and libs to /usr/local) |
| 507 | cd ../joms |
| 508 | ant dist |
| 509 | |
| 510 | needed to update ant to 1.7 |
| 511 | |
| 512 | |
| 513 | |
| 514 | ossim preferences file setup |
| 515 | |
| 516 | There is a template under ossim/etc/templates need to fill this out, save (~/ossim_preferences) and |
| 517 | |
| 518 | make sure that |
| 519 | |
| 520 | export OSSIM_PREFS_FILE=~/ossim_preferences |
| 521 | |
| 522 | is set in your bashrc or ossimbashrc file. |
| 523 | |
| 524 | |
| 525 | Note, the ~.ossim subdirectory (dotossim) will be picked up by default in the home directory |
| 526 | |
| 527 | ~/.ossim |
| 528 | |
| 529 | |
| 530 | |
| 531 | |