First make sure all [[Build Dependencies|build dependencies]] are installed on your system.

+

First make sure all [[Build Dependencies (Qt5)|build dependencies]] are installed on your system (or see [[Build Dependencies|Older build dependencies for series 0.12]]).

−

+

−

We now use CMake instead of automake/autoconf. A common problem is that you don't have a recent enough version of CMake. Make sure you have the version specified in the [[Build Dependencies|build dependencies]] page (the error which is seen if you have an old version of CMake is something to do with curl).

+

−

+

−

If you have both Qt version 4 development tools and Qt version 3 development tools installed on your system, make sure the commands for moc, uic and so on point at the QTt versions. Ubuntu/Debian users might want to use [http://porpoisehead.net/misc/qt_alt this script] to swap between them.

+

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):

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.6.tar.gz

+

$ tar zxf stellarium-0.13.3.tar.gz

−

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

+

You should now have a directory <code>stellarium-0.13.3</code> with the source code in it.

===Building===

===Building===

*In a terminal and change into the source directory:

*In a terminal and change into the source directory:

−

cd stellarium-0.10.6

+

cd stellarium-0.13.3

*Make the build directory and change into it

*Make the build directory and change into it

mkdir -p builds/unix

mkdir -p builds/unix

cd builds/unix

cd builds/unix

−

*[[Configuring Build Options|Configure]] the build using CMake:

+

*[[Configuring Build Options|Configure]] the build using ''cmake'':

cmake ../..

cmake ../..

−

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

+

By default this will configure Stellarium to be installed in the <code>/usr/local</code> area. If you want another location, use this [[Configuring Build Options|option]] to ''cmake'', e.g.:

cmake -DCMAKE_INSTALL_PREFIX=/opt/stellarium ../..

cmake -DCMAKE_INSTALL_PREFIX=/opt/stellarium ../..

*Run make

*Run make

Line 32:

Line 28:

make install

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.

+

That's it. You should now have Stellarium built and installed.

===Creating source package===

===Creating source package===

Line 45:

Line 41:

====RPM====

====RPM====

−

*After building of TGZ binary package (Note: a building recommended with -DCMAKE_INSTALL_PREFIX=/usr):

+

*After building of TGZ binary package (Note: a building recommended with <code>-DCMAKE_INSTALL_PREFIX=/usr</code>):

cpack -G RPM

cpack -G RPM

====DEB====

====DEB====

−

*After building of TGZ binary package (Note: a building recommended with -DCMAKE_INSTALL_PREFIX=/usr):

+

*After building of TGZ binary package (Note: a building recommended with <code>-DCMAKE_INSTALL_PREFIX=/usr</code>):

cpack -G DEB

cpack -G DEB

==Bazaar (development) version==

==Bazaar (development) version==

−

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

+

First, make sure you have all the [[Build Dependencies (Qt5)|build dependencies]] installed.

−

===Getting the sourcecode===

+

+

===Getting the source code===

Execute these commands:

Execute these commands:

<nowiki>bzr checkout lp:stellarium</nowiki>

<nowiki>bzr checkout lp:stellarium</nowiki>

Line 62:

Line 59:

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

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

−

===Building the source===

+

===Building from source===

−

*Change into the stellarium directory which was created by the bzr command above

+

*Change into the stellarium directory which was created by the ''bzr'' command above

cd stellarium

cd stellarium

*Make a builds/unix directory and change into it:

*Make a builds/unix directory and change into it:

mkdir -p builds/unix

mkdir -p builds/unix

cd builds/unix

cd builds/unix

−

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

+

By default this will configure Stellarium to be installed in the <code>/usr/local/</code> area. If this is OK, [[Configuring Build Options|run ''cmake'']] like this:

cmake ../..

cmake ../..

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

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

Line 77:

Line 74:

cd ../..

cd ../..

builds/unix/src/stellarium

builds/unix/src/stellarium

−

*If you want to run from the stellarium folder without using the terminal copy the stellarium binary from builds/unix/src to the stellarium folder. Then a click on the binary will start stellarium.

+

*If you want to run from the stellarium folder without using the terminal copy the stellarium binary from <code>builds/unix/src</code> to the stellarium folder. Then a click on the binary will start stellarium.

−

*If you want to install the program, from the builds/unix directory enter this command (as root if necessary):

+

*If you want to install the program, from the <code>builds/unix</code> directory enter this command (as root if necessary):

make install

make install

Line 91:

Line 88:

bzr revert filename filesname2 ...

bzr revert filename filesname2 ...

−

===Enabling Sound Support===

+

===Enabling Sound and Video Support===

−

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.

+

Stellarium's sound and video support is a compile time option. To use sound in Stellarium you need to have a version of Qt which supports the multimedia<ref>You should install the ''qtmultimedia5-dev'' and ''libqt5multimedia5-plugins'' packages</ref>. 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.

+

Sound support is controlled by the ''cmake'' option <code>ENABLE_MEDIA</code>. You can change this setting using ''cmake'', by editing the <code>CMakeCache.txt</code> file, or by supplying the <code>-DENABLE_MEDIA=1</code> option when you first run ''cmake''.

−

NOTE: In Ubuntu 9.10 you should install the libqt4-phonon-dev package, but NOT the libphonon-dev package.

+

Tested on Ubuntu: You need to install GStreamer plugins. Most critical seems to be gstreamer0.10-ffmpeg from https://launchpad.net/~mc3man/+archive/ubuntu/gstffmpeg-keep, then it plays MP4 (h264), Apple MOV(Sorenson) and WMV. Some type of AVI failed.

+

If Stellarium is built with ENABLE_MEDIA, package managers should also make sure to change dependencies to include these. (This is however a nonstandard ppa, not sure how to proceed here!)

===Current Build Issues===

===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.

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.

+

If the build seems to be broken for extended periods, try a thorough clean of the build directory (i.e. remove <code>builds/unix</code>), and start from the beginning. Check there are no new dependencies which you are missing. If you still have trouble, post to the [https://sourceforge.net/p/stellarium/discussion/278769 forums] or [https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel 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

+

==References==

+

<references/>

[[Category: Linux]]

[[Category: Linux]]

+

[[Category: Development]]

Latest revision as of 09:53, 8 December 2015

Each time Stellarium is released, the sourcecode is released in Sourceforge's packaging system. Building sourcecode that is released in this way should give you a working copy of Stellarium which is functionally identical to the binaries for that release.

It is also possible to get the "in development" sourcecode using Bazaar. This may contain new features which have been implemented since the last release of Stellarium, so it's often more fun. Warning: Bazaar versions of the Stellarium sourcecode are work in progress, and as such may produce an unstable program, may not work at all, or may not even compile.

If you're new to the command line, you might also find this page interesting.

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.13.3.tar.gz

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

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

bzr 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, bazaar 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:

Stellarium's sound and video support is a compile time option. To use sound in Stellarium you need to have a version of Qt which supports the multimedia[1]. You also need a recent version of cmake.

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

Tested on Ubuntu: You need to install GStreamer plugins. Most critical seems to be gstreamer0.10-ffmpeg from https://launchpad.net/~mc3man/+archive/ubuntu/gstffmpeg-keep, then it plays MP4 (h264), Apple MOV(Sorenson) and WMV. Some type of AVI failed.
If Stellarium is built with ENABLE_MEDIA, package managers should also make sure to change dependencies to include these. (This is however a nonstandard ppa, not sure how to proceed here!)

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.