Compiling CMConvert for Mac OS X

From TCki

Jump to: navigation, search

Contents

Install the latest developer tools

You can do this from your Mac OS X disk. Once you've done that, restart your machine.

Launch your terminal program

Most of the work will be done via the command line using the terminal program.

Download ExPat

CMConvert needs the Expat XML Parser, so let's install that first.

Go to:

http://sourceforge.net/projects/expat/

There you will find a green box that says: "Download Expat XML Parser". This will take you to another page where you can download the latest version of Expat. As of today (3/5/06), it is version 2.0.0. You will want the version named "expat", not the one marked "expat_win32bin". Clicking on "expat-2.0.0.tar.gz" should eventually take you to the SourceForge mirror page, where you can choose the most appropriate download site for your location.

This should leave you with the following file on your desktop:

expat-2.0.0.tar.gz

Unpack the ExPat archive

If you have UnStuffIt installed, it should unpack this archive for you automatically. If not, go to your terminal program and type the following to unpack this archive:

cd path_to_folder_containing_expat_source.tar.gz

since it's on my desktop, I typed:

cd ~/Desktop

Then type:

tar -zxf expat-2.0.0.tar.gz

Installing ExPat

To install expat, type the following commands into your terminal window. Some of them, such as ./configure, will cause a lot of lines of text to scroll by as that command is being fulfilled. When the torrent of statements ends and you have your command line prompt back again, type the next command.

cd expat-2.0.0
./configure
make
sudo make install

(the "sudo" command will cause Mac OS X to ask for your admin password)

Congratulations! Expat is now installed -- you're ready to move on to installing CMConvert.

Download CMConvert Sourcecode

Download latest version of the CMConvert source from Smittyware.com at:

http://www.smittyware.com/linux/

Click on the TGZ icon to download this file.

Again, UnStuffIt will open the archive automatically for you. If you don't have it, you'll have to cd to the folder containing the file you just downloaded (cd ~/Desktop for my computer) and type:

tar -zxf cmconvert-1.9.2.tar.gz

Install CMConvert

It's time to install CMConvert. From the folder where you downloaded the CMConvert source (Desktop for me), type the following commands:

cd cmconvert-1.9.2
./configure --mandir=/usr/local/share/man
make
sudo make install

Use CMConvert

From the command line, type the following:

man cmconvert

This will show you a lot of options in the way you use the program, and a few examples of their use. I tend to use two of these options routinely:

the -d option, which bumps up the cache description length from 3090 bytes to 8192 bytes. I use this on every .GPX file I convert, since it's a bummer to have key details trimmed off the cache description.
the -N option, which includes as many of the prior logs as you wish in your .PDB file. I usually select 10, but your mileage may vary.

Example: Assuming that I've just downloaded to my desktop a .GPX file from TC.com called "TC7OF.gpx", I type the following in my terminal program to convert it to a .PDB file:

cd ~/Desktop
/usr/local/bin/cmconvert -dN10 TC7OF.gpx

Which gives me the following feedback:

1 waypoint converted.

There is also now a new file on my disk called TC70F.pdb, which I can upload to my Palm.

Add CMConvert to your PATH environment

It is just possible that you may not wish to have to type "/usr/local/bin/" in front of "cmconvert" every time you use it. If so, then you have to add the /usr/local/bin directory to your PATH environment variable in your shell's login script.

For the bash shell, which is the default for new user accounts created under Mac OS X 10.3, the command is:

echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile

You then have to close and re-open your terminal window. From now on, to use cmconvert, you should be able to just type the following at the command line:

cmconvert -dN10 TC7OF.gpx
Personal tools
Parent Site