Compilation sous Linux

From Stellarium Wiki
Revision as of 18:23, 18 August 2009 by Jp perroud (Talk | contribs)
Jump to: navigation, search

Chaque fois que Stellarium est libéré, le code source est disponible dans le système d'emballage Sourceforge. Building code source et qui sont rejetées de cette façon devrait vous donner une copie de travail de Stellarium, qui est fonctionnellement identique à la binaires pour cette libération.

Il est également possible d'obtenir un code source en développement en utilisant une Subversion. Celui-ci peut contenir de nouvelles fonctionnalités qui ont été mises en oeuvre depuis la dernière publication de Stellarium, de sorte que c'est souvent plus agréable. ATTENTION: les Subversion du code source Stellarium sont souvent des travaux en cours, et en tant que telle peuvent produire un programme instable, mai aussi qui ne fonctionne pas bien du tout, ou même ne peux pas se compiler correctement. Si vous êtes nouveau avec "la ligne de commande", vous pouvez également trouver dans cette page une aide précieuse.

Contents

Préparation

Tout d'abord assurez-vous que tous les outils sont installés sur votre système.

Nous allons maintenant utiliser au lieu de CMake automake/autoconf. C'est problème si vous n'avez pas une version assez récente de CMake. Assurez-vous que la version spécifiée dans le build dependencies page (l'erreur est considérée si vous avez une ancienne version de CMake est quelque chose à voir avec curl).

Si vous avez les outils de développement et QT version 3 et 4 installés sur votre système, assurez-vous que les commandes pour moc, uic et donc pointent sur la version QT4. Les utilisateurs Ubuntu/Debian peuvent utiliser ce script pour permuter entre eux.

Extract the tarball containing the source code. Open a terminal and cd to the directory where you wish to build Stellarium. Save the tarball to that directory and do this command in a terminal (if you prefer, you might use arK or some other graphical archive tool):

 $ tar zxf stellarium-0.10.2.tar.gz

You should now have a directory stellarium-0.10.2 with the source code in it.

Building

  • In a terminal and change into the source directory:
cd stellarium-0.10.2
  • Make the build directory and change into it
mkdir -p builds/unix
cd builds/unix
  • Configure the build using CMake:
cmake ../..

By default this will configure Stellarium to be installed in the /usr/local area. If you want another location, use this option to cmake, e.g.:

cmake -DCMAKE_INSTALL_PREFIX=/opt/stellarium ../..
  • Run make
make
  • Install the program (as root if necessary)
make install

That's it. You should now have Stellarium built and installed. Build takes about five minutes on a P4 1.7Ghz/512 Mb.

Subversion (development) version

First, make sure you have all the Build Dependencies installed.

Getting the sourcecode

Execute these commands:

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

This will create the directory stellarium which contains the source code.

Building the source

  • Change into the stellarium directory which was created by the svn command above
cd stellarium 
  • Make a builds/unix directory and change into it:
mkdir -p builds/unix
cd builds/unix

By default this will configure Stellarium to be installed in the /usr/local/ area. If this is OK, run CMake like this:

cmake ../..

or, if you would prefer to specify an alternative installation prefix, select it like this

cmake -DCMAKE_INSTALL_PREFIX=/opt/mylocation/ ../..
  • Now build using make:
make
  • To run Stellarium from the source tree, change back to the root of the source tree, and call the binary like this:
cd ../..
builds/unix/src/stellarium
  • If you want to install the program, from the builds/unix directory enter this command (as root if necessary):
make install

Updating SVN

If you have previously build the SVN code, but want to see what changes have been made since you did that, just cd into the stellarium directory and use the command:

svn up

This will download just the changes which were made since you last retrieved files from the repository. Often, all that will be required is to build from the make stage, but if there are new files you will need to build from the CMake stage.

If you modify any files, subversion will attempt to merge new updates with your changed files. This can lead to build problems, and you may want to revert your changes before updating. To revert such local edits, from the stellarium directory, do this before the update:

svn status

And for all files which are listed with an M next to them, do

svn revert filename filesname2 ...

Or you can just revert all changes recursively:

svn revert -R ./

Enabling Sound Support

Audio support for the new scripting engine is available after r3998 of the SVN code. Stellarium's sound support is a compile time option. To use sound in Stellarium you need to have a version of QT which supports the Phonon audio system. You also need a recent version of CMake.

Sound support is controlled by the CMake option ENABLE_SOUND. You can change this setting using ccmake, by editing the CMakeCache.txt file, or by supplying the -DENABLE_SOUND=1 option when you first run CMake.

Current Build Issues

Note that the development code is a work in progress, and as such, please don't expect it to build straight off the bat. Often it will be fine, but sometimes the build will be broken.

If the build seems to be broken for extended periods, try a thorough clean of the build directory (i.e. remove builds/unix), and start from the beginning. Check there are no new dependencies which you are missing. If you still have trouble, post to the forums or stellarium-pubdevel mailing list.

2009-03-10: CMake's detection of Phonon for audio support is not working properly right now. It is necessary to hack up the CMakeLists.txt file to gt it working. I'm working on it. -Matthew


Personal tools
Namespaces
Variants
Actions
in this wiki
other languages
Toolbox