Difference between revisions of "Compiling VDrift"

From VDrift
Jump to: navigation, search
(Moved to Compiling)
 
(91 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Compiling VDrift is different depending on the operating system on which it is compiled.
+
#REDIRECT [[Compiling]]
 
 
==Linux==
 
===Prerequisites===
 
Make sure you have all the required libraries and build tools. Make sure you also have the development files for each of the libraries.
 
 
 
The required libraries include:
 
 
 
* libsdl - Simple Direct Media Layer
 
* sdl-gfx - Graphics drawing primitives library for SDL
 
* sdl-image - Image file loading library for SDL
 
* sdl-net - Low-level network library for SDL
 
* vorbisfile - File loading library for the ogg vorbis format
 
 
 
Your Linux distribution may have different package names and/or bundled differently. The list above should give enough information to search for applicable packages within your distribution's package manager.
 
 
 
Bullet is required for physics and is included in the source.
 
On linux it can be installed like this:
 
* cd bullet-2.64
 
* ./configure
 
* jam bulletcollision bulletmath
 
 
 
This should put the bullet libraries into a spot in the bullet-2.64 tree that the VDrift build files are expecting (in either bullet-2.64/out/linuxx86/optimize/libs or bullet-2.64/out/linux/optimize/libs).
 
 
 
====SCons====
 
As of the 2005-10-02 release, VDrift no longer uses ./configure, make, etc. (autotools). Now the project is built with [http://scons.org/ SCons]. You may want to read a little about [[Using SCons]].
 
 
 
There are two ways to use SCons. The first way is to install scons on your system, then you can use it simply by the name of the program, "scons". The second way is to use the scons-local package (included with VDrift) which will do the same thing but doesn't require that you install scons on your system. To do this, you must move the scons-local-0.96.95.tar.gz archive from tools to the root vdrift folder, un-tar the archive, and then use the <code>./scons.py</code> command instead of <code>scons</code>.
 
 
 
===Get the Code===
 
You can get the code from a source package for a particular version, or you can get the development version.
 
====Source Package====
 
[http://sourceforge.net/project/showfiles.php?group_id=137283 Download] the latest VDrift Linux source package. All the files in the package are in a directory called vdrift-'''version'''-src where '''version''' is something like 2005-10-02.
 
 
 
Unpack the archive.
 
 
 
tar jxvf vdrift-2005-10-02-src.tar.bz2
 
 
 
=====Data=====
 
You must choose a data package to install, as the source package does not come with any data (not even the minimal set). Make sure to get a data set that is in a tarball (.tar.gz file) and not one of the other kinds of packages available for download on the [http://sourceforge.net/project/showfiles.php?group_id=137283 VDrift downloads page]. The filename will be something like "vdrift-VERSION-data-full.tar.bz2" (full data set - all cars and tracks) or "vdrift-VERSION-data-minimal.tar.bz2" (minimal data set - small download size).
 
 
 
Before you can install VDrift, you must unpack the data so that it's in the source directory. If you downloaded the correct package, the data can be unpacked in the same place that the source package was unpacked.
 
 
 
tar jxvf vdrift-2005-10-02-data-full.tar.bz2
 
 
 
=====Enter directory=====
 
Now change directories into the location of your newly created VDrift source tree.
 
cd vdrift-2005-10-02-src
 
 
 
====Development version====
 
You can [[Getting the development version#Linux.2FUnix|check out the development version]] of VDrift from our Subversion repository.
 
 
 
Once you've checked out the code, enter the directory Subversion created.
 
cd vdrift
 
 
 
====Optional: Using scons-local instead of installing SCons====
 
If you have decided not to install SCons on your system, you can use scons-local. To set it up, do the following:
 
 
 
tar zxvf tools/scons-local-0.96.1.tar.gz
 
 
 
{{note|Some of the following steps refer to the <code>scons</code> command, you should now replace that with <code>./scons.py</code>.}}
 
 
 
===Compiling===
 
To compile VDrift, just use the <code>scons</code> command.
 
scons
 
 
 
====Options====
 
You may need to use one or more compile options. To compile with optimization for a certain platform, you can use the '''arch''' option.
 
scons arch=a64
 
Compiling VDrift in '''release''' mode will turn off debugging options, and enbale more compiler optimizations.
 
scons release=1
 
 
 
===Installing===
 
To install, use the SCons build target '''install'''. This command must be run as root.
 
scons install
 
 
 
====Options====
 
There are a few options it's important to know about when installing VDrift. These include the install location, and the amount of data that is installed.
 
To install the full data set you must turn off the '''minimal''' option, which is on by default.
 
scons install minimal=0
 
 
 
You can also change the installation prefix. By default, VDrift is installed to <code>/usr/share/games/vdrift</code>, but if you wanted it to go in <code>/usr/local/share/games/vdrift</code>, you can change the '''prefix''' setting.
 
scons install prefix=/usr/local
 
 
 
{{note|There are many more build and install options, see the [[Using SCons]] page for more information.}}
 
 
 
==OS X==
 
===Prerequisites===
 
To use the latest development code, you will need a Subversion client, see [[Getting the development version#Mac OS X]].
 
 
 
The VDrift Mac OS X project requires Xcode version 2.2 with the "10.4 Universal SDK" and the "X11 SDK" installed.
 
 
 
===Download===
 
Get the VDrift source code, either from the latest source release on the [http://sourceforge.net/project/showfiles.php?group_id=137283 VDrift downloads page], or the [[Getting the development version#OS X|development version]].
 
 
 
===Build===
 
Finally open ''tools/osx/vdrift.xcodeproj'' and hit "Build" from XCode's "Build" menu.
 
 
 
==Windows==
 
These directions have been verified to work, starting from scratch, as of source revision R1888.
 
===Prerequisites===
 
To build VDrift on Windows you'll need working installations of mingw, MSYS, python, and scons.
 
 
 
===Download===
 
Get the VDrift source code, either from the latest source release on the [http://sourceforge.net/project/showfiles.php?group_id=137283 VDrift downloads page], or the [[Getting the development version#Windows|development version]].
 
 
 
===Build===
 
Launch MSYS and change directories to the folder where you put the VDrift source.  Do the following:
 
cp tools/win/bin/jam.exe /bin
 
cd bullet-2.64
 
./configure
 
export JAM_TOOLSET=MINGW
 
jam bulletcollision bulletmath
 
jam bulletcollision bulletmath (yes, I had to run the command twice to get it to work)
 
cd ..
 
scons
 
Next you'll need to:
 
* Create a vdrift-runtime folder
 
* Copy build/vdrift.exe file to the runtime folder
 
* Copy tools/win/dll/*.dll to the runtime folder
 
* Check out the data repository into the runtime folder under data/
 

Latest revision as of 12:52, 26 August 2012

Redirect to: