This file gives step-by-step instructions for reproducing a full-featured xastir build on Ubuntu 6.10 Edgy Eft system. I have also modified it on 26 April 2007 to apply to the recently-released Ubuntu 7.04 (Feisty Fawn) version; there was only one difference between Edgy and Feisty to worry about (the name of the automake package). I make no claims that it is the most efficient method, as I am a complete neophyte to debian-based systems, but it got me from a fresh Ubuntu install to a working xastir in just a few simple steps. As mentioned in HowTo:Ubuntu 6.06, there is a binary package, but due to the difference in where it installs maps and how it creates the .xastir/config/xastir.cnf file, I chose not to try it. There was also a problem with its dependencies, so I just skipped right to the build-from-source option, which is very easy.
- 1 IMPORTANT NOTE
- 2 If you already installed the binary version
- 3 Preparing the system
- 4 Start installing packages
- 5 Get XASTIR source code
- 6 Build your first version of xastir
- 7 Build the fully-enabled xastir
- 8 Additional points
- 9 Switching to OpenMotif
Until the evening of 11 January 2007, this page recommended installing the "lesstif" widget library. It has been discovered that using lesstif with xastir can lead to segfaults when using some of the messaging dialogs. The OpenMotif library does not have these issues. This document now recommends using OpenMotif instead. If you are starting from scratch, following the directions below will get you a working xastir without these issues. If you have previously installed xastir using lesstif, it is easy to switch to OpenMotif. Please see the section Switching to OpenMotif for details.
If you already installed the binary version
If you installed a binary version of xastir using the "apt-get install xastir" option, you'll have a somewhat outdated version, and it will have installed into /usr instead of /usr/local. The source install described on this page will install into /usr/local, so you'll want to remove your binary install first before following these directions.
If you did a lot of map configuration with the binary install, all of your maps will be in /usr/share/xastir/maps. You'll need to copy those to a safe place before removing the binary install:
mkdir /tmp/maps cp -r /usr/share/xastir/maps/* /tmp/maps
Then remove the binary package:
sudo apt-get remove xastir
You can then follow the instructions below to re-install xastir to /usr/local from sources. Once you're done, copy your maps back to the new installation directory:
sudo cp -r /tmp/maps/* /usr/local/share/xastir/maps
Then you need to edit your ~/.xastir/config/xastir.cnf file to change all occurances of "/usr/share" to "/usr/local/share"
You'll be back in business with a more easily updated xastir.
Preparing the system
- Uncomment the two lines in /etc/apt/sources.list to enable the "universe" repository for binaries and sources. Also uncomment the lines to enable the "multiverse" repository. Alternatively, you can enable universe and multiverse in the Synaptic Package Manager. Multiverse is required for getting OpenMotif, which has a more restrictive license than other packages you'll be installing.
- Run "sudo apt-get update" to let apt build a database of packages now that you've added repositories.
- Make sure you are properly set up to run "sudo" on your system. On my fresh Ubuntu install that was already taken care of for me, but your mileage may vary. See also Notes:Sudo.
Start installing packages
- Get the basic set of build tools:
sudo apt-get install build-essential
This will install compilers, libraries, and headers necessary to get anything else done.
- Get the libraries essential for building xastir:
On Ubuntu 6.10:
sudo apt-get install cvs autoconf automake1.9 xorg-dev libmotif-dev imagemagick gv libxp-dev
On Ubuntu 7.04:
sudo apt-get install cvs autoconf automake xorg-dev libmotif-dev imagemagick gv x11proto-print-dev
These packages are required for the most basic minimum build of xastir. gv is not strictly required, but if you don't install it you will be unable to print. Note that this imagemagick package is not the one that gives you on-line map support, it's the one that provides the "convert" utility needed to create the postscript that gv will use to print. This package and gv are both required to be able to print from xastir even with minimal map support.
- Get additional libraries that will help for extra features:
sudo apt-get install gpsman gpsmanshp proj libpcre3-dev libmagick9-dev libdb4.4-dev python-dev libax25-dev
You can skip this step if all you want is the minimal version of xastir, as none of these packages are necessary for a bare-minimum build. Do this step if you are going to want nice maps, though, as the minimal build is pretty crippled. Python is not necessary for xastir, but will be required if you decide to build gdal later. Don't install the gdal binary package from the repository at this point. We'll do that from sources later if you want gdal support.
Get XASTIR source code
From a development snapshot or stable release
If you're not into living dangerously, your easiest way to get the Xastir source code is from one of the "tarballs" available for download at the Xastir sourceforge site (see the top level of the xastir web site for a link to it). Once you download the file, extract it with "tar xzf filename.tar.gz" (with the obvious replacement of "filename" with whatever your file is called) and follow the remaining instructions here.
From the "bleeding edge" CVS repository
If you really want the latest developments of xastir immediately upon their being made, CVS is the approach for you. In this method, you get your source code directly from the "repository" that the developers use to work on the software. See Notes:CVS for details. Here's the step-by-step method for getting it this way.
In the steps below, you might have to change the "cd" and "mkdir" commands to suit your taste. I like to keep my projects separated rather rigidly into directories, and the steps below reflect my personal style. This does tend to make rather deep directory trees, but makes clean-up easy because everything's separate. Your mileage may vary.
- Prepare your .cvsrc if you don't have one
ls -l ~/.cvsrc # DO NOT DO THE STEPS BELOW IF THE COMMAND ABOVE SHOWS THAT YOU ALREADY HAVE ONE cat > ~/.cvsrc cvs -z3 update -P -d status -v diff -u type control-D to finish creating the file
- Get the source code per README.CVS or Notes:CVS:
You can make different choices here for where you want to store your code. I'm putting it in a tree under my home directory:
mkdir src mkdir src/XASTIR cd src/XASTIR cvs -d:pserver:email@example.com:/cvsroot/xastir login cvs -d:pserver:firstname.lastname@example.org:/cvsroot/xastir co xastir
The "login" line will result in a prompt for a password. Simply hit "Enter" here, as there is no password.
The last command could take a while to finish if you're on a slow link, as there are a lot of files to download.
- Run bootstrap to generate Makefile.am and configure:
cd xastir ./bootstrap.sh
Build your first version of xastir
If you're impatient and want results right now, you can build Xastir with limited features. If you did the third of the "apt-get install" lines above then you'll get the additional capability of on-line maps and GPSMan/GPSManShp capability. If you skipped that step you'll only have built-in map types, which include (among others) APRSDos maps, PocketAPRS maps, and shapefile maps. This is a fairly crippled version, and you can skip this step unless you really want to see something work Right Now.
I always build the code in a separate directory from the source code so I keep the source code tree clean at all times:
cd ~/src/XASTIR mkdir build-initial cd build-initial ../xastir/configure make && sudo make install
This will give you your first functioning version of xastir and you can play around with it until you're tired of having limited map support. I use --with-rtree because this feature, while still listed as "experimental" has a fairly big impact on shapefile rendering performance and should pretty much always be on if you're working with shapefiles.
The version you install here will render shapefiles in a very ugly fashion unless they are from a very specific set. To get better rendering, you want "dbfawk", which you'll get in the next step.
Build the fully-enabled xastir
To finish the job and get a fully-functional version of xastir, you need to get a few more libraries from source code instead of from apt-get. Fortunately, there's a script packaged in with xastir that helps ease the process.
Edit the get-maptools.sh script
In this section, we install several very useful mapping libraries from source code. In recent releases of Ubuntu (8.04, for example), shapelib and libgeotiff are both available through the Synaptic Package Manager. Unfortunately, the Synaptic package for libgeotiff installs the headers in a non-standard place (/usr/include/geotiff/ instead of /usr/include) where Xastir is not looking by default. If you choose to install libgeotiff via Synaptic instead of through source code, you will need additional configure options to build Xastir against libgeotiff.
Back to the show
- Copy the get-maptools.sh script somewhere so you can edit it:
cp ~/src/XASTIR/xastir/scripts/get-maptools.sh ~ cd ~ vi get-maptools.sh (or emacs, or gedit, or whatever you like to use)
- Change the XASDIR definition to point at your XASTIR source code directory. This involves changing the line that says
instead (or whatever the path to your xastir code directory is).
- Change the list of files to install from:
ALL=" http://internap.dl.sourceforge.net/sourceforge/pcre/pcre-6.3.tar.gz http://dl.maptools.org/dl/shapelib/shapelib-1.2.10.tar.gz\ http://dl.maptools.org/dl/proj/proj-4.4.9.tar.gz\ http://dl.maptools.org/dl/geotiff/libgeotiff/libgeotiff-1.2.3.tar.gz\ http://dl.maptools.org/dl/gdal/gdal-1.3.2.tar.gz"
ALL=" http://dl.maptools.org/dl/shapelib/shapelib-1.2.10.tar.gz\ http://dl.maptools.org/dl/geotiff/libgeotiff/libgeotiff-1.2.3.tar.gz\ http://dl.maptools.org/dl/gdal/gdal-1.3.2.tar.gz"
This means you have to remove the lines referencing "proj-4.4.9" and "pcre-6.3" (because we installed them via apt-get already).
Work around a bug in libgeotiff's configure script
It has been observed by more than one person that running the get-maptools script at this point will result in geotiff failing to build properly, giving an error message that looks like this:
/usr/bin/ld: makegeo: hidden symbol `__stack_chk_fail_local' in /usr/lib/libc_nonshared.a(stack_chk_fail_local.oS) is referenced by DSO /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: ld returned 1 exit status
I am posting to this page in this way because it took me a while of googling to find the answer to the issue, and I hope that this page will help someone else when they encounter the same problem in another project.
The problem is that geotiff's configure script will tell the Makefile to run "ld -shared" to build a shared library, and that's not correct with GCC versions 4 and up. This results in a shared library that does not properly include all the references to other shared libraries it's supposed to have. The correct way to build a shared library using gcc 4.x is to use "gcc -shared" instead.
The following ugly hack on get-maptools.sh will fix the problem. This hack was NOT necessary when I build libgeotiff on a system that had been upgraded from 5.10->6.06->6.10, but that seems to be the anomaly, not the rule.
Look for the following block of comments in get-maptools.sh:
#WARNING WARNING WARNING # On any system that uses GCC 4.x as its compiler, it is probably necessary # to uncomment the stuff between here and the next "else". If you see # an error message of the form # /usr/bin/ld: makegeo: hidden symbol `__stack_chk_fail_local' in /usr/lib/libc_nonshared.a(stack_chk_fail_local.oS) is referenced by DSO # /usr/bin/ld: final link failed: Nonrepresentable section on output # collect2: ld returned 1 exit status # when libgeotiff's makefile gets to linking "makegeo", this is your # problem. Uncomment these lines and rerun the script. #----uncomment below-------- # elif [ $XA_LIB = 'libgeotiff-1.2.3' ] # then # #The libgeotiff tar ball has last modification time of the configure # # script and the configure.in from which it's generated such that # # as soon as we type "make", the Makefile tries to regenerate # # configure and then run it with no arguments, interfering with # # our intentions here. So we "touch" configure so it's newer # # than configure.in, and make leaves them alone. The right # # fix would be to change that makefile, but this is easier # touch configure # # # libgeotiff tries to use ld -shared for linking shared library, # # which is wrong on linux with GCC 4.x # ./configure --with-ld-shared="gcc -shared" # make
Uncomment the stuff below the dashed line to enable the fix; to uncomment a line, you remove the "#" character from the beginning of the line. Once you make this change, libgeotiff will build correctly with the stock GCC 4.1 compiler that comes with Ubuntu.
Run the get-maptools.sh script
Run the script:
If you're on a slow dial-up line, this is a good time to catch up on your email, coffee-drinking, or the news. Stay nearby, though, because you'll be prompted for a password every time the script hits an "sudo", which it will do once for each package when it tries to install.
Once get-maptools is done, you should be ready for the final phase.
Build the final code
Above, in the section about editing get-maptools.sh, we pointed out that recent releases of Ubuntu have libgeotiff available in the package repository. If you chose to install this version instead of the source-built version we walked you through, you've got some additional work to do here. You need to add a command line option when you run configure. In this case, where below we say to run "../xastir/configure" you will have to run instead
which instructs configure to add a compiler flag that forces the compiler to look for geotiff's header files where they were installed. If you built and installed libgeotiff from source code as we instructed above, this is unnecessary.
back to the show
You've now got all the libraries in place and can build the fully enabled code. Again, I like to do things in directories separate from the source code to keep the source code directory clean. So:
- Make a new build directory:
cd ~/src/XASTIR mkdir build-full cd build-full
- Configure the code:
You should be rewarded with a list of features that all say "yes" after them. If you followed all the steps in "Start Installing Packages" and did the get-maptools.sh ran with no errors, that should look like this:
xastir 1.8.5 has been configured to use the following options and external libraries:
Building with AX25 ................................. : yes Building with Festival ............................. : yes Building with GPSMan ............................... : yes Building with ImageMagick .......................... : yes Building with libproj .............................. : yes Building with GeoTiff .............................. : yes Building with GDAL/OGR ............................. : yes Building with ShapeLib ............................. : yes Building with pcre ................................. : yes Building with dbfawk ............................... : yes Building with map caching .......................... : yes ---------------------------------------------------------- Building with ErrorPopups (Old Method) ............. : no Building with libgc (Debug) ........................ : no Building with profiling (Debug) .................... : no Building with rtree indexing (Experimental) ........ : yes Building with Linux Standard Base (Experimental) ... : no
Note that on Feisty (Ubuntu 7.04) festival will say "no" unless you've taken the extra steps described in the "festival" section below.
- Build the code:
make && sudo make install
- Enjoy! You now have a fully functional xastir with all features enabled.
The Ubuntu 6.10 install I did gave me festival unbidden as part of the Gnome desktop, which means that the xastir I built following the process above had speech capability enabled from the get-go. I did, however, have to start the festival server by hand in a shell window before starting xastir.
festival --server &
Festival is also automatically started if you enable some of the "Assistive Technologies" in the Gnome desktop. I usually don't, so the command above is necessary.
Clicking File->Configure->Speech in xastir, I could get it to talk just by clicking the "Test" button in the dialog.
On Ubuntu 7.04, festival tools are not installed by default, and so building xastir according to the above directions will not automatically give you festival support. I have not tried it yet, but if you want festival support on Ubuntu 7.04 you should be able to get it by installing the festival-dev package:
sudo apt-get install festival-dev
It might not even be necessary to install the -dev package, you might be able to get away with just the "festival" package. If you try this and it works, please update this wiki page.
GDAL support in xastir is very embryonic, so this doesn't really matter, but the instructions above will build gdal with only a small fraction of its capability. There are lots more features of gdal you can enable by adding more packages (e.g. sqlite3, postgis, netcdf, etc.), but none of these get you more features in xastir. If you use gdal for something more intensive like GRASS GIS or QGIS, you'll want to rebuild gdal after getting more of its optional dependencies installed.
If you plan to use gpsman's graphical user interface you can add the Img library. If you plan on doing much building of open source codes, you probably will need libtool. You do NOT need it for xastir, but it's a fast download and you might as well make sure it's there for later.
sudo apt-get install libtk-img libtool
I chose to do these way up there at the beginning, but since they're completely unnecessary for a basic Xastir install, I stuck them down here instead.
Switching to OpenMotif
If you had previously installed xastir using the lesstif library (i.e. using a previous incarnation of this wiki document as a guide), you can switch to the OpenMotif library by executing the following commands.
sudo apt-get remove lesstif2 sudo apt-get install libmotif-dev
Note that installing libmotif-dev will require that you have the "multiverse" repository enabled --- OpenMotif has a more restrictive license than the GPL, and so it lives in a different repository. To enable multiverse, you can either edit /etc/apt/sources.list and then execute "apt-get update" or you can use the Synaptic Package Manager, choose the "Settings->Repositories" menu, check "Multiverse" and then click the "Reload" button.
You should then go to your Xastir build directory and rebuild xastir from a clean slate. Following the suggestions for directory names above, that would mean:
cd ~/src/XASTIR/build-full make distclean ../xastir/configure make sudo make install
This should cause xastir to be rebuilt with the OpenMotif libraries you just installed. Obviously, you need to change the first "cd" command so that it matches where you actually decided to build Xastir in the previous steps. (Those of you coming here from the HowTo:VMware page, that means instead of "build-full" you just use "build".)
Please note also that once you switch to OpenMotif you will probably see a number of error messages that mention something like:
Character '\55' not supported in font
This annoyance can be stopped by editing the file /etc/environment and changing the line
and then logging out and logging back in again. This is mentioned in the FAQ document, but that document refers to a different file that is not present in Ubuntu.