Changes between Version 172 and Version 173 of BuildInstructions
- Timestamp:
- May 26, 2012, 9:36:21 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BuildInstructions
v172 v173 1 1 [[TOC]] 2 2 3 '''NOTE: The build system has changed since Alpha 7 and the instructions are now subtly different. If you want to build Alpha 7 or previous versions of the game, use the [http://trac.wildfiregames.com/wiki/BuildInstructions?version=140 older version] of this page.''' 4 5 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 [LatestRelease latest relatively-stable release] instead. 3 [[br]] 4 5 **NOTE: The build system has changed since Alpha 7 and the instructions are now subtly different.** 6 7 **If you want to build Alpha 7 or previous versions of the game, use the older version of this page.** 8 9 [[br]] 10 11 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 [wiki:LatestRelease latest relatively-stable release] instead.** 6 12 7 13 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 [http://www.wildfiregames.com/forum/index.php?showforum=312 forum]. 14 15 [[br]] 16 8 17 9 18 == General prerequisites == … … 11 20 12 21 * An adequately high-spec computer: 13 * At least 5GB of free disk space14 * Preferably at least 1GB of RAM for compiling15 * Intel x86-compatible CPU, 32- or 64-bit, multiple cores will help compile faster16 * Modern graphics hardware is also recommended, though the game can run (slowly) on fairly old devices (!GeForce 4, Intel 945GM, etc)22 * At least 5GB of free disk space 23 * At least 1GB of RAM for compiling 24 * Intel x86-compatible CPU, 32- or 64-bit 25 * Modern graphics hardware is also recommended, though the game can run (slowly) on fairly old devices (!GeForce 4, Intel 945GM, etc) 17 26 * One of the following operating systems: 18 * [#Windows Windows] (2000 or newer)19 * [#Linux Linux]20 * [#OSX OS X] (currently 10.6 or newer)21 * [#FreeBSD FreeBSD] (only experimental support at this time)27 * [#Windows Windows] (2000 or newer) 28 * [#Linux Linux] 29 * [#OSX OS X] (currently 10.6 or newer) 30 * [#FreeBSD FreeBSD] (only experimental support at this time) 22 31 * Up-to-date system software (Windows service packs, graphics driver updates, etc) 23 32 * 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. 24 33 34 [[br]] 35 25 36 == Windows == 26 Windows 7, Vista and XP are the main supported versions; 2000 should work too but is rarely tested. Visual C++ 2010 and 2008 are supported. Visual C++ 2005 may also work given a sufficiently modern Platform SDK. Only 32-bit builds are supported (though they can be compiled and run on 64-bit Windows). We have noticed occasional trouble with the free Express Editions; if possible, please consider acquiring the full version (e.g. via university programs). In particular, failures of the built-in self-test test_wdbg_sym.h seem to occur with VC2008 EE but not VC2008 nor VC2010 (c.f. #884). 37 38 The main supported OS are : 39 * Windows 7 40 * Windows Vista 41 * Windows XP 42 43 Windows 2000 should work too but is rarely tested. 44 45 The main supported IDE are : 46 * Visual C++ 2010 and 2008 47 * Code Blocks 48 {{{ 49 #!comment 50 Code Blocks is guessed from 0ad/build/workspaces/codeblocks 51 What about the support of Eclipse ? 52 }}} 53 54 NOTE : Visual C++ 2005 may work with a sufficiently modern Platform SDK. 55 56 NOTE : Only 32-bit builds are supported (though they can be compiled and run on 64-bit Windows) 57 58 NOTE : We have noticied occasional trouble with the free Express Editions; please consider acquire the full version (e.g. via university programs) or using free IDE like Code Blocks or Eclipse CDT. 59 In particular, failures of the built-in self-test test_wdbg_sym.h seem to occur with VC2008 EE but not VC2008 nor VC2010 (c.f. #884). 60 27 61 28 62 === Acquiring the code === … … 43 77 * If you have the old VC++ 2005 Express, you need to install the separate [http://social.msdn.microsoft.com/forums/en-US/Vsexpressvc/thread/c5c3afad-f4c6-4d27-b471-0291e099a742/ Platform SDK] (steps 1-3). 44 78 45 46 79 The Visual Studio project/solution files are automatically generated from the source files: 47 80 … … 49 82 * Open `build/workspaces/vc2010/pyrogenesis.sln`. (Use the `vc2005` directory for VC++ 2005 or the `vc2008` directory for VC++ 2008.) 50 83 51 === Optimisedbuilds ===52 Make sure to select the "Release" configuration to build a n optimised,more playable version of the game (the target will be `pyrogenesis.exe`). The "Debug" configuration can be more useful for debugging but has significantly reduced performance (the target will be `pyrogenesis_dbg.exe`). Both "Release" and "Debug" builds include debug symbols, see [wiki:DebuggingOnWindows Debugging on Windows] for more details on debugging.84 === Type of builds === 85 Make sure to select the "Release" configuration to build a more playable version of the game (the target will be `pyrogenesis.exe`). The "Debug" configuration can be more useful for debugging but has significantly reduced performance (the target will be `pyrogenesis_dbg.exe`). Both "Release" and "Debug" builds include debug symbols, see [wiki:DebuggingOnWindows Debugging on Windows] for more details on debugging. 53 86 54 87 Now you should be able to build the code from within Visual Studio, using "Build Solution" (F7). … … 69 102 * Build again. 70 103 104 [[br]] 105 71 106 == Linux == 72 73 107 0 A.D. should work on any reasonably modern Linux distro, on x86 and x86_64 (amd64). The details depend on exactly which distro you use. 74 108 75 109 === Dependencies === 76 77 110 First you need to install various standard tools and development libraries: 78 111 79 112 * Boost 80 113 * CMake (only needed if you use bundled NVTT) 114 * premake4 81 115 * Gamin (FAM should work too, but is considered deprecated) 82 116 * GCC (at least 4.0, preferably 4.3 or later) … … 102 136 103 137 ==== Debian (wheezy or later) / Ubuntu (12.04 or later) ==== 104 105 138 Install the dependencies with: 106 107 {{{ 108 #!html 109 <pre class="wiki" style="white-space: pre-wrap"> 110 sudo apt-get install build-essential libboost-dev libboost-filesystem-dev libboost-signals-dev libcurl4-gnutls-dev libenet-dev libgamin-dev libjpeg-dev libmozjs185-dev libnvtt-dev libogg-dev libopenal-dev libpng-dev libsdl-dev libvorbis-dev libwxgtk2.8-dev libxcursor-dev libxml2-dev subversion zlib1g-dev 111 </pre> 139 140 {{{ 141 #!sh 142 sudo apt-get install build-essential libboost-dev libboost-filesystem-dev \ 143 libboost-signals-dev libcurl4-gnutls-dev libenet-dev libgamin-dev \ 144 libjpeg-dev libmozjs185-dev libnvtt-dev libogg-dev libopenal-dev \ 145 libpng-dev libsdl-dev libvorbis-dev libwxgtk2.8-dev libxcursor-dev \ 146 libxml2-dev premake subversion zlib1g-dev 112 147 }}} 113 148 * You can also use `libcurl4-openssl-dev` instead of `libcurl4-gnutls-dev` (it's not possible to install both at once), but note that openssl is not GPL compatible and the resulting binaries could not be redistributed. … … 115 150 116 151 ==== Mandriva ==== 117 118 152 Install the dependencies with: 119 153 120 154 {{{ 121 #! html122 <pre class="wiki" style="white-space: pre-wrap"> 123 urpmi gcc-c++ python subversion zip cmake boost-devel fam-devel libcurl-devel libjpeg-devel libpng-devel libvorbis-devel libxml2-devel libwxgtku2.8-devel openal-soft-devel 124 </pre> 155 #!sh 156 urpmi gcc-c++ python subversion zip cmake premake boost-devel fam-devel \ 157 libcurl-devel libjpeg-devel libpng-devel libvorbis-devel libxml2-devel \ 158 libwxgtku2.8-devel openal-soft-devel 125 159 }}} 126 160 127 161 ==== Fedora ==== 128 129 162 Install the dependencies with: 130 163 131 164 {{{ 132 #! html133 <pre class="wiki" style="white-space: pre-wrap"> 134 su -c 'yum -y install gcc-c++ python subversion zip cmake boost-devel fam-devel libcurl-devel libjpeg-devel libpng-devel libvorbis-devel libxml2-devel openal-soft-devel pkgconfig SDL-devel wxGTK-devel' 135 </pre> 165 #!sh 166 su -c 'yum -y install gcc-c++ python premake subversion zip cmake boost-devel \ 167 fam-devel libcurl-devel libjpeg-devel libpng-devel libvorbis-devel \ 168 libxml2-devel openal-soft-devel pkgconfig SDL-devel wxGTK-devel' 136 169 }}} 137 170 138 171 ==== OpenSUSE ==== 139 140 172 Install the dependencies with: 141 173 142 174 {{{ 143 #! html144 <pre class="wiki" style="white-space: pre-wrap"> 145 sudo zypper install gcc-c++ python subversion zip cmake boost-devel fam-devel libcurl-devel libjpeg-devel libpng-devel libvorbis-devel libxml2-devel openal-soft-devel pkg-config wxGTK-devel libSDL-devel 146 </pre> 175 #!sh 176 sudo zypper install gcc-c++ python premake subversion zip cmake boost-devel \ 177 fam-devel libcurl-devel libjpeg-devel libpng-devel libvorbis-devel \ 178 libxml2-devel openal-soft-devel pkg-config wxGTK-devel libSDL-devel 147 179 }}} 148 180 … … 150 182 151 183 === Getting the code === 152 153 184 0 A.D. is primarily developed on SVN. To checkout the latest code from SVN, run this command: 154 185 155 186 {{{ 187 #!sh 156 188 svn co http://svn.wildfiregames.com/public/ps/trunk/ 0ad 157 189 }}} 158 190 159 Sometimes SVN stops before it has downloaded all files. You should check that it outputs something like `at revision rXXXX`. Otherwise run 160 {{{ 191 Note : Sometimes SVN stops before it has downloaded all files. You should check that it outputs something like `at revision rXXXX`. Otherwise run 192 193 {{{ 194 #!sh 161 195 svn up 0ad 162 196 }}} … … 165 199 166 200 {{{ 201 #!sh 167 202 git clone https://github.com/0ad/0ad.git 168 203 }}} 169 204 170 205 === Building === 171 172 206 Compile the code with: 207 173 208 {{{ 174 209 #!sh … … 185 220 186 221 === Testing === 187 188 222 Run the automated tests to verify that everything works as expected like this: 189 223 190 224 {{{ 225 #!sh 191 226 binaries/system/test 192 227 }}} 193 228 194 229 === Running === 195 196 230 If everything went well, compiling the code worked and all tests passed, it's finally time to run the game: 197 231 198 232 {{{ 233 #!sh 199 234 binaries/system/pyrogenesis 200 235 }}} 201 236 202 237 === Keeping up to date === 203 204 238 If you already checked out the code and only want to update and rebuild it, you may find it helpful to save the lines below to a script called e.g. `rebuild.sh`, place it in your 0ad directory, make it executable and run it. 205 239 … … 218 252 219 253 If you just edited one source code file and want to rebuild, you can usually get away with: 254 220 255 {{{ 221 256 make -j3 … … 223 258 224 259 If you want to rebuild quickly after updating from SVN, you can usually get away with: 260 225 261 {{{ 226 262 #!sh … … 231 267 make -j3 232 268 }}} 269 233 270 If the `make` line gives errors, you may need to run `make clean` before it. If the `update-workspaces.sh` gives errors, you may need to run `clean-workspaces.sh` before it. 271 272 == Creating Linux packages == 273 If you want to create packages for a Linux distribution, see the current [https://build.opensuse.org/package/files?package=0ad&project=games 0ad] and [https://build.opensuse.org/package/files?package=0ad-data&project=games 0ad-data] packages on OBS for examples (especially the `.spec` and `debian.rules` files). 274 [[br]] 234 275 235 276 == OS X == … … 238 279 * If you're using Lion 10.7.3 or later, Apple has made their ''Command Line Tools for Xcode'' package freely available, as a separate download. '''It does not include or require Xcode.''' If you don't want the Xcode IDE, it's recommended to install only this package from [https://developer.apple.com/downloads/index.action Apple Developer Downloads]. You need a free Apple ID to access the download. If you already have Xcode 4.3+, you can download the command line tools from the [https://developer.apple.com/library/IOs/#recipes/xcode_help-documentation_preferences/DownloadingandInstallingXcodeComponents/DownloadingandInstallingXcodeComponents.html download preferences]. 239 280 * If you're using Snow Leopard or Lion 10.7.2 or earlier, you'll probably need to install Xcode to get the command line tools (or you can try [https://github.com/kennethreitz/osx-gcc-installer/ OSX GCC Installer]): 240 241 242 281 * If available, use your Mac OS X install DVD which saves downloading 1.72+ GB. 282 * Visit [https://developer.apple.com/downloads/index.action Apple Developer Downloads] (logging in with your free Apple ID) and download the latest Xcode version for your OS. Version 4.x is required for Lion, while version 3.x is required for Snow Leopard. It's very important you install the correct version. 283 * The latest version of Xcode is also available for free from the [http://www.apple.com/mac/app-store/ Mac App Store], you'll need Snow Leopard 10.6.6 or later to access the App Store. ''Note: if you download the app, it is only the installer for Xcode. You need to open it and run the "Install Xcode" app.'' 243 284 * Install [http://www.macports.org/install.php MacPorts]. This is the easiest way to install all the dependencies needed by the game. 244 285 * `sudo port install` the following packages : … … 252 293 * wxWidgets-devel (required for building Atlas, only the 2.9.x branch will work on 64-bit Macs) 253 294 * subversion (the default version on 10.5 seems to cause checksum mismatch errors) 295 296 Run the fdollowing command in a shell : 297 {{{ 298 #!sh 299 sudo port install boost cmake libenet libsdl libvorbis libxml2 curl wxWidgets-devel subversion 300 }}} 301 254 302 * Now follow the [#Gettingthecode same instructions] as for Linux above, starting from the `svn co`. 255 303 * Newer versions of Xcode no longer include the command line tools by default, you need to install them as described above. Additionally, the command line tools package no longer includes GCC but it does include LLVM-GCC which is compatible. If you get errors during the build like "C compiler cannot create executables" then you probably have the newer command line tools with LLVM. The following command should fix it: 256 {{{ 304 {{{ 305 #!sh 257 306 export CC=gcc CXX=g++ 258 }}} 259 307 }}} 260 308 261 309 === Compiling with GCC 4.2 or 4.3 under OS X === 262 263 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 264 {{{ 310 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 311 312 {{{ 313 #!sh 265 314 export CXX=/usr/bin/g++-4.2 266 315 }}} 267 316 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: 268 317 269 * `sudo port install gcc42 gcc43 gcc_select` 270 271 * Select GCC 4.2 or 4.3: `sudo gcc_select mp-gcc42` or `sudo gcc_select mp-gcc43` 318 {{{ 319 #!sh 320 sudo port install gcc42 gcc43 gcc_select` 321 }}} 322 323 * Select GCC 4.2 or 4.3: 324 {{{ 325 #!sh 326 sudo gcc_select mp-gcc42 327 }}} 328 329 or 330 331 {{{ 332 #!sh 333 sudo gcc_select mp-gcc43 334 }}} 272 335 273 336 * You may need to patch Apple's OpenAL (`/System/Library/Frameworks/OpenAL.Framework/Headers/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++.) … … 279 342 == FreeBSD == 280 343 '''Note: this is a work in progress and should be considered experimental. That means don't try it unless you "know what you're doing" :)''' 344 281 345 * Install the following ports or packages (using `pkg_add -r`): 282 * sdl 283 * boost-libs 284 * png 285 * execinfo 286 * libxml2 287 * libGL 288 * openal 289 * zip 290 * libogg 291 * libvorbis 292 * curl 293 * gamin 294 * cmake 295 * wxgtk2-unicode - required to build Atlas tools 296 * subversion - note the latest version for 8.2 Release is 1.6 297 * Note: GCC 4.2.1 and zlib should already be installed by default 346 * sdl 347 * boost-libs 348 * png 349 * execinfo 350 * libxml2 351 * libGL 352 * openal 353 * zip 354 * libogg 355 * libvorbis 356 * curl 357 * gamin 358 * cmake 359 * wxgtk2-unicode - required to build Atlas tools 360 * subversion - note the latest version for 8.2 Release is 1.6 361 * Note: GCC 4.2.1 and zlib should already be installed by default 362 {{{ 363 #!sh 364 pkg_add -r adl boots-libs png execinfo libxml2 libGl openal zip libogg \ 365 libvorbis curl gamin cmake premake wxgetk2-unicode subversion 366 }}} 367 298 368 * Obtain the game's source code as [#Gettingthecode described above] for Linux. 299 369 * TODO: Fix missing ecvt() and get premake to generate a proper build/gmake.unix/Makefile, or maybe create a build/gmake.bsd/? (the only difference is it tries to link libdl, which doesn't exist on FreeBSD) 300 370 * If building Atlas, you need to set the `WX_CONFIG` variable, because `wx-config` has a different name on FreeBSD. For example, you'd run this command if you built the wxGTK 2.8 package with unicode support: 301 371 {{{ 372 #!sh 302 373 export WX_CONFIG=wxgtk2u-2.8-config 303 374 }}} 304 375 if not correct, you will get errors about missing "wx/*.h" includes. You can skip building Atlas altogether (and the wxWidgets dependency) by later passing the `--disable-atlas` option to `update-workspaces.sh`. 305 * You'll have to set this variable every time you run `update-workspaces.sh`, so it may be most convenient to put these commands into another shell script.376 * You'll have to set this variable every time you run `update-workspaces.sh`, so it may be most convenient to put these commands into another shell script. 306 377 * Note: FreeBSD's `make` command is actually Berkeley [http://www.freebsd.org/cgi/man.cgi?query=make make], which is similar to but different than GNU make. Our build scripts will detect if you're on FreeBSD and use the `gmake` command instead. If for some reason this isn't correct, you can set the `MAKE` environment variable with the path and name of the correct GNU make. 307 378 * Follow the [#Building build] instructions above for Linux. … … 338 409 }}} 339 410 then you are likely using a build directory with spaces in its path. !SpiderMonkeys build system isn't designed to cope with spaces in the source path (see #916). Rename your build directory so that it doesn't contain any spaces. 340 341 == Creating Linux packages ==342 343 If you want to create packages for a Linux distribution, see the current [https://build.opensuse.org/package/files?package=0ad&project=games 0ad] and [https://build.opensuse.org/package/files?package=0ad-data&project=games 0ad-data] packages on OBS for examples (especially the `.spec` and `debian.rules` files).