DarkRadiant - Compiling in Linux: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Line 94: Line 94:
== Compile ==
== Compile ==


'''Note: in the past, DarkRadiant was built using SCons. This build system has now been removed in favour of the standard Automake build. Please do not expect any support from the developers if you attempt to compile DarkRadiant using the SCons build system.'''
'''Note: in the past, DarkRadiant was built using SCons. This build system has now been removed in favour of the standard Automake build.'''
 
First, make sure you have the automake toolchain downloaded:
sudo apt-get install libtool autoconf
Then run
./autogen.sh
in your darkradiant folder.


DarkRadiant employs an Autoconf/Automake build system under Linux as used in the majority of open-source projects. Compilation can be achieved using the standard
DarkRadiant employs an Autoconf/Automake build system under Linux as used in the majority of open-source projects. Compilation can be achieved using the standard

Revision as of 09:00, 8 November 2009

Install Libraries and Tools

Ubuntu 7.04

You'll need a bunch of packages to get DarkRadiant to compile without glitches. I can't remember all from the top of my head, I will try to complete this list during my next Linux setup, but don't hold your breath. These are the names as found in Ubuntu 7.04 (Feisty Fawn):

  • g++
  • gcc-4.1
  • libboost-dev
  • libboost-serialization-dev
  • libboost-filesystem-dev
  • libboost-regex-dev
  • libglew-dev
  • libgtk2.0-dev
  • libglib2.0-dev (maybe installed with libgtk2.0-dev)
  • libgtkglext1-dev
  • libxml2-dev
  • libopenal-dev
  • libalut-dev
  • libvorbis-dev
  • libboost-python-dev (for the optional scripting plugin)
  • python-dev (for the optional scripting plugin)

Always download all the dependencies as well.

If you get an error about the G++ compiler not being found, make sure you also install the g++ package, and not just the g++-4.1 package.

Ubuntu 7.10

  • g++
  • libboost-dev
  • libboost-regex-dev
  • libgtk2.0-dev
  • libglew1.4-dev
  • libgtkglext1-dev
  • libxml2-dev
  • libboost-serialization-dev
  • libboost-filesystem-dev
  • libboost-date-time-dev
  • libalut-dev
  • libvorbis-dev
  • libboost-python-dev (for the optional scripting plugin)
  • python-dev (for the optional scripting plugin)

Always download all the dependencies as well.

For the D3Hook plugin, the boost/asio library is needed (version 0.3.7, newer versions don't work). This library is located in the plugins/dm.d3hook/boost/ folder and should be ready for compilation.

Ubuntu 8.04

Copy and paste the following into a terminal:

sudo apt-get install g++ libboost-dev libboost-regex-dev libgtk2.0-dev libglew1.5-dev libgtkglext1-dev libxml2-dev libboost-serialization-dev libboost-filesystem-dev libboost-date-time-dev libalut-dev libvorbis-dev libboost-python-dev python-dev

The python headers are needed for the optional scripting plugin.

In the terminal, Ctrl Shift V is used for pasting instead of Ctrl V.

Ubuntu 8.10

Copy and paste the following into a terminal:

sudo apt-get install g++ libboost-dev libboost-regex-dev libgtk2.0-dev libglew1.5-dev libgtkglext1-dev libxml2-dev libboost-filesystem-dev libboost-serialization-dev libboost-date-time-dev libjpeg62-dev libalut-dev libvorbis-dev libboost-python-dev python-dev

The python headers are needed for the optional scripting plugin.

In the terminal, Ctrl Shift V is used for pasting instead of Ctrl V.

Ubuntu 9.10

Copy and paste the following into a terminal:

sudo apt-get install g++ libboost1.38-dev libgtk2.0-dev libglew1.5-dev libgtkglext1-dev libxml2-dev libboost-regex-dev libboost-filesystem-dev libboost-serialization-dev libboost-date-time-dev libjpeg62-dev libalut-dev libvorbis-dev libboost-python-dev python-dev

The python headers are needed for the optional scripting plugin.

Fedora 10

The Duke has posted a how-to in his blog at http://realduke.wordpress.com/2008/07/28/darkradiant-under-fedora-10/. I might quote the relevant parts about the needed packages:

To compile DarkRadiant under Fedora 10, we’ll need the folowing tools and libraries installed:

“subversion”(svn), “gcc”, “gcc-c++” (g++)
“boost-devel”, “gtk2-devel”, “glew-devel”, “gtkglext-devel”, “libxml2-devel”, “freealut-devel” and “libvorbis-devel”

For yum users, just copy and execute this:

“yum -y install subversion gcc gcc-c++ boost-devel gtk2-devel glew-devel gtkglext-devel libxml2-devel freealut-devel libvorbis-devel”

For the optional scripting plugin, you'll need the python and boost::python headers as well (note: I can't really check if these are correct, I don't have Fedora available --greebo):

libboost-python-devel python-devel

Obtain the source

Install the subversion client. On Ubuntu this can be done via the Synaptic Manager or the command line:

sudo apt-get install subversion

Change to the directory where you want the source code to be in and then check the current version out of SVN with:

svn checkout https://darkradiant.svn.sourceforge.net/svnroot/darkradiant/trunk/darkradiant/ darkradiant

Compile

Note: in the past, DarkRadiant was built using SCons. This build system has now been removed in favour of the standard Automake build.

First, make sure you have the automake toolchain downloaded:

sudo apt-get install libtool autoconf

Then run

./autogen.sh

in your darkradiant folder.

DarkRadiant employs an Autoconf/Automake build system under Linux as used in the majority of open-source projects. Compilation can be achieved using the standard

$ ./configure
$ make
$ make install

on most systems.

By default, a release build will be created; if a debug build is required pass the --enable-debug option to the configure script.

Other points to note about the configure process:

  • The DarkMod-specific plugins are not built by default. To enable these, pass --enable-darkmod-plugins to ./configure.
  • The configure script autodetects required dependencies, and will conditionally-enable optional components of DarkRadiant (such as the sound plugin) based on what it finds.
  • For quick testing of a DarkRadiant build, it is desirable to install it into a temporary location rather than the default of /usr/local; for this, simply pass a prefix option such as --prefix=/tmp/dr to configure, after which DarkRadiant will be installed in /tmp/dr/bin/darkradiant.
  • To build a Debian/Ubuntu package, simply run dpkg-buildpackage -rfakeroot in the main darkradiant directory. The .deb will be created in the parent directory.

If you want to update the source with the latest version from the SVN, just issue:

svn update

in the darkradiant source directory. svn info shows you what version you currently have.

See also