DarkRadiant - Compiling in Linux: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
(removed: outdated info about Fedora 10)
(removed Ubuntu editions that have reached end-of-life more than a year ago. Resorted editions. Additional info for Fedora 15.)
Line 1: Line 1:
== Install Libraries and Tools ==
== Install Libraries and Tools ==


=== Ubuntu 7.04 ===
=== Ubuntu 11.10 ===
Copy and paste the following into a terminal (at least that's what worked in the beta2):


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):
<code>sudo apt-get install automake libtool g++ zlib1g-dev libjpeg62-dev libxml2-dev libgtkmm-2.4-dev libglew1.6-dev libalut-dev libvorbis-dev libboost-dev libboost-regex-dev libboost-filesystem-dev libboost-python-dev libgtksourceviewmm-2.0-dev libgtkglextmm-x11-1.2-dev</code>


* g++
The python and the gtksourceviewmm headers are needed for the optional scripting plugin. The alut and vorbis headers are used by the optional sound module.
* 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.
=== Ubuntu 10.10 ===
 
If you get an error about the G++ compiler not being found, make sure you also install the <code>g++</code> package, and not just the <code>g++-4.1</code> 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:
Copy and paste the following into a terminal:


<code>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</code>
<code>sudo apt-get install automake libtool g++ libgtkmm-2.4-dev libjpeg62-dev libgtkglextmm-x11-1.2-dev libxml2-dev libglew1.5-dev libboost-dev libboost-regex-dev libboost-filesystem-dev libboost-python-dev libalut-dev libvorbis-dev libgtksourceviewmm-2.0-dev</code>


The python headers are needed for the optional scripting plugin.
The python and the gtksourceviewmm headers are needed for the optional scripting plugin. The alut and vorbis headers are used by the optional sound module.
 
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:
 
<code>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</code>
 
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 ===
=== Ubuntu 9.10 ===
Line 101: Line 52:
Then re-run ./autogen.sh and ./configure
Then re-run ./autogen.sh and ./configure


=== Ubuntu 10.10 ===
=== Ubuntu 8.04 ===
Copy and paste the following into a terminal:
Copy and paste the following into a terminal:


<code>sudo apt-get install automake libtool g++ libgtkmm-2.4-dev libjpeg62-dev libgtkglextmm-x11-1.2-dev libxml2-dev libglew1.5-dev libboost-dev libboost-regex-dev libboost-filesystem-dev libboost-python-dev libalut-dev libvorbis-dev libgtksourceviewmm-2.0-dev</code>
<code>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</code>


The python and the gtksourceviewmm headers are needed for the optional scripting plugin. The alut and vorbis headers are used by the optional sound module.
The python headers are needed for the optional scripting plugin.


=== Ubuntu 11.10 ===
In the terminal, Ctrl Shift V is used for pasting instead of Ctrl V.
Copy and paste the following into a terminal (at least that's what worked in the beta2):
 
<code>sudo apt-get install automake libtool g++ zlib1g-dev libjpeg62-dev libxml2-dev libgtkmm-2.4-dev libglew1.6-dev libalut-dev libvorbis-dev libboost-dev libboost-regex-dev libboost-filesystem-dev libboost-python-dev libgtksourceviewmm-2.0-dev libgtkglextmm-x11-1.2-dev</code>
 
The python and the gtksourceviewmm headers are needed for the optional scripting plugin. The alut and vorbis headers are used by the optional sound module.


=== Fedora 15 ===
=== Fedora 15 ===
Line 130: Line 76:
  make --jobs=2  
  make --jobs=2  
  make install
  make install


== Obtain the source ==
== Obtain the source ==
Line 146: Line 90:
'''Note: in the past, DarkRadiant was built using SCons. This build system has now been removed in favour of the standard Automake build.'''
'''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:
First, make sure you have the automake toolchain downloaded.
 
Debian/Ubuntu/Aptitude users:
  sudo apt-get install libtool autoconf
  sudo apt-get install libtool autoconf
Fedora 15 users:
sudo yum install libtool gettext-devel
Then run  
Then run  
  ./autogen.sh
  ./autogen.sh

Revision as of 05:47, 29 September 2011

Install Libraries and Tools

Ubuntu 11.10

Copy and paste the following into a terminal (at least that's what worked in the beta2):

sudo apt-get install automake libtool g++ zlib1g-dev libjpeg62-dev libxml2-dev libgtkmm-2.4-dev libglew1.6-dev libalut-dev libvorbis-dev libboost-dev libboost-regex-dev libboost-filesystem-dev libboost-python-dev libgtksourceviewmm-2.0-dev libgtkglextmm-x11-1.2-dev

The python and the gtksourceviewmm headers are needed for the optional scripting plugin. The alut and vorbis headers are used by the optional sound module.

Ubuntu 10.10

Copy and paste the following into a terminal:

sudo apt-get install automake libtool g++ libgtkmm-2.4-dev libjpeg62-dev libgtkglextmm-x11-1.2-dev libxml2-dev libglew1.5-dev libboost-dev libboost-regex-dev libboost-filesystem-dev libboost-python-dev libalut-dev libvorbis-dev libgtksourceviewmm-2.0-dev

The python and the gtksourceviewmm headers are needed for the optional scripting plugin. The alut and vorbis headers are used by the optional sound module.

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 libalut-dev libvorbis-dev libboost-python-dev python-dev libgtksourceview2.0-dev

The python headers are needed for the optional scripting plugin.

Adjust the configure.ac file, as Ubuntu 9.10 appends the postfix -mt for each boost library installed in /usr/lib:

boost_regex => boost_regex-mt
boost_filesystem => boost_filesystem-mt
boost_system => boost_system-mt
boost_python => boost_python-mt
# Boost.Regex
AC_CHECK_LIB([boost_regex-mt], [main],
             [REGEX_LIBS='-lboost_regex-mt'],
             [AC_MSG_ERROR([Boost.Regex not found])])
AC_SUBST([REGEX_LIBS])

# Boost.Filesystem
AC_CHECK_LIB([boost_filesystem-mt], [main],
             [BOOST_FILESYSTEM_LIBS='-lboost_filesystem-mt'],
             [AC_MSG_ERROR([Boost.Filesystem not found])])
AC_SUBST([BOOST_FILESYSTEM_LIBS])

# Boost.System
AC_CHECK_LIB([boost_system-mt], [main],
             [BOOST_SYSTEM_LIBS='-lboost_system-mt'],
             [AC_MSG_ERROR([Boost.System not found])])
AC_SUBST([BOOST_SYSTEM_LIBS])

Same for the Python check below in configure.ac:

AC_CHECK_LIB([boost_python-mt], [main],
                [BOOST_PYTHON_LIBS='-lboost_python-mt'],
                [script_module=])

Then re-run ./autogen.sh and ./configure

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.

Fedora 15

Open a console and type:

sudo yum install gcc gcc-c++ subversion automake zlib-devel libjpeg-turbo-devel libxml2-devel glew-devel boost-devel
sudo yum install gtk2-devel gtkmm24-devel gtkglextmm-devel gtksourceviewmm-devel libvorbis-devel freealut-devel python-devel

Checkout the most recent sources from SVN:

cd ~
svn co https://darkradiant.svn.sourceforge.net/svnroot/darkradiant/trunk/darkradiant darkradiant

Configure and compile

cd darkradiant
./configure --prefix=/path/to/installdir --enable-darkmod-plugins
make --jobs=2 
make install

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.

Debian/Ubuntu/Aptitude users:

sudo apt-get install libtool autoconf

Fedora 15 users:

sudo yum install libtool gettext-devel

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.

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.

Multiprocessor Systems

You can pass the --jobs=N parameter to make:

make --jobs=2

to use more than one processor for the compilation.

Building a .deb package

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.

See also