• Skip to content
  • Skip to link menu
The KDE Education Project
  • The KDE Education Project / KStars
 
 

Compiling KStars from SVN

Introduction

This page provides instructions for downloading, compiling and installing the latest development version of the KStars codebase.

Before you begin, you should think hard about the following question:
Do I really want to compile the latest development code?
Before you proceed, keep the following in mind:

  • The KDE-4.0 platform is still in rapid development. The libraries are changing all the time, and you will encounter bugs and crashes, over and over.

  • Likewise, the KStars code itself is undergoing major changes. Many things now work, but some things do not. You should not expect to have a fully functioning KStars program from the current SVN codebase.

  • Getting your system set up to compile the latest KStars code involves many steps and a lot of compiling. You will likely have problems along the way.

  • If you are running KDE-4 code at this point, you are expected to help with the development by reporting and fixing the bugs and crashes that you will encounter. The code is simply not ready for casual use.

KStars development takes place on the KDE Subversion server. Subversion is a version control system, similar to CVS. It's essentially a code repository that keeps track of every incremental version of all files. You can browse the codebase through our web interface, but that's not useful for downloading the code, just for browsing specific files and checking the commit logs.

Prerequisites

  • Subversion: This is just about the only stable codebase you'll be dealing with. Make sure you have it installed by typing svn --version at a command prompt; it should return a version string. The version doesn't matter too much; just make sure it's >= 1. If you don't have subversion installed, use your distribution's packaging system to install it, or look here for download instructions.

  • DBus: You will need at least version 0.62, which is a very recent release as of this writing (July 2006), so you probably don't have it installed already. Check your installed version (if any) with dbus-launch --version. If you don't have 0.62, you can check to see if your package manager offers it, but you will probably have to install it manually:
    • Download it from http://www.freedesktop.org/wiki/Software_2fdbus
    • Unpack the tarball, then do the following to compile and install:
      % cd dbus-0.62
      % ./configure --disable-qt --disable-qt3 --prefix=/usr/local
      % make
      % sudo make install
      
      (if you don't have sudo set up, do su -c "make install" instead)

  • CMake: You will need version 2.4.1 to compile KDE. Again, this is a very recent version that you probably don't already have, and can't get through your package manager (but feel free to check!). Note that 2.4.1 is the version required as of this writing (July 2006); you should double-check the required version in the file COMPILING-WITH-CMAKE, once you have downloaded kdelibs (see below). To install cmake:
    • Download the code by typing:
      wget http://www.cmake.org/files/v2.4/cmake-2.4.1.tar.gz
    • Unpack the tarball
    • Do the following:
      % cd cmake-2.4.1
      % ./configure 
      % make
      % sudo make install
      

Setting up the KDE-4 environment

KDE-4 is compiled with cmake instead of GNU autotools. With cmake, you are expected to build the code in a different directory from the one containing the source code itself. I also recommend that you create a separate user account for KDE-4 development, because running KDE-4 code can interfere with your KDE-3 session. This is being fixed as we progress toward KDE-4, but a separate account will completely avoid the problem.
  • Create a new user account for KDE-4 development: sudo useradd -m -s /bin/bash kde-devel; passwd kde-devel

  • Become the kde-devel user: su - kde-devel

  • Set up the environment variables. Add the following text to your ~/.bashrc config file (assuming you are using the Bash shell; for other shells the syntax and config filename will be different):
    export QTDIR=/home/kde-devel/kde4svn/qt-copy
    export KDEDIR=/home/kde-devel/kde4
    export PATH=$KDEDIR/bin:$QTDIR/bin:$PATH
    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$QTDIR/lib
    export LD_LIBRARY_PATH=/usr/local/lib:$QTDIR/lib
    alias cmakelibs='cmake -DCMAKE_INSTALL_PREFIX=$KDEDIR \\
    -DCMAKE_BUILD_TYPE=debugfull /home/kde-devel/kde4svn/kdelibs'
    alias cmakeedu='cmake -DCMAKE_INSTALL_PREFIX=$KDEDIR \\
    -DCMAKE_BUILD_TYPE=debugfull /home/kde-devel/kde4svn/kdeedu'
    ##Start DBus daemon
    eval `dbus-launch --auto-syntax`
    Note that the two "\\" here are "line-continuation indicators". They should not appear in your .bashrc file; and each alias definition should be on one continuous line.

    Also note that this assumes you will follow the directory structure I use in these instructions; if you use a different structure, change the above lines accordingly.

  • Type source ~/.bashrc to acquire these definitions for the current session (they'll be loaded automatically when you become kde-devel from now on).

Obtaining and compiling Qt

  • Create a directory to hold the code you will download with svn:
    cd /home/kde-devel; mkdir kde4svn; cd kde4svn

  • Download the Qt-4.2.x codebase from the KDE Subvsersion server:
    svn co svn://anonsvn.kde.org/home/kde/trunk/qt-copy
    (go get a cup of coffee; this will take a while to download...)

  • Configure and compile Qt:
    % cd qt-copy
    % ./configure -qt-gif -no-exceptions -debug -fast -prefix $QTDIR
    [answer 'yes' when asked about accepting the license, if you agree]
    % make sub-src sub-tools
    
    Note that you don't need to "install" Qt; we have set the $QTDIR variable to the compile directory, so it is installed "in-place".

Obtaining and compiling KDELibs

We are no longer using "snapshots" of kdelibs for application development; kdelibs in trunk is now supposed to be stable enough for us to use directly.
  • Obtain the trunk code from svn:
    % cd /home/kde-devel/kde4svn
    % svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs
    

  • Create a build directory (named kde4_build here), and compile the code inside a subdirectory there:
    % mkdir /home/kde-devel/kde4_build; cd /home/kde-devel/kde4_build
    % mkdir kdelibs; cd kdelibs
    % cmakelibs
    % make
    % make install
    

Note that I use the alias cmakelibs, which I defined for the .bashrc file above. If you didn't define the alias, then replace "cmakelibs" with that longer command line. Also, since we are installing to a local directory, we don't need sudo when we run make install. If you decided to set KDEDIR to a global directory, you may need to use sudo make install.

Obtain, compile and install KStars in the KDE-Edu module

  • Obtain the code from svn:
    % cd /home/kde-devel/kde4svn
    % svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdeedu
    

  • Create a build directory under kde4_build, and compile the code from there:
    % cd /home/kde-devel/kde4_build
    % mkdir kdeedu; cd kdeedu
    % cmakeedu
    % cd libkdeedu
    % make
    % make install
    % cd ../kstars
    % make
    % make install
    

Again, I have used the cmakeedu alias defined in the ~/.bashrc file. Note that you'll need to compile and install the libraries in libkdeedu before installing KStars.

That's it. Once you've installed kstars, you can simply run it by typing kstars from the command line (as the kde-devel user). If you have error messages related to DBus, it could be that the DBus daemon isn't running. In this case, you can run KStars with its own DBus session by typing: dbus-launch kstars.


Jason Harris
kstars AT 30doradus DOT org
Last update: 2008-01-11

Inform

Skip menu "Inform"
  • KDE-Edu Home
  • KDE Home

Science Applications

Skip menu "Science Applications"
  • Kalzium
  • KStars
    • Main Page
    • Screenshots
    • Reviews
    • Community Forums
    • Scripts & Addons
    • Handbook
    • INDI
    • AstroInfo Project
    • i18n
    • Kstars-devel ML
    • Contributors
    • Open Bug Reports
    • TODO List
    • SVN How-To
    • Browse SVN (trunk)
    • Browse SVN (4.2)
  • Step
  • Marble

Global navigation links

  • KDE Home
  • KDE Accessibility Home
  • Description of Access Keys
  • Back to content
  • Back to menu

Search:


Maintained by edu.kde.org Webmaster
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal