Compiling 3rd party libraries

From Rigs of Rods Wiki

Jump to: navigation, search

Contents

Summary

This is the first step needed for packaging RoR so it can be included in a linux repository, since this will allow you to package and update each component of RoR individually. The motivation for writing this article is that some devs (including the initial author of this page) feel that dealing with the current cmake system is too cumbersome as the 3rd party library should rarely if ever be altered, and thus not included in the source tree.

Hopefully a script can released to automate the process of retrieving and compiling all these sources.

This Page assumes that you have already been able to compile RoR and have all the required supporting libraries already installed but are still compiling all the libraries included in SVN.

Versions

Libraries included with RoR:

Notes:

  • replace the -j2 with the appropriate CPU core number (-j4 for quadcore, etc)
  • when using sudo, be prepared to enter your password. Sudo is used to install the compiled software most of the time.

Libraries

These sections are listed in the order they should be done. Ogre should be done first since several of the other libraries require that it is installed such as Caelum, MyGUI, and Paged Geometry

it is recommended to create a dependencies directory and work in that:

mkdir ~/ror-deps
cd ~/ror-deps

Ogre

Lets Start off with Ogre since it is required by other libraries.

Ogre3D is the graphic engine RoR uses.

wget http://sourceforge.net/projects/ogre/files/ogre/1.7/ogre_src_v1-7-1.tar.bz2/download
tar xjf ogre_src_*.bz2
cd ogre_src*
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DOGRE_BUILD_SAMPLES:BOOL=OFF .
make -j2
sudo make install
cd ..

OIS

install binary

on ubuntu 9.10 and ubuntu 10.4 type

sudo apt-get install libois-dev libois-1.2.0

compile manually

compile from hand:

svn co https://wgois.svn.sourceforge.net/svnroot/wgois/ois/trunk/ ois-trunk
cd ois-trunk
bash bootstrap
./configure
make -j2
sudo make install
cd ..

MyGUI

svn co https://my-gui.svn.sourceforge.net/svnroot/my-gui/trunk my-gui -r2951
cd my-gui
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DMYGUI_BUILD_SAMPLES:BOOL=OFF -DMYGUI_INSTALL_SAMPLES:BOOL=OFF -DMYGUI_BUILD_TOOLS:BOOL=OFF -DMYGUI_BUILD_PLUGINS:BOOL=OFF .
make -j2
sudo make install
cd ..

Paged Geometry

IMPORTANT: a serious linux bug was fixed in the latest PagedGeometry version. It is advised to use this version: http://code.google.com/p/ogre-paged/source/checkout instead of 1.1.0.

wget http://ogre-paged.googlecode.com/files/pagedGeometry-1.1.0.zip
unzip pagedGeometry-1.1.0.zip
cd pagedGeometry-1.1.0
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DPAGEDGEOMETRY_BUILD_SAMPLES:BOOL=OFF .
make -j2 --silent
sudo make install
cd ..

since there is no uninstall script run this to remove PagedGeometry

sudo rm /usr/local/lib/libPagedGeometry.so
sudo rm -rf /usr/local/include/Paged

Caelum

note the build system for Caelum is scons, on ubuntu 9.10 and 10.4 install this with

sudo apt-get install scons

scons builds Caelum as a static library, RoR might expect it as a dynamic library that Ogre can load as a plugin, this may change for caelum to work.

wget http://sourceforge.net/projects/caelum/files/caelum/0.5/Caelum-0.5.0.zip/download
unzip Caelum-0.5.0.zip
cd Caelum-0.5.0/
scons -j2 --silent .
 
#install files
sudo cp libCaelum.a /usr/local/lib/
sudo mkdir /usr/local/include/Caelum
sudo cp main/include/* /usr/local/include/Caelum/
cd ..

since there is no uninstall script run this to remove Caelum

sudo rm /usr/local/lib/libCaelum.a
sudo rm -rf /usr/local/include/Caelum

MySocketW

NOTE: You have to install the OpenSSL developement package before you compile. In Ubuntu and Debian run
sudo apt-get install libssl-dev
, in CentOS run
yum install libssl-dev
.

This needs another patch Media:Socketw.patch to fix socketw for newer compilers

wget http://www.digitalfanatics.org/cal/socketw/files/SocketW031026.tar.gz
tar xzf SocketW031026.tar.gz
cd SocketW031026/
wget http://wiki.rigsofrods.com/images/c/c0/Socketw.patch
patch -p0 -d src < Socketw.patch
rm Socketw.patch
make -j2 --silent shared
sudo make install
cd ..

since there is no uninstall script run this to remove SocketW

sudo rm /usr/local/lib/libSocketW*
sudo rm /usr/local/include/SocketW.h
sudo rm /usr/local/include/sw_*.h

LUA

You need version 5.1+ which is provided by ubuntu 9.10 and 10.4

sudo apt-get install liblua5.1-0 liblua5.1-0-dev

AngelScript

mkdir angelscript
cd angelscript
wget http://www.angelcode.com/angelscript/sdk/files/angelscript_2.18.2.zip
unzip angelscript_2.18.2.zip
cd sdk/angelscript/projects/gnuc
SHARED=1 VERSION=2.18.2 make -j2 --silent
 
# sudo make install fails when making the symbolic link, this removes the existing versions
rm ../../lib/*
sudo SHARED=1 VERSION=2.18.2 make install
 
#cleanup files made by root
rm ../../lib/*
cd ../../../../../

MoFilereader

This needs another patch Media:MoFR.patch to fix MoFilereader for newer compilers

wget http://mofilereader.googlecode.com/files/moFileReader.0.1.2.zip
mkdir mo
cd mo
unzip ../moFileReader.0.1.2.zip
 
#apply needed patch
wget http://wiki.rigsofrods.com/images/1/1f/MoFR.patch
patch -p0 -d src < MoFR.patch
rm MoFR.patch
 
#build moFileReader library
cd build/
cmake -DCMAKE_BUILD_TYPE=Release -DCOMPILE_DLL=ON .
make -j2
cd ..
 
#install mo FileReader
sudo cp lib/libmoFileReader.so /usr/local/lib/
sudo cp include/* /usr/local/include/
cd ..

since there is no uninstall script run this to remove moFileReader

sudo rm /usr/local/lib/libmoFileReader.so
sudo rm /usr/local/include/moFile*.h

OpenAL

The correct version of open al is provided by ubuntu 9.10 and 10.4

sudo apt-get install libopenal1 libopenal-dev

Hydrax (obsolete)

Hydrax does not feature a linux buildsystem, so we have to patch one together.

WIP!

wget http://modclub.rigsofrods.com/xavi/Hydrax-v0.5.1.rar
rar x Hydrax-v0.5.1.rar
cd Hydrax-v0.5.1
#
# TO BE DONE: PATCH for Ogre 1.7!
#
wget http://wiki.rigsofrods.com/images/0/04/HydraxPatchForOgre17.patch
patch -p0 < HydraxPatchForOgre17.patch
wget http://wiki.rigsofrods.com/images/0/04/HydraxCMakeLists.txt
mv HydraxCMakeLists.txt CMakeLists.txt
cmake .
make -j2
make install

someone need to create a patch from this and supply here: http://www.ogre3d.org/addonforums/viewtopic.php?f=20&t=11089

Compiling RoR

see Compiling_Sources_under_Linux


Verification of the instruction on this page

  • Ubuntu 10.4 32 bit --tdev 00:13, 24 June 2010 (UTC)

(please extend)

Personal tools