|
This tutorial is aimed for Delta3D users on Linux who wish to setup a build environment from scratch. Since we do not distribute any Linux binaries (yet), this tutorial can be pretty handy.
Note: This tutorial is outdated as the version of the External Dependencies have changed, but this text still might be useful.
The Dependencies' Dependencies
Some of these libaries have a few dependencies of their own. I will address these as we get to them. That being said, you at least need a toolset to compile source code.
On Linux, MacOS X, and other flavors of Unix, this means gcc and the Autotools suite: Autoconf, and Automake. Don't worry, if you are on a development *nix system, you most likely have gcc and Autotools installed already. Since Autoconf and Automake are a big hassle to learn, use, and maintain, there are several alternative build tools available. Some of these tools are used by packages covered here (including Delta3D itself!), so you should go get and install them now. They include bjam (used for Boost), CMake (used for OpenAL and ALUT), and SCons (used for Delta3D).
This section of the tutorial covers building all of Delta3D's dependencies using a Linux development environment. Any Linux distribution should work just fine, sometimes with a little elbow grease. The most heavily tested distros are (in order) Fedora Core, Ubuntu, and openSUSE. Many of the dependencies can be found as binaries for your particular distro or platform. If it possible to track down a compatible binary and install it via a managed package installer, do it. Package managers, like yum, YaST, apt-get, and the super-cool Synaptic, are much easier to deal with and can often handle erasing packages without breaking dependencies.
The packages are listed alphabetically, but be careful, there are some inter-dependencies. Under the header for each package will be a note about its depedenices including links to other sections of this page. Also, since all of the action will happen at the command line, most build instructions are summarized as a quick shell script with some comments. The full script can be downloaded right here.
Python
Latest Recommended Version: 2.4.2
Almost all Linux distribution come with the Python runtime, but they often omit the python-devel package with gives you the necessary headers and libraries to use the Python/C API. Most distribution have a few "official" repositories of software where you can install the package python-devel. Or you can always build from source, if you're into that sort of thing.
Boost
Latest Recommended Version: 1.33.1
Dependencies: bjam, Python
Boost is a set of stable, rigorously tested, and highly confusing libraries. Most are written to exploit the bastard offspring of C++ called template metaprogramming. Delta3D currently has two uses for Boost. First, the GameNetworkingEngine (GNE) library uses Boost's shared_ptr and weak_ptr templates for reference counting. These templates are not specialized until GNE uses the headers, so there is no need to actually compile Boost just for GNE. The second reason for using Boost with Delta3D is Boost.Python. This library allows our C++ API to be reflected into Python. Boost.Python needs to be compiled against the Python/C API, which come as part of the pacakge 'python-devel' (see your local pacakge repository for details).
Boost.Python keys off of two environemnt variables to determine what version of Python to compile against:
- PYTHON_ROOT, which points to the root of your Python installation (usually /usr or /usr/local).
- PYTHON_VERSION, which contains the major and minor numbers of the Python version (e.g. 2.4)
You'll probably want to do a system-wide installation of the the full Boost package as well. So the following script performs a full build and installs everything into /usr/local
tar xfj boost_1_33_1.tar.bz2
cd boost_1_33_1
bjam -sTOOLS=gcc
bjam install
Note that a call to bjam install places headers by default into the directory /usr/local/include/boost-1_33_1/boost. However, all libraries that use Boost expect the boost directory (without version number) to be relative to the header search path. So you can do one of three things:
- Pass the prefixed directory to GNE and Delta3D as a special include directory (good if you want to keep around mulitple versions of Boost)
- Hard-link /usr/local/include/boost-1_33_1/boost to /usr/local/include/boost (also good if you want to keep around mulitple versions of Boost)
- Move the actual /usr/local/include/boost-1_33_1/boost directory up to /usr/local/include/boost and remove the old directory /usr/local/include/boost-1_33_1 (good if this is the only version of Boost you want to use)
CAL3D
Latest Recommended Version: 0.10.0
The only special note about CAL3D is that run-time type information (RTTI) is turned off by default. While this would normally be a good thing, Delta3D needs to use dynamic_cast a fair amount, so make sure to --enable-rtti.
tar xfj cal3d-full-0.10.0.tar.bz2
cd cal3d-0.10.0
./autogen.sh
./configure --enable-rtti
make
make install
CppUnit
Latest Recommended Version: 1.10.2
tar xfz cppunit-1.10.2.tar.gz
cd cppunit-1.10.2
./configure
make
make install
e2fsprogs
Latest Recommended Version: 1.38
The package is needed for one sub-library: uuid. e2fsprogs is actually a library of utilities for the ext2 filesystem, but part of that is a reusable tool for generating a Universally Unique Identifier (UUID). Someday, someone will write a custom routine for Delta3D that will satisfy this requirement and replace the implementation of the dtCore::UniqueId class.
tar xfz e2fsprogs-1.38.tar.gz
cd e2fsprogs-1.38
./configure
make
make install-libs
FLTK
Latest Recommended Version: 1.1.7
Note that FLTK has shared libraries and threading turned off by default. Delta3D needs them turned on with --enable-shared and --enable-threads.
tar xfj fltk-1.1.7-source.tar.bz2
cd fltk-1.1.7
./configure --enable-shared --enable-threads
make
make install
GDAL
Latest Recommended Version: 1.3.1
This library has a ton of optional dependencies. None of them are necessary for Delta3D.
tar xfz gdal-1.3.1.tar.gz
cd gdal-1.3.1
./configure
make
make install
InterSense Interface Libraries SDK
Latest Recommended Version: 3.83
This depedency supports the dtCore::Tracker class, which is design to interface with InterSense tracking devices. The InterSense SDK has two pruposes: it provides runtime driver support as well as the actual development SDK.
mkdir isense-3.83
mv isense.zip isense-3.83
cd isense-3.83
unzip isense.zip
cd isense-3.83
cp isense.h /usr/local/include
cp types.h /usr/local/include
cp -d Linux/x86/libisense.so /usr/local/lib
ODE
Latest Recommended Version: 0.5
To use ODE with Delta3D you must alter a config file. These can be configured by manually editing the file ode-0.5/config/user-settings. Precision needs to be set to SINGLE, and the OPCODE line needs to be uncommented so it will compile that into ODE.
tar xfz ode-0.5.tgz
cd ode-0.5
patch -p2 <../ode-0.5-dt-1.2.0.patch
make
cp -r include/ode /usr/local/include
cp lib/libode.a /usr/local/lib
OpenThreads
Latest Recommended Version: 1.4.2
Dependencies: pthread
It would be hard to believe there would be a Linux box out there without pthread though...
unzip OSG_OP_OT-1.0.zip
cd OSG_OP_OT-1.0/OpenThreads
make
make install
Producer
Latest Recommended Version: 1.0.1
Dependencies: OpenThreads
cd OSG_OP_OT-1.0/Producer
make
make install
OpenSceneGraph
Latest Recommended Version: 1.0.0
Dependencies: GDAL, FreeType, libjpeg, libpng, libtiff, libungif, zlib.
Most of these are pre-installed on distributions, but you may have to install a devel package if you are missing the headers. GDAL is a requirement for building osgTerrain which is in turn required for Delta3D. So make sure you have properly built and installed GDAL before attempting OpenSceneGraph.
cd OSG_OP_OT-1.0/OpenSceneGraph
make
cd src/osgTerrain && make
cd ../.. && make install
OpenAL
Latest Recommended Version: 0.0.8 (Specification 1.1)
Dependencies: Some sort of audio back-end like ALSA, SDL, or aRts. CMake.
The Autotools build system for OpenAL 0.0.8 and FreeALUT 1.0.0 is broken. Luckily the CMake one works.
tar xfz openal-0.0.8.tar.gz
cd openal-0.0.8
cmake . -DCMAKE_INSTALL_PREFIX:STRING="/usr/local" -DCMAKE_C_FLAGS:STRING="-O2"
make
make install
FreeALUT
Latest Recommended Version: 1.0.0
Dependencies: OpenAL.
If you have OpenAL installed to an odd place (e.g. not /usr/local or /usr) use you must use some environment variables to point FreeALUT to it:
OPENAL_PREFIX=/usr/local
export CPPFLAGS="-I${OPENAL_PREFIX}/inc"
export LDFLAGS="-L${OPENAL_PREFIX}/lib"
Otherwise, just build as normal:
tar xfz freealut-1.0.0.tar.gz
cd freealut-1.0.0
cmake . -DCMAKE_INSTALL_PREFIX:STRING="/usr/local" -DCMAKE_C_FLAGS:STRING="-O2"
make
make install
PLIB
Latest Recommended Version: 1.8.4
tar xfz plib-1.8.4.tar.gz
cd plib-1.8.4
./configure
make
make install
ReplicantBody
Latest Recommended Version: 2006-01-17
Dependencies: CAL3D, OpenSceneGraph.
CAL3D uses a program called pkp-config to notify other libraries about the location of its headers and libraries. When you install CAL3D into a directory, it places a file called lib/pkgconfig/cal3d.pc relative to the install directory. In order for ReplicantBody to find CAL3D the environment variable PKG_CONFIG_PATH must be set the pkgconfig directory. For ReplicantBody to find OpenSceneGraph, the libosg.so library must be somewhere that can be found at runtime (e.g. in /usr/local/lib or in a directory referenced in LD_LIBRARY_PATH).
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
tar xfz replicantbody-2006-01-17.tgz
cd replicantbody
./autogen.sh
./configure --prefix="/usr/local"
make
make install
The make install target seems to be a bit flaky so you may have to copy the include directories manually to /usr/local/include.
cp -r include/rbody /usr/local/include
cp -r include/rvrutils /usr/local/include
cp -r include/rcfg /usr/local/include
Xerces-C++
Latest Recommended Version: 2.6.0
Xerces-C++ 2.7.0 will work fine with Delta3D, but with that release they introduced a new warning by comparing unsigned and signed intergers without an explicit conversion. Since I don't like seeing miles of warnings, I stick with 2.6.0 for now.
tar xfz xerces-c-src_2_6_0.tar.gz
export XERCESCROOT=`pwd`/xerces-c-src_2_6_0
cd $XERCESCROOT/src/xercesc
autoconf
./runConfigure -plinux -cgcc -xg++ -minmem -nsocket -tnative -rpthread
make
make install
Crazy Eddie's GUI System
Latest Recommended Version: 0.4.1
Dependencies: FreeType, Xerces-C++.
tar xfj cegui_mk2-source-0.4.1.tar.bz2
cd cegui_mk2
./configure --disable-irrlicht-renderer --without-devil --without-ogre-renderer
make
make install
Hawk Networking Library
Latest Recommended Version: 1.68
cd HawkNL1.68
make -f makefile.linux
make -f makefile.linux install
HawkNL screws up the install and forgets to make a symlink to NL.so.1.6. Don't ask me why the runtime is using non-lib prefixed libraries anyway. So we gotta manually fixed that.
cd /usr/local/lib
ln -s libNL.so.1.6 NL.so.1.6
Game Networking Engine
Latest Recommended Version: 0.70
Dependencies: HawkNL, Boost, ncurses.
Make sure you install ncurses and then just go ahead and build.
cd gnelib-0.70
./fixlinux.sh
make
make install
Qt
Latest Recommended Version: 4.0.1
./configure
make
make install
|