Skip to content
Sections
Personal tools
You are here: Home software Xastir 1.7.1
Document Actions

Xastir 1.7.1

by dr last modified 2006-05-20 06:28 PM

If you don't want to build Xastir try out my binary installer available below. As of 10/18/05 the binary (1.7.1) now includes support for Shapelib, ImageMagick, libProj, GeoTiff, GDAL/OGR, PCRE, Dbfawk, rtree and map caching!

Download binary here

NEW Tiger Note: There seems to be some system changes in Tiger that are causing compiled apps to not be backward compatible with earlier versions of OS X. Specifically, if built with gcc 4.0. To change back to gcc 3.3 (to enhance compatibility) type: 'sudo gcc_select 3.3' before doing anything. Do not install the beta of Xcode 2.1! It will install gcc 4.0.1 which has a number of compiler restrictions. While I believe that Xastir code will now (as of 12/18/05) compile under 4.0.1 there may be other issues that have not shown up yet. Check back here for further updates.


How to get Xastir up and running on OS X
by Dana Rawding, N1OFZ.

There are many ways to get Xastir running on OS X. Unfortunately it can be confusing and even daunting to the average or new OS X user. I have tried to write this How-to from the perspective of the average or 'typical' OS X user. My definition of a typical user is someone who probably upgraded to OS X from OS 9 and has never used or even seen a command line. Only since OS X has there even been an ability to get under the hood of MacOS. I hope this document will help and encourage the typical user to get his hands a little dirty and explore the world of Open Source Software.

Xastir was written for the Linux platform. Lucky for us it is not too difficult to port Xastir to the Mac platform. One of the great things about Linux (and most Unixes) is that you have practically unlimited customization of your system. The bad thing about Linux is that you have practically unlimited customization of your system. For instance, on OS X you have one choice for your default desktop environment. Apple defines and controls it. In Linux you can pick any number of environments (KDE, Gnome and a host of others) and modify them in any way you want. Most of these environments are run on top of X11. Lucky for us that since OS X is based on Unix, X11 is available to us. The problem is there are a number of X11 distros available for OS X. On top of that you have the choice of using package managers such as Fink. Or you can choose to build from the source yourself. I have tried to simplify the installation as much as possible by making all the choices for you. I have selected Apple's X11 with the Fink package manager and Fink Commander. Before going any further you should take a quick read of Apple's X11 primer here.



Above picture is Xastir using tiger maps. Here and here are examples of topo maps. Here is an example of a terra server map. You can see many more map examples here.

Let's get started...

Install Developer Tools:
In order to be able to build an application on OS X you will need at least a compiler and some OS X libraries & headers. Apple has made this easy by providing everything you need on one CD. So grab your Apple Developer Tools from CD that came with your OSX software. If you purchased a machine with OSX preinstalled or you do not have this CD you will have to go to Apple's site (look for ADC) and sign up as a developer. The entry level developer membership is free and will allow you to download many nice tools as well as the entire Developer Toolkit. Install the Developer Tools as you would any other program. **Panther Note** All the Developer Tools are on the XCode CD. Install Mac OS X SDK, BSD SDK, X11 SDK. **Tiger Note** Everything you need is on the DVD.

Install X11:
We now need to install X11 for OS X. Download and install Apple's X11 disto from http://www.apple.com/downloads/macosx/apple/x11formacosx.html. Make sure while you are on the download page you grab and install the SDK. It will be important to have when you compile your application. **Panther/Tiger Note** If you have Panther you can install X11 from the 3rd install CD (or on the DVD for Tiger).

Install the Fink package manager:
Once you have X11 running go to http://fink.sourceforge.net/download/index.php and download the Fink package. Install per the instructions. Please make sure you run pathsetup after fink is installed. (If later you find that when you go to compile you are not able to locate some of the libraries type in a terminal: 'printenv'. Check to see if your path line looks like this: PATH=/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin. If not please run /sw/bin/init.csh.) Once installed go back to the Fink disk image and look for the Fink Commander folder. Copy the Fink Commander app to you Applications folder. If you can not find the Fink Commander app go to http://finkcommander.sourceforge.net. Now launch Fink Commander and select and install the following packages and their dependencies. Please note that there will be about 26 additional dependent installed. This is normal. Please mind my recommended packages. Newer packages may exist but they have not been tested and I have had reports of some newer packages breaking things.

autoconf2.5
automake1.7
lesstif, lesstif-bin, lesstif-shlibs

Optional software:
The below packages are optional but many of the nice Xastir features will not work without them. So select these packages and install them as well:

curl
db42 & db42-shlibs (for the new map caching function)
gdal, gdal-dev, gdl-shlibs imagemagick
lcms
libjpeg
libpng3
libtiff
libxml2
pcre, pcre-shlibs, pcre-bin
proj, proj-shlibs wget

The only software you can not install from Fink Commander is shapelib and geotiff. In order to install shaplib, grab the source from http://wetnet.net/~we7u/xastir/shapelib/shapelib-1.2.10.tar.gz. To complicate matters more the Makefile does not work. Fortunately, Bill Owen, N2RKL, came up with the following procedure to build and install shapelib:

from a X11 terminal window:
go to the directory that you downloaded the shapelib source with the cd command then type in the following list of commands:
tar -xvzf shapelib-1.2.10.tar.gz
cd shapelib-1.2.10
cc -c shpopen.c
cc -c shptree.c
cc -c dbfopen.c
ar cru libshp.a shpopen.o shptree.o dbfopen.o
sudo cp libshp.a /sw/lib
sudo ranlib /sw/lib/libshp.a
sudo mkdir /sw/include/libshp
sudo cp shapefil.h /sw/include/libshp

To install geotiff go to http://www.remotesensing.org/geotiff/geotiff.html and get the latest source. Then do the following commands:
tar -xvzf libgeotiff-1.2.2.tar.gz
cd libgeotiff-1.2.2
./configure --prefix=/sw
make
sudo make install
sudo ranlib /sw/lib/libgeotiff.a

install Xastir: Download Xastir from http://www.xastir.org and put it in your home directory. You may want to keep the source directory after you finish installing. It will make things easier if you want to update Xastir later via CVS.

from a X11 terminal window type in the following list of commands:
tar -xvzf xastir* (for example tar -xvzf xastir121-2003-Jul-02.tgz)
mv xastir* xastir
cd xastir
./bootstrap.sh
./configure --prefix=/sw --with-rtree
make
sudo make install-strip

if you want to enable map caching use
./configure --prefix=/sw --with-rtree --with-bdb-incdir=/sw/include/db4 --with-bdb-libdir=/sw/lib instead of just ./configure

I recommend installing everthing in /sw. This will make your builds compatible with the binary installer. Everything (except your prefs) will be located in /sw. If there is ever a problem you can just delete the sw folder and your machine is clean. It also makes it easy to move Xastir to another machine. Just copy the sw folder onto the new machine. Install X11 and you are done!

That's it! You can now run Xastir from an X terminal window with: /sw/bin/xastir. Or add it to the X11 Application menu. Do this by going to the Applications pull down and select Customize. Click the 'add item' button. Double click the blank hi-lighted line under the name column. Type in 'Xastir'. Next double click under the Command column and type '/sw/bin/xastir'. Click the done button. Now you can launch Xastir from the Applications menu.

You should now spend some time reading all the Xastir documentation. In case you need to know where the Xastir files are located on your system please reference the following:

/Users/"username"/xastir - this folder contains the Xastir source. It can be deleted but I recommend keeping it for future software upgrades
/Users/"username"/.xastir - this is a hidden directory and contains all your personal configuration files
/sw/bin/xastir - this is where the Xasir application resides
/sw/share/xastir - this is where you will put maps and such

Good Luck
Dana
N1OFZ