KDEdu Logo

Build and Install Marble

To obtain pre-built packages of Marble for your favourite operating system, please have a look at our Download section.

You might be able to obtain a more recent version of this document here

NOTE:
This file describes how to build Marble as a stand-alone application. If you are building Marble as part of the KDE-EDU module, then you should instead read the file INSTALL in the top level directory of this module and ignore this one. This is most likely ../INSTALL.

Prerequisites for building Marble are:

  • Qt 4.6 or newer
  • cmake version 2.6.4 or newer
  • (optional): kdelibs (including the kdelibs-dev package).
And of course you need the Marble source code.

1. Getting the Marble Source Code

You can check out the unstable development version ("Marble trunk" using the git tool via the command:

git clone git://anongit.kde.org/marble

If you have a KDE developer account you might want to use:

git clone git@git.kde.org:marble

If you want to check out the latest stable version please check out the KDE/4.8 branch (for Marble 1.3) You can do so by using one of these commands (depending on whether you've got a developer account or not):

git clone -b KDE/4.8 git://anongit.kde.org/marble
or

In case you have a KDE developer account the git command is:

git clone -b KDE/4.8 git@git.kde.org:marble

As an alternative you can download a compressed archive of the source code on our Download Page. However we recommend to get it from git as updating the source code later on will be much more convenient.

2. Compiling Marble

You can build and install Marble in two different ways:

  1. As a Qt-only application.
  2. As a KDE application, using kdelibs and KDE based classes.

Choose one of them and follow our instructions on how to do it. If you want to install Marble's data into a directory that is different from the system default (e.g. your home directory) then we suggest that you take section "3. Adjust Marble's search path for the maps and data" into account.

NOTE:
If you wish to build Marble with debug info include the argument -DCMAKE_BUILD_TYPE=debug in the cmake command below.

A. Build Marble as a Qt only application.

1. Create a build directory

Create a build directory parallel to the source directory. Suppose that the source directory is named 'marble'. Then create a new directory called 'marble-build'.

2. Configure the build tree

Go into the build directory and type

  cmake -DQTONLY=ON ../marble
3. Build marble

Also in the build directory, type:

  make
4. Install marble

Finally, also from the build directory, type:

  make install

and start Marble either from the menu or via the command line:

  marble

If you're on (K)Ubuntu or Debian you need to adjust your LD_LIBRARY_PATH environment variable:

  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

To make this change persistent you need to add this line to your .bashrc or your "/etc/environment" file.

B. Build Marble as a KDE application.

1. Create a build directory

This is the same step as for a Qt-only build:

Create a build directory parallel to the source directory. Suppose that the source directory is named 'marble'. Then create a new directory called 'marble-build'.

2. Configure the build tree

Go into the build directory and type

  cmake ../marble

From now on the steps are the same as for a Qt-only build.

3. Build marble
  make
4. Install marble
  make install

and start Marble either from the menu or via the command line:

  marble

3 Adjust Marble's search path for the maps and data

If you want to install Marble's data into a different place than the system default then read on: There are several ways to adjust the path where Marble is drawing it's data from:

3.1 At Compiletime

Use the cmake option -DMARBLE_DATA_PATH to specify the built-in system path that Marble gathers its data from:

Example:

  cmake -DQTONLY=ON -DMARBLE_DATA_PATH /mnt1/marble/data ~/marble

3.2 "At Runtime"

There are two solutions to adjust the data path for a precompiled Marble binary:

a) Enter a key and a value

marbleDataPath="/smb/marble/data"

to the config file "marblerc" or "~/.config/KDE/Marble\Desktop\Globe.conf" and (re)start the application.

b) Start Marble using the command line option --marbleDataPath:

marble --marbleDataPath ~/marble/data


Last update: 2012-01-25

Global navigation links