- 1 Windows
- 2 OS X
- 3 Linux
- 4 FreeBSD
Building with MSYS2
- This is the recommended method to build VDrift. It does not require vdrift-win.
- Install MSYS2 and update local packages.
- Install build tools.
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-pkgconf scons
- Install VDrift dependencies.
pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-bullet mingw-w64-x86_64-curl mingw-w64-x86_64-libvorbis
- Build VDrift using MinGW-w64 Win64 Shell.
- For more build options run
Building with Code::Blocks/MinGW (obsolete)
- Download the latest MinGW. When asked to select components for install, you only need the base system and the g++ compiler.
- Your PATH Environment Variable should contain the MinGW bin path (e.g. C:\MinGW\bin;).
- Download Code::Blocks nightly
- Run the following command from the vdrift folder to generate the build files.
Building with MSVC (obsolete)
- Run the appropriate command from the vdrift folder to generate the project files.
- Microsoft Visual C++ 2008:
- Microsoft Visual C++ 2010:
The required build tools include:
The required libraries include:
- Boost C++ Libraries (header-file-only)
- Bullet - Open Source Physics Library (minimum version 2.83). Only the following libraries are required:
- libcurl - Multiprotocol file transfer library (minimum version 7.21.6)
- libvorbis - The Vorbis General Audio Compression Codec Library (minimum version 1.2.0)
- vorbisfile - File loading library for the ogg vorbis format
- SDL - Simple DirectMedia Layer Library (minimum version 2.0.0)
- SDL_image - Image file loading library (minimum version 1.2.10)
Make sure you have all the required libraries and build tools. Make sure you also have the development files for each of the libraries. 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.
All required packages can be installed using this command:
sudo yum install bullet-devel gcc-c++ glew-devel libarchive-devel scons SDL_*-devel curl-devel
Ubuntu does not include a libbullet package, but getdeb does. To add the getdeb-repository to your sources-list.d:
wget -q -O - http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add - sudo sh -c 'echo "deb http://archive.getdeb.net/ubuntu natty-getdeb games" > /etc/apt/sources.list.d/getdeb.list' sudo apt-get update
Ubuntu 11.04 (Natty Narwhal) does contain libglew1.5, only. To install libglew1.6 and its development headers:
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/glew/libglew1.6_1.6.0-3_amd64.deb sudo dpkg -i libglew1.6_1.6.0-3_amd64.deb rm libglew1.6_1.6.0-3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/glew/libglew1.6-dev_1.6.0-3_amd64.deb sudo dpkg -i libglew1.6-dev_1.6.0-3_amd64.deb rm libglew1.6-dev_1.6.0-3_amd64.deb
All other required packages can be installed using this command:
sudo apt-get install g++ libarchive-dev libcurl4-gnutls-dev \ libdrm-dev libgl1-mesa-dev \ libglu1-mesa-dev libkms1 mesa-common-dev \ libsdl-gfx1.2-dev libsdl-image1.2-dev \ libsdl-net1.2-dev libvorbis-dev freeglut3 libbullet0 \ libbullet-dev scons
To compile VDrift just run SCons in the root directory of the sources.
Optional: Compile Options
You can use one or more compile options. To compile with optimization for a certain platform, you can use the arch flag:
Compiling VDrift in release mode will turn off debugging options, and enable more compiler optimizations. VDrift runs much more quickly in release mode:
To enable force feedback, use this flag:
You can get a list of all compile time options with:
These options are probably best left off the first time you compile. If you have problems compiling or running VDrift, it is easier to debug with them off. Once you verify that VDrift is compiling, then recompile with these optimizations to improve performance.
VDrift does not need to be installed to work and you can run it from the folder where you compiled it. If you do want to install, use the SCons build target install.
sudo scons install
Optional: Installation Location
There are also some install options - to change where VDrift is installed, use the prefix flag:
scons install prefix=/usr/local
Building the project creates several artefacts that do not need to be stored, because they can be regenerated on demand. Cleaning them up can be done with SCons, too:
To remove all additional temporary files run:
rm -rf .sconf_temp/ .sconsign.dblite config.log vdrift.conf
To compile VDrift on FreeBSD, use the ports system.
If you downloaded a release, simply run
make on the vdrift port:
cd /usr/ports/games/vdrift && make install clean clean-depends
If you downloaded the development version, copy the vdrift and vdrift-data ports to vdrift-devel and vdrift-data-devel:
cd /usr/ports/games && cp -rf vdrift vdrift-devel && cp -rf vdrift-data vdrift-data-devel
To compile, run
make on the newly-created vdrift-devel port:
cd /usr/ports/games/vdrift-devel && make install clean clean-depends