Compiling Sources under Linux
From Rigs of Rods Wiki
Tip: Shell scripts for automatic building
If you just want to install RoR without much hassle then have a look at these shell scripts, they bundle all necessary steps:
1. Getting the required build dependencies
1.1 Installing required packages usually found in repositories
sudo apt-get update sudo apt-get install subversion mercurial git automake cmake build-essential pkg-config doxygen \ libfreetype6-dev libfreeimage-dev libzzip-dev scons libcurl4-openssl-dev \ nvidia-cg-toolkit libgl1-mesa-dev libxrandr-dev libx11-dev libxt-dev libxaw7-dev \ libglu1-mesa-dev libxxf86vm-dev uuid-dev libuuid1 libgtk2.0-dev libboost-all-dev \ libopenal-dev libois-dev libssl-dev libwxgtk3.0-dev
mkdir /etc/portage echo "media-libs/freeimage ~x86" >> /etc/portage/package.keywords echo "media-libs/freeimage" >> /etc/portage/package.unmask emerge -av cmake devil boost nvidia-cg-toolkit subversion wxGTK freeimage zziplib eselect wxwidgets set 1
1.2. Compiling and installing missing packages
You have to install all software which is not available in your distributions' repository by hand. See Compiling 3rd party libraries. This is necessary to fulfill the required dependencies.
Please note: OGRE shipped with some distributions does not have support for Cg enabled which is needed for Rigs of Rods (otherwise shaders will be missing, e.g. completely white cars) which is why you should compile it yourself.
2. Downloading the source code
Download the source code:
git clone https://github.com/RigsOfRods/rigs-of-rods.git cd rigs-of-rods
3. Configuring the source code
There are two different ways to configure your RoR build, either via Command Line Interface (aka CLI) or via GUI interface. CLI is the most straight forward. If you are only interested in compiling standard RoR, this is the recommended method.
cmake -DROR_USE_MYGUI="TRUE" \ -DROR_USE_OPENAL="TRUE" \ -DROR_USE_SOCKETW="TRUE" \ -DROR_USE_PAGED="TRUE" \ -DROR_USE_CAELUM="TRUE" \ -DROR_USE_ANGELSCRIPT="TRUE" \ -DCMAKE_BUILD_TYPE=RELEASE \ .
The cmake GUI might not be provided on all in systems.
To start the cmake gui run:
- click "Configure"
- select "Unix Makefiles" and "Use default native compilers" (that are the default options) and press "Finish"
- click "Configure" again until all list entries are white
- look at the log window for information and errors (look for red lines with " > " in front)
- enable the components you want to compile in: ROR_*
- click "Configure" again until the "Generate" button is click-able
- click "Generate"
- close cmake-gui
4. Building the source code
To start building simply run:
Note: For those not familiar with make you can add a -jx flag where x is the number of simultaneous build jobs you want (basic rule: one job per cpu core) to make use of multiple cores to speed up the building process.
Updating existing sources
If you already got the sources and just want to update, follow the steps below:
cd rigs-of-rods git pull rm -f CMakeCache.txt rm -rf CmakeFiles/ cmake-gui . make
If you are done compiling you may want to continue to read Starting RoR under Linux