DarkRadiant - Compiling in Linux

From The DarkMod Wiki
Revision as of 16:02, 4 April 2008 by Greebo (talk | contribs) (new article for compiling in Linux)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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
  • scons 0.96.93 (or higher)
  • 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

Always download all the dependencies as well. Python should already be installed by Ubuntu at least, other distributions might require to install it separately.

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++
  • scons 0.97
  • 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

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.

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

Change to the source directory and use scons to create a release build:

cd darkradiant
scons BUILD="release"

The compilation can take quite a few minutes, depending on your system.

If you use scons without arguments, a debugging build will be created, which can take even longer.

Next time you want to compile DarkRadiant, you can just type scons, the last build type is remembered by scons.

A fresh compile can be performed by clearing the compiled binaries first:

scons -c
scons BUILD="release"

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.

Note for users with Multiprocessor Systems

Scons can run several jobs simultaneously, which can use your multicore system to its full capacity. By calling

scons JOBS="2"

the tool runs up to two compile tasks at the same time, which speeds up things a bit.

For a dual-core setup, a value of 2 jobs should be is sufficient, especially if you have only one Gbyte of memory, or less. If your machine has 2 or more Gbyte, you can also try higher values like:

scons JOBS="4"

See also