Building TerraGear in Ubuntu 910 (32- or 64-bit): Difference between revisions
No edit summary |
|||
Line 1: | Line 1: | ||
{{Languages|Building terragear-cs in Ubuntu 910 (32- or 64-bit)}} | {{Languages|Building terragear-cs in Ubuntu 910 (32- or 64-bit)}} | ||
This tutorial describes installing a subversion of terragear, terragear'''-cs'''. Do NOT try to install Terragear CVS or an older version of terragear with this tutorial. | This tutorial describes installing a '''recent subversion''' of terragear on Ubuntu910, terragear'''-cs'''. Do NOT try to install Terragear CVS or an older version of terragear with this tutorial. | ||
Note: This tutorial also works for OSX 10.5.8 (intel) and VBox 3.1.2r56127 but does not describe how to install VBox/Ubuntu on your mac. | ''Note: This tutorial also works for OSX 10.5.8 (intel) and VBox 3.1.2r56127 but does not describe how to install VBox/Ubuntu on your mac.'' | ||
Revision as of 12:34, 23 January 2010
Template:Languages This tutorial describes installing a recent subversion of terragear on Ubuntu910, terragear-cs. Do NOT try to install Terragear CVS or an older version of terragear with this tutorial. Note: This tutorial also works for OSX 10.5.8 (intel) and VBox 3.1.2r56127 but does not describe how to install VBox/Ubuntu on your mac.
Basic Install
1. Start with a clean (new) installation of Ubuntu 910 (this sample is with 64-bit, should work also with 32-bit). Do not Update the system after installation with package manager. Skip update (important!).
2. Install the basic packages for git access and development:
* sudo apt-get install git-core curl automake g++ gcc
3. Make a new directory where you download and install the proper packages. You need also to prepare a directory "newmat11" to extract the archive you get from following link. gpc will extract in a directory itself.
4. Download the files inside the new created directory: newmat 11,gpc 2.32:
* http://www.robertnz.net/ftp/newmat11.tar.gz * ftp://ftp.cs.man.ac.uk/pub/toby/gpc/gpc232.zip * git clone http://mapserver.flightgear.org/git/simgear-cs/ * git clone http://mapserver.flightgear.org/git/terragear-cs/
5. Before proceed to compile the main packages, we must understand that terragear-cs depends from simgear-cs, and this last one has many dependencies to satisfy.
* Install libplib-dev (1.8.5-4), libboost1.38-dev, glutg3-dev, libglut3-dev, libjpeg62-dev and xorg-dev via package manager
6. As previous step to compile simgear-cs, don't forget install the next packages:
* sudo apt-get install libopenal-dev libalut-dev openscenegraph zlib1g-dev libopenscenegraph-dev
7. Goto to the directory simgear-cs to start the compilation. Remember that when we download source code with a cvs software as git or svn we need to
generate the configure file: * ./autogen.sh The configure file is now created. * ./configure --with-jpeg-factory * make * sudo make install
8. To follow, we must satisfy 2 more dependencies: gpc and newmat. Unpackage those files and inside each directory:
a) GPC: - Copy and paste the next lines and create a new empty file with the name "Makefile" - Replace "spaces" with tabs in your file and watch out for proper returns/end of line to get a working Makefile: # Unix/Linux makefile for GPC 2.32 # # Riley Rainey (riley.rainey@websimulations.com) CFLAGS = -O -g libgenpolyclip.a: gpc.o rm -f $@ ar cr $@ $< ranlib $@ clean: rm -f libgenpolyclip.a *.o core *~ install: libgenpolyclip.a -mkdir -p /usr/local/lib -mkdir -p /usr/local/include install libgenpolyclip.a /usr/local/lib/libgenpolyclip.a install gpc.h /usr/local/include/gpc.h
- Modify the file gpc.h, searching for "GPC_EPSILON (DBL_EPSILON)" and replace with "GPC_EPSILON (0.000001)" - And -obviously- make and sudo make install.... Done!!!
b) NEWMAT: * make -f nm_gnu.mak * sudo cp libnewmat.a /usr/local/lib * sudo mkdir /usr/local/include/newmat * sudo cp *.h /usr/local/include/newmat
9. Finally and before proceed with the compilation of terragear-cs, we must satisfy some additional libraries:
* sudo apt-get install libwxgtk2.8-dev libcurl4-openssl-dev * Your system ask you to reboot. So reboot.
* Option: If you want to use gdal/OGR-support in terragear-cs: sudo apt-get install libgdal-dev Go to terragear-cs folder: /src/Prep/OGRDecode and remove "-logdi" in Makefile (Line 102) Go to terragear-cs folder: /src/Utils/ and remove "-logdi" in Makefile (Line 118)
After that, inside of the directory terragear-cs: * ./autogen.sh * ./configure
* Option: With gdal/OGR support run "./configure --with-gdal=/usr/bin/gdal-config"
* Not a option at the moment: Point to directory terragear-cs/src/Prep/Terra and open "greedy.cc" * change line "include <iostream>" to "include <cstdio>" (Line 3)
* make * sudo make install
10. Then - maybe you are ready to use terragear.
Optional steps
13. If we wish use the photo command and insert images inside our scenery, we need the chop.pl command:
* sudo gedit /usr/local/bin/chop.pl: Copy and paste the follow code: #!/usr/bin/perl
die "Usage: $0 file xdiv ydiv res\n" if ( $#ARGV != 3 ); $file = shift @ARGV; $xdiv = shift @ARGV; $ydiv = shift @ARGV; $res = shift @ARGV;
die "Must start with a .png file\n" if ( $file !~ m/\.png$/ );
# extract image dimensions
$info = `file $file`; $info =~ s/,//g; ($junk, $type, $junk, $junk, $width, $junk, $height, $junk) = split(/\s+/, $info, 8); print "$width - $height\n";
$basename = $file; $basename =~ s/\.png$//;
# convert source image to pnm `pngtopnm $basename.png > $basename.pnm`;
$dx = $width / $xdiv; $dy = $height / $ydiv;
for ( $j = 0; $j < $ydiv; $j++ ) { for ( $i = 0; $i < $xdiv; $i++ ) { print "Paso $i $j\n"; $x = $dx * $i; $y = $height - $dy * ($j + 1); $outputpnm = sprintf("$basename%X%X.pnm", $i, $j); $outputsgi = sprintf("$basename%X%X.sgi", $i, $j); $outputrgb = sprintf("$basename%X%X.rgb", $i, $j); printf "Diviendo archivos...\n"; printf "pnmcut $x $y $dx $dy $basename.pnm | pnmscale -xysize $res $res > $outputpnm\n"; `pnmcut $x $y $dx $dy $basename.pnm | pnmscale -xsize $res -ysize $res > $outputpnm`; printf "Convirtiendo archivos...\n"; `convert $outputpnm $outputsgi`; printf "Renombrando archivos...\n"; rename($outputsgi, $outputrgb); unlink($outputpnm); } } Save the file. Install those additional packages which allows image manipulation: * sudo apt-get install imagemagick netpbm
14. Install QGIS for scenery edit.
* sudo gedit /etc/apt/source.list Add to the bottom: deb http://ppa.launchpad.net/qgis/ubuntu hardy main Don't forget: * sudo apt-get update * sudo apt-get install qgis qgis-plugin-grass
|