VIRTUAL TERRAIN PROJECT - UNIX BUILD SUMMARY April 2001 Randall Hopper (aa8vb@yahoo.com) I. DEPENDENCY TREE vterrain-apps ver. 010423 - wxWindows (wxGTK) ver. 2.2.5 - tiff ver. 3.5.5 - jpeg ver. 6b - zlib ver. 1.1.3 - vterrain-sdk ver. 010423 - png ver. 1.0.8 - osg ver. 0.8-38 - OpenGL (glut,GLU,etc.) ver. 1.2 - projectionlib ver. 37 (from Dlgv32) - gctpc ver. 1.3 - shapelib ver. 1.2.8 - netcdf ver. 3.5-beta6 - boost dir_it ver. 1.0 NOTES: 1) Each dependency is listed only once, at the deepest possible location in the tree. 2) The versions listed are only those tested together. No doubt other combinations will work, but come back to them if you experience problems. ------------------------------------------------------------------------------ II. DEPENDENCY PACKAGE LOCATIONS ftp://ftp.onshore.com/pub/libtiff/tiff-v3.5.5.tar.gz ftp://ftp.uu.net/graphics/png/src/zlib-1.1.3.tar.gz ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz ftp://ftp.libpng.org/pub/png/src/libpng-1.0.8.tar.gz ftp://unidata.ucar.edu/pub/netcdf/netcdf-3.5-beta8.tar.Z http://edc.usgs.gov/pub/software/gctpc/gctpc.tar.Z ftp://ftpmcmc.er.usgs.gov/release/viewers/dlgv32/source/Dlgv32v37.zip http://www.openscenegraph.org/download/snapshots/osg_src-0.8-38.tar.gz ftp://gdal.velocet.ca/pub/outgoing/shapelib-1.2.8.tar.gz ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source/wxGTK-2.2.4.tar.gz ftp://ftp.vterrain.org/pub/vterrain/dist/TerrainSDK-010423.zip ftp://ftp.vterrain.org/pub/vterrain/dist/TerrainApps-010423.zip http://www.boost.org/libs/dir_it/dir_it.zip NOTE: Many packages are available from other URLs as well ------------------------------------------------------------------------------ III. BUILDING INSTRUCTIONS A. FREEBSD PORTS, REDHAT RPMS, etc. FreeBSD Ports exist for VTerrain and all of its dependencies. So binary packages may already be available. Check for them first: http://www.freebsd.org/ports/ If not, grab the port from the main repository, or here: http://www.freebsd.org/~rhh/vterrain/FREEBSD-PORTS/ if the port hasn't made it there yet. Then unpackage them, and type "make install". These ports were developed on FreeBSD 4.2. It should not be difficult for someone familar with the Linux package managers (Redhat, Debian, etc.) to convert these ports to various Linux flavors so building and installing is simple there as well. B. MANUAL BUILD Your system may already have some of the needed components installed, so check first to save yourself some trouble. If you have problems, come back to the dependency version list above. Note that I've compiled VTerrain on FreeBSD 4.2, Linux Mandrake 7.2, and IRIX 6.5 with both gcc and the native compilers. Folks compiling on those OSs shouldn't have much trouble. See section II for URLs to various packages. Many dependencies will be available here as well for a time: http://www.freebsd.org/~rhh/vterrain/FREEBSD-PORTS/distfiles/ Some of the dependencies require patches to build on UNIX (or certain UNIX flavors), while some are very portable and probably will not. Refer to what the FreeBSD ports are doing for tips and patches: http://www.freebsd.org/~rhh/vterrain/FREEBSD-PORTS/ Also you may want to refer to: http://www.freebsd.org/~rhh/vterrain/FREEBSD-PORTS/pkg_info/ For information on where the various dependency files are being installed on FreeBSD The following is a suggested build order for dependencies. Skip those you already have: 1. ZLIB Supports GNU configure. So to build, just run: "configure", "make", "make install". 2. JPEG GNU configure: "configure", "make", "make install" 3. TIFF GNU configure. 4. PNG make -f scripts/makefile. install 5. NETCDF GNU configure. 6. WXWINDOWS (wxGTK) GNU configure. You'll also want the OpenGL pieces to be built, so specify --with-opengl on the configure command-line. And when you issue make, use: "make all CREATE_LINKS_GL". And when installing, use: "make install CREATE_INSTALLED_LINKS_GL". Use GNU make to build. 7. OPEN SCENE GRAPH (OSG) See the INSTALL in the package for details. But basically, run "make " (use GNU make). Ver. 0.8-38 only knows linux, irix, and irix-std, so use the FreeBSD port for FreeBSD, or adapt the Make/makedefs. and Make/makerules. for your platform if other. 8. SHAPELIB "make lib lib_install" 9. GCTPC Now it starts to get more challenging. This is a description of what the FreeBSD GCTPC port I just wrote does. I prefer to point to original sources and patch those as needed, so the above gctpc URL is a pointer to original source package. It contains huge test datasets which we will remove after installation (alteratively fetch gctpc_src.tar from the same URL -- same version, without the test datasets). Fetch it. Unpackage. cd into the source directory, and run make (use GNU make). You'll then have to manually copy the libraries and includes to your installation directories (/usr/local/include/gctpc, /usr/local/lib -- or whatever your preference). Now also fetch the Dlgv32 app. Copy the following includes out of the package into the GCTPC include installation directory: for_init.h, gctp.h, gctpc.h, inv_init.h, report.h, sphdz.h, untfz.h These are convenience headers for the GCTP library not included in the original distribution. 10. PROJECTIONLIB (from Dlgv32) You've already fetched the Dlgv32 app in the last section. cd into the dlgv32/ProjectionLib subdirectory. You may need patches to get this to build on UNIX (I did). Try the patch-aa included in the FreeBSD port for starters: http://www.freebsd.org/~rhh/vterrain/FREEBSD-PORTS/NEW/\ projectionlib.tgz Now, build everything. Something like this: CC -c -O -I/usr/local/include *.cpp ar ruv libprojection.a *.o ld -shared -o libprojection.so.1 *.o And install by copying headers and libraries to the directories of your choice. In the FreeBSD port, I use /usr/local/lib and /usr/local/include/ProjectionLib. 11. DIR_IT (from Boost) This is meant to be part of boost, but VTP's TerrainSDK links this single module into the vtdata library. In the FreeBSD port, I just fetch it into the TerrainSDK tree, and patch/build it there. However, to avoid having to patch the current VTerrain source, do this: Make a directory tree off some common directory which looks like this: .../APIs/boost/ .../TerrainSDK/ .../TerainApps/ You'll use this for building dir_it as well as the VTerrain SDK and VTerrain Apps packages below. Now cd into APIs/boost. Fetch the dir_it.zip module to this directory, and unzip like so: unzip -j dir_it.zip boost/directory.h src/directory.cpp Now patch these two files using the patches contained in: http://www.freebsd.org/~rhh/vterrain/FREEBSD-PORTS/NEW/\ vterrain-sdk.tgz (in particular, with patch-ab and patch-ac). Ok, good. Now leave them here. The SDK (next step) will compile these in. 12. VTERRAIN SDK Finally, the good stuff! Fetch the TerrainSDK package, and unzip in the .../TerrainSDK/ tree you made above. cd into TerrainSDK. Edit Make.defs and uncomment the section of make definitions for your platform (I've tested so far with SGI IRIX 6.5 with recent gcc and native MIPSpro compilers, as well as on FreeBSD and Mandrake Linux). Note that you'll also want to tweak the list of _DIR, _INC, and _LIB defines at the bottom of Make.defs to point to where you've installed the includes and libraries for the various dependencies. Ok, now "make" (use GNU make). If the stars are aligned correctly, everything will build and you'll end up with these files: TerrainSDK/vtdata/libvtdata.so TerrainSDK/vtlib/vtosg/libvtosg.so 13. VTERRAIN APPS Fetch the TerrainApps package, unzip into the .../TerrainApps/ directory you made above, and cd into it. Copy your Make.defs from TerrainSDK (they're basically copies of each other). Ok, you'll have to edit Makefile and change APPS from "glutSimple wxSimple Enviro" to just "Enviro". The first two are apps not delivered in the TerrainApps distribution. Now "make" (use GNU make). You should end up with a "TerrainApps/Enviro/wxEnviro" executable. Copy to your favorite installed binary directory. NOTE: As of this time, the VTBuilder app hasn't been ported to UNIX. Shouldn't be hard -- just haven't found the time yet. Now you're ready to work with Enviro. See the Virtual Terrain Project web site for instructions and datafiles needed to run the demo. In particular, you'll want to contact the VTerrain project and get links to these datafile ZIPs: TerrainApps-data.zip Enviro-demo.zip These web links may be useful to you: http://www.vterrain.org/Implementation/Apps/Enviro/ http://www.vterrain.org/Request/index.html http://www.vterrain.org/Implementation/unix.html Good luck! If you have questions or feedback, please subscribe to the VTP mailing lists (http://www.vterrain.org/contact.html). For questions about the UNIX port, feel free to post to the list, or mail me directly. Randall Hopper aa8vb@yahoo.com (last update: 4/29/01)