Difference between revisions of "Linux development"

From Navit's Wiki
Jump to: navigation, search
(Add CMake instructions)
(Running the compiled binary)
Line 22: Line 22:
===Running the compiled binary===
===Running the compiled binary===
The binary is called ''navit'' and is available in:
The binary is called '''navit''' and is available in:

Revision as of 20:37, 5 March 2012

Taking care of dependencies

See the Dependencies page for a list of software packages required to build Navit. To build with CMake you will need CMake 2.6 or newer.

Getting Navit from the SVN repository

First, let's make sure we are in our home directory: this is only for the sake of making this tutorial simple to follow. You can save that directory anywhere you want, but you will have to adapt the rest of the instructions of this guide to your particular case.

cd ~ 

Now, let's grab the code from SVN. This assumes that you have subversion installed.

svn co https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit/ navit


There are currently two methods of compiling Navit - using make or using CMake. make was the old method, but will become deprecated in favour of CMake.


CMake builds Navit in a separate directory of your choice - this means that the directory in which the SVN source was checked out remains untouched.

mkdir navit-build
cd navit-build

Once inside the build directory just call the following commands:

cmake ~/navit

Running the compiled binary

The binary is called navit and is available in:


It is advised to just run this binary locally at the moment (i.e. not to install system-wide).


Go to the directory where you checked out the svn repository:

cd navit

Start the make dance:

./autogen.sh && ./configure && make

It is better to use autogen and configure before make, due to the heavy flux of changes in the svn version. Also, putting them all in one command ensures that they go through the next step only if the previous step succeeded. In the end, hopefully, you get a fully compiled navit binary in the navit/ subfolder (so basically, it looks like ~/navit/navit/navit. Yeah.)

Running the compiled binary

Here, I am skipping the usual "make install" (in my case, "sudo checkinstall make install") step, because I don't care about installing navit systemwide. I run navit directly from its svn folder, and it makes things much simpler (and safer).

To execute navit, you can simply click on the binary file (if you are sure it is compiled properly) and it should launch. If you prefer to launch it from a terminal, you need to go into the directory containing the binary, first, like so:

cd ~/navit/navit/

Updating SVN

You don't need to recompile everything to update navit to the latest SVN; with svn update only the edited files will be downloaded. Just go to the navit directory (e.g. /home/CHANGEME/navit) and run:

svn up

You then follow this by either the instructions in CMake or in make. Actually, with CMake you can miss out the step where you make the build directory - just use the old one. With make you can usually miss out the ./autogen.sh and ./configure steps.

Prebuild binairies

Prebuilt binaries exist for many distributions.

Configuring the beast

This is an entirely different matter, young padawan. Good luck :)

You can also check a post describing a Navit configuration on Ubuntu Jaunty.