|Version 100 (modified by Philip, 3 years ago) (diff)|
Table of Contents
This page describes how to get the very latest unstable version of the code. Unless you want to actively follow and contribute to development, you probably want the latest relatively-stable release instead.
The current release of the game is aimed at developers and not at 'normal' users. As such, the following instructions assume a reasonable level of technical proficiency. If you encounter difficulties, please post on the forum.
- An adequately high-spec computer - several gigabytes of free disk space, preferably at least 1GB of RAM for compiling, a fast CPU unless you want to spend ages waiting for the compiler, etc. Modern graphics hardware is also recommended, though the game can run (slowly) on fairly old devices (GeForce 4, Intel 945GM, etc).
- Up-to-date system software (Windows service packs, graphics driver updates, etc).
- Some technical proficiency. We try to make the build process as smooth and painless as possible, but it's designed to be followed by programmers - if you just want to play the game, wait for a pre-packaged installer instead.
Windows XP, Vista and 7 are the main supported versions; 2000 should work too but is rarely tested. Visual C++ 2005 and 2008 are supported; older versions aren't, newer versions may work but haven't been tested, MinGW certainly won't work. Only 32-bit builds are supported (though they can be compiled and run on 64-bit Windows).
Acquiring the code
The game's code, data and build environment are stored on a Subversion server. The recommended way to get an up-to-date copy is with TortoiseSVN:
- Download and install TortoiseSVN. (Make sure you reboot when it asks you to.)
- Use TortoiseSVN to check out http://svn.wildfiregames.com/public/ps/trunk/. This may take a while, and will use around 700MB of disk space.
(This is the read-only public SVN URL. If you have commit access, you need to use http://svn.wildfiregames.com/svn/ps/trunk/ instead.)
Setting up the build environment
The game must be compiled with Microsoft Visual C++. If you already have Visual C++ 2005 or 2008 installed, make sure you have SP1 and then continue. Otherwise, you can get the free Express edition:
- Download and install Visual C++ 2008 Express Edition. (You can skip the optional Silverlight and SQL Server components.)
(If you have the old VC++ 2005 Express, you need to install the separate Platform SDK (steps 1-3).)
The Visual Studio project/solution files are automatically generated from the source files:
- Run build/workspaces/update-workspaces.bat.
- Open build/workspaces/vc2008/pyrogenesis.sln. (If you have VC++ 2005, use the vc2005 directory instead.)
Now you should be able to build the code from within Visual Studio, using "Build Solution" (F7).
Run the game with F5 inside Visual Studio (assuming "pyrogenesis" is set as the startup project, which is default). If you want to run it outside the debugger, run binaries/system/pyrogenesis_dbg.exe.
To run the automated tests, run the "test" project. (Right click on "test" and "set as StartUp Project" and F5; or right click, "Debug", "Start new instance"). In VS's debug output window, ignore any "first-chance exception" messages; it should say ".......OK!" if it succeeded.
Keeping up to date
After you've set everything up, the process for staying up to date is:
- Update the root directory of the checkout.
- Close the solution in Visual Studio if you've got it open. Run update-workspaces.bat again. (This is only needed if any source files have been added or removed. If you forget to run this, you'll probably get build errors about missing symbols.)
- Build again.
This is much less streamlined than the process for Windows. But you're cooler than a Windows developer, so you should be able to cope:
- Install various standard tools and development libraries:
- GCC (at least 4.0, preferably 4.3)
- There is a bug in NASM 2.06 on x86_64, so you might want to try a different version if you get errors.
- wxWidgets (probably called wxgtk on Linux) (optional, but required for the editor tools)
- Gamin (FAM should work too) (Linux only)
- BFD (typically called something like binutils-dev) (Linux only)
- ENet 1.2.x (not 1.3.x)
- Optionally: NVTT (pass the flag --with-system-nvtt to update-workspaces.sh to use the installed version; otherwise we'll automatically use a bundled copy of the library)
- For Ubuntu or Debian (at least unstable and testing) the following might help:
sudo apt-get install subversion build-essential cmake libsdl1.2-dev zlib1g-dev libpng12-dev libjpeg62-dev libgamin-dev nasm libwxgtk2.8-dev libboost-dev libboost-signals-dev libboost-filesystem-dev libopenal-dev libalut-dev libvorbis-dev libogg-dev binutils-dev libdevil-dev libenet-dev libxml2-dev
- For Mandriva (tested with 2009.1):
urpmi libboost-devel libwxgtk2.8-devel libwxgtku2.8-devel libbinutils2-devel libopenal-devel zlib1-devel libpng-devel libogg0-devel libvorbis-devel libSDL-devel libdevil-devel libgamin-1_0-devel libjpeg62-devel libfreealut-devel nasm make svnNo ENet package is available, so install it from source.
- For Fedora (tested with 13):
yum -y install subversion gcc-c++ nasm SDL-devel boost-devel zlib-devel libpng-devel libjpeg-devel libxml2-devel openal-devel libogg-devel libvorbis-devel wxGTK-devel gamin-devel binutils-static binutils-devel enet-devel DevIL-devel
- svn co http://svn.wildfiregames.com/public/ps/trunk/
- cd trunk/build/workspaces
- ./update-workspaces.sh (if you update to a later version of the code from SVN, you should run this again each time)
- cd gcc
- make CONFIG=Release -j3 (where 3 is the number of parallel builds to run, and could perhaps be one plus the number of CPU cores available)
- Note: Parallel building can cause errors due to race conditions. Run a "make clean" and try just "make" if you encounter problems.
- The Release mode builds are more optimised, are harder to debug. Use CONFIG=Debug (and run pyrogenesis_dbg) if you are developing engine code that needs debugging.
- If you encounter any build errors, look for an existing bug report or report a new bug. Also check the known problems section below.
- cd ../../../binaries/system
- Optionally, run the automated tests to verify that everything works as expected: ./test
- Run the game: ./pyrogenesis
- Optionally, run the map editor: ./pyrogenesis -editor
The process on OS X is similar to Linux:
- Install Apple's XCode for your system: see your Mac OS X install DVD or go to Apple's Developer Connection Site. This provides the necessary tools to compile programs. For Leopard, you must install XCode >= 3.1 from the ADC site else some components will not compile.
- Install MacPorts. This is the easiest way to install all the dependencies needed by the game.
- sudo port install the following packages :
- subversion (the default version on 10.5 seems to cause checksum mismatch errors)
- Now follow the same instructions as for Linux above, starting from the svn co.
- The Atlas editing tools do not work under OS X (#500), so you may need to edit update-workspaces.sh and remove the --atlas flag before running it.
Compiling with GCC 4.2 or 4.3 under OS X
If you get errors compiling with OS X's default version of GCC (4.0.1), you can try compiling with GCC 4.2 or 4.3. On Snow Leopard, running export CXX=/usr/bin/g++-4.2 before compiling the game may be sufficient. Leopard does not ship with a recent version of GCC, so you first have to get them from MacPorts and then patch some system libraries:
- sudo port install gcc42 gcc43 gcc_select
- Select GCC 4.2 or 4.3: sudo gcc_select mp-gcc42 or sudo gcc_select mp-gcc43
- Take care that libdevil 1.6.8-rc2 (the version in MacPorts) is not compatible with GCC 4.3, you'll need to install 1.7.8. Get it from http://openil.sourceforge.net/download.php, then extract the archive, and run ./configure --enable-ILU --enable-ILUT then make then sudo make install
- You may need to patch Apple's OpenAL (/System/Library/Frameworks/OpenAL.Framework/alc.h: replace all ALCvoid by void, except the first one which is a typedef). (GCC >=4.2 is stricter about parameters invalidly typedefed to void in C++.)
- If you're under Tiger, you'll certainly have to edit build/premake/premake.lua to get rid of the -fstack-protector-all line: see the known problems section.
- Then, restart the compilation starting from ./update-workspace.sh
Known problems and solutions
- If you get linker errors like multiple definition of '(anonymous namespace)::_1', particularly when using GCC 4.1, try running ./update-workspaces.sh --without-pch and then cd gcc; make clean and rebuild.
- If you get errors because of missing or renamed files during update-workspaces or compile try
make clean in /build/workspaces/gcc (on Linux) and start again at update-workspaces.
- If you get linker errors like /usr/bin/ld: Undefined symbols: ___stack_chk_fail, ___stack_chk_guard, this comes from using a libc that is not glibc >=2.4. Until this is detected by the build system, you can hack it by removing the "-fstack-protector-all" line (and the next line too if needed) from build/premake/premake.lua
- If you get
/opt/local/include/js/jsotypes.h:77: error: conflicting declaration ‘typedef struct JSUint64 uint64’ /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:48: error: ‘uint64’ has a previous declaration as ‘typedef uint64_t uint64’Run your favourite text editor as root, and edit line 77 of /opt/local/include/js/jsotypes.h from typedef JSUint64 uint64; to
#ifndef _UINT64 typedef JSUint64 uint64; #define _UINT64 #endif