This guide gives step-by-step instructions for installing Xastir from source on OS X 10.5.6 with GraphicsMagick, pcre/dbfawk, rtree, internet maps (libcurl), libproj and GeoTiff (USGS Topos & Aerial Photos).
Edits I made on Feb 16, 2010 include changes needed for OS X 10.6.2 and adding Oracle Berkeley DB. Dick R - KC8OBZ.
You will need Xcode Developer Tools to compile Xastir. This can be downloaded from Apple, or installed via the Leopard DVD that came with your Mac. I chose to download the newest package, but it's about 1GB, so I recommend using your DVD.
The Snow Leopard DVD also contained a copy of Xcode Developer Tools, but running Apple Software Update updated it almost immediatly, so it may be easier to simply install the latest from Apple as described below.
Also, Apple recommends doing a Software Update after any major upgrade.
Leopard (and Snow Leopard) includes X11 by default, so you don't have to worry about this anymore. If you're using an older version of OS X, X11 should be available on your OS X installation media.
Some people have reported problems with Fink. I haven't encountered any yet so I still use it. Fink is a package manager that will keep you from having to build all the Xastir dependencies from source.
I also continue to use fink. I have had problems with FinkCommander (the GUI interface for Fink) but the core utilities continue to work fine. Dick.
or use Fink.
fink install openmotif4
I'm lazy, so I installed pcre with fink:
sudo apt-get install pcre
OR
fink install pcre
Alternatively, you can install this from source.
I installed this one from source.
tar zvxf GraphicsMagick-1.3.5.tar.gz cd GraphicsMagik-1.3.5 ./configure --without-perl make sudo make install
I used fink successfully.
fink install graphicsmagick graphicsmagick-dev
libGeoTiff depends on libtiff and proj. I installed these with fink:
sudo apt-get install libtiff proj
To install libGeoTiff:
tar zvxf libgeotiff-1.2.5.tar.gz cd libgeotiff-1.2.5 ./configure --with-libtiff=/sw --with-proj=/sw make sudo make install
fink install db48
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
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:anonymous@xastir.cvs.sourceforge.net:/cvsroot/xastir login cvs -d:pserver:anonymous@xastir.cvs.sourceforge.net:/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.
I prefer to use the update-xastir script to update/configure/build/install xastir because it is only one command. For this to work, you will need to edit the ./configure line in update-xastir.
mate ~/src/XASTIR/update-xastir
nano comes installed with OS X, so I use it. Dick.
./configure --with-motif-includes=/usr/OpenMotif/include/ --with-motif-libs=/usr/OpenMotif/lib/
Here is the major difference for compiling on Snow Leopard.
Snow Leopard wants to compile everything in 64 bit and complains because fink loaded libraries are 32 bit. To force Snow Leopard to compile in 32 bit mode change the configure command to this:
(./configure CFLAGS="-O -arch i386" CXXFLAGS="-O -arch i386" LDFLAGS="-arch i386" --disable-dependency-tracking --with-bdb-incdir=/sw/include/db4 --with-bdb-libdir=/sw/lib 2>&1) | tee -a make.log
This also tells configure to find the Oracle Berkeley DB that we added earlier. Dick.
Now we're ready to build.
cd ~/src/XASTIR ./update-xastir
Just before being prompted for your sudo password, you should see this:
xastir 1.9.5 has been configured to use the following options and external libraries: MINIMUM OPTIONS: ShapeLib (Vector maps) ................. : yes RECOMMENDED OPTIONS: -n GraphicsMagick/ImageMagick (Raster maps) : yes (GraphicsMagick) pcre (Shapefile customization) ......... : yes dbfawk (Shapefile customization) ....... : yes rtree indexing (Shapefile speedups) .... : yes map caching (Raster map speedups) ...... : no internet map retrieval ................. : yes (libcurl) FOR THE ADVENTUROUS: AX25 (Linux Kernel I/O Drivers) ........ : no libproj (USGS Topos & Aerial Photos) ... : yes GeoTiff (USGS Topos & Aerial Photos) ... : yes Festival (Text-to-speech) .............. : no GDAL/OGR (Obtuse map formats) .......... : no GPSMan/gpsmanshp (GPS downloads) ....... : no
Here is my Xastir summary for the options that I use. Dick.
xastir 1.9.9 has been configured to use the following options and external libraries: MINIMUM OPTIONS: ShapeLib (Vector maps) ................. : yes (internal) RECOMMENDED OPTIONS: GraphicsMagick/ImageMagick (Raster maps) : yes (GraphicsMagick) pcre (Shapefile customization) ......... : yes dbfawk (Shapefile customization) ....... : yes rtree indexing (Shapefile speedups) .... : yes map caching (Raster map speedups) ...... : yes internet map retrieval ................. : yes (libcurl) FOR THE ADVENTUROUS: AX25 (Linux Kernel I/O Drivers) ........ : no libproj (USGS Topos & Aerial Photos) ... : yes GeoTiff (USGS Topos & Aerial Photos) ... : no Festival (Text-to-speech) .............. : no GDAL/OGR (Obtuse map formats) .......... : no GPSMan/gpsmanshp (GPS downloads) ....... : no
This means xastir has been configured. If there is a "yes" after all the dependencies you installed, there were no problems. Enter your sudo password and xastir will compile and install.
xastir
When changes are made to the Xastir code (such as the recent .dbfawk file updates), run
cd ~/src/XASTIR ./update-xastir
to download changes from cvs, configure, build, install the new version.
GraphicsMagick doesn't find the required libjpeg include files. I'm not sure how to point GraphicsMagick to the right directory (/sw/include).
I don't have experience with this, so I can't comment whether this has been fixed or not. Dick.