Changes between Version 58 and Version 59 of BuildInstructions
- Timestamp:
- Aug 6, 2009, 12:55:44 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BuildInstructions
v58 v59 4 4 5 5 == General prerequisites == 6 You'll need: 6 7 7 You'll need:8 8 * 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). 9 9 * Up-to-date system software (Windows service packs, graphics driver updates, etc). … … 11 11 12 12 == Windows == 13 14 13 Windows XP and Vista are the main supported versions; 2000 and 7 may work too. 15 14 16 15 === Acquiring the code === 17 18 16 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: 19 17 20 18 * Download and install [http://tortoisesvn.net/ TortoiseSVN]. (Make sure you reboot when it asks you to.) 21 19 * 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. Make sure it's in a path that does not contain any space characters. 22 * '''Note:''' The SVN server is currently very busy, and is likely to return "503 Service Unavailable" errors. You might want to wait a few days before downloading all the code. (Linux users should see below for a quicker way to download the code.)20 * '''Note:''' The SVN server is currently very busy, and is likely to return "503 Service Unavailable" errors. You might want to wait a few days before downloading all the code. (Linux users should see below for a quicker way to download the code.) 23 21 24 22 The [http://tortoisesvn.net/docs/release/TortoiseSVN_en/index.html TortoiseSVN manual] has information on [http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-checkout.html checking out], as well as [http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-update.html updating] and [http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-patch.html creating patches]. … … 26 24 (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.) 27 25 28 29 26 === Setting up the build environment === 30 31 27 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: 32 28 … … 43 39 44 40 === Running === 45 46 41 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`. 47 42 … … 49 44 50 45 === Keeping up to date === 46 After you've set everything up, the process for staying up to date is: 51 47 52 After you've set everything up, the process for staying up to date is:53 48 * [http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-update.html Update] the root directory of the checkout. 54 49 * 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.) … … 56 51 57 52 == Linux == 58 59 53 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. 60 54 61 55 * Install various standard tools and development libraries: 62 * GCC (at least 4.1, preferably 4.3)63 * Subversion64 * NASM65 * There is a [http://sourceforge.net/tracker/?func=detail&aid=2821249&group_id=6208&atid=106208 bug] in NASM 2.06 on x86_64, so you might want to try a different version if you get errors.66 * SDL67 * Boost68 * zlib69 * libpng70 * libxml271 * OpenGL72 * OpenAL73 * libogg74 * libvorbis75 * cryptopp76 * !SpiderMonkey (1.6, threadsafe) (sometimes called libjs)77 * wxWidgets (probably called wxgtk on Linux) (optional, but required for the editor tools)78 * gamin (Linux only)79 * BFD (typically called something like binutils-dev) (Linux only)80 * enet81 * DevIL82 * and maybe some other things?56 * GCC (at least 4.1, preferably 4.3) 57 * Subversion 58 * NASM 59 * There is a [http://sourceforge.net/tracker/?func=detail&aid=2821249&group_id=6208&atid=106208 bug] in NASM 2.06 on x86_64, so you might want to try a different version if you get errors. 60 * SDL 61 * Boost 62 * zlib 63 * libpng 64 * libxml2 65 * OpenGL 66 * OpenAL 67 * libogg 68 * libvorbis 69 * cryptopp 70 * !SpiderMonkey (1.6, threadsafe) (sometimes called libjs) 71 * wxWidgets (probably called wxgtk on Linux) (optional, but required for the editor tools) 72 * gamin (Linux only) 73 * BFD (typically called something like binutils-dev) (Linux only) 74 * enet 75 * DevIL 76 * and maybe some other things? 83 77 * For '''Ubuntu''' the following might help: ''sudo apt-get install build-essential 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 libcrypto++-dev binutils-dev libnspr4-dev libdevil-dev libenet-dev libxml2-dev'' 84 78 … … 86 80 87 81 * `svn co http://svn.wildfiregames.com/public/ps/trunk/` (or `http://svn.wildfiregames.com/svn/ps/trunk/` if you have commit access) 88 * '''Note:''' The SVN server is currently very busy, and is likely to return "503 Service Unavailable" errors. You might want to wait a few days before downloading all the code. Alternatively, download and extract http://os.wildfiregames.com/ps-snapshot-r6953.tar.gz (300MB) or http://os.wildfiregames.com/ps-snapshot-r6953.tar.7z (140MB, 7-Zip) then run `svn up`. (The snapshot requires Subversion 1.5 or higher. It will break badly if you try it on Windows.)82 * '''Note:''' The SVN server is currently very busy, and is likely to return "503 Service Unavailable" errors. You might want to wait a few days before downloading all the code. Alternatively, download and extract http://os.wildfiregames.com/ps-snapshot-r6953.tar.gz (300MB) or http://os.wildfiregames.com/ps-snapshot-r6953.tar.7z (140MB, 7-Zip) then run `svn up`. (The snapshot requires Subversion 1.5 or higher. It will break badly if you try it on Windows.) 89 83 * `( cd trunk/libraries/fcollada/src && make )` 90 84 * `cd trunk/build/workspaces` … … 95 89 * `( cd ../../../binaries/system && ./pyrogenesis_dbg )` 96 90 97 [[BR]] 91 === OS X === 92 Follow this steps to install under OS X: 98 93 99 === OS X === 94 * Install Apple's XCode for your system : see your Mac OsX install DVD or go to [http://connect.apple.com Apple's Developer Connection Site][[BR]] This provides the necessary tools to compile programs.[[BR]] Note that for Leopard, '''it is mandatory to''' install XCode >= 3.1, as the tiff dependency won't compile either. On my DVD, Apple shipped only XCode 3.0, so I had to download 3.1 from the ADC site. 100 95 101 Follow this steps to install under OS X: 102 * Install Apple's XCode for your system : see your Mac OsX install DVD or go to [http://connect.apple.com Apple's Developer Connection Site][[BR]] 103 This provides the necessary tools to compile programs.[[BR]] 104 Note that for Leopard, '''it is mandatory to''' install XCode >= 3.1, as the tiff dependency won't compile either. On my DVD, Apple shipped only XCode 3.0, so I had to download 3.1 from the ADC site. 105 106 * Install Macports : [http://www.macports.org/install.php MacPorts][[BR]] 107 This is the easiest way to install all the dependencies needed by 0ad. 96 * Install Macports : [http://www.macports.org/install.php MacPorts][[BR]] This is the easiest way to install all the dependencies needed by 0ad. 108 97 109 98 * `sudo port install` the following packages : 110 * boost111 * libsdl112 * spidermonkey113 * xercesc114 * wxWidgets115 * ffmpeg116 * libxml2117 * libdevil118 * libenet99 * boost 100 * libsdl 101 * spidermonkey 102 * xercesc 103 * wxWidgets 104 * ffmpeg 105 * libxml2 106 * libdevil 107 * libenet 119 108 120 109 * Now get the last revision of the game : `svn co http://svn.wildfiregames.com/public/ps/trunk/` (or `http://svn.wildfiregames.com/svn/ps/trunk/` if you have commit access) … … 123 112 124 113 * then compile the game : 125 * `cd trunk/build/workspaces`126 * `./update-workspaces.sh` (you'll have to repeat this step each time a source file is added or removed)127 * `cd gcc`128 * `make -j3` (where `3` is the number of parallel builds to run, and could perhaps be one plus the number of CPU cores available)129 * ''' If you cannot manage to compile with the Apple's default compiler (gcc 4.0.1), you may try compiling with gcc 4.2 (recommanded) or 4.3 ''' (this worked for me a least) : see the [http://trac.wildfiregames.com/wiki/BuildInstructions#Compilingwithgcc4.2or4.3underOSX detailed section here under]. Note that gcc 4.1 failed to compile FCollada for me, so I don't recommand it130 * If you encounter any build errors, look for an existing bug report or report a new bug (I myself still get a last error, but it seems harmless).114 * `cd trunk/build/workspaces` 115 * `./update-workspaces.sh` (you'll have to repeat this step each time a source file is added or removed) 116 * `cd gcc` 117 * `make -j3` (where `3` is the number of parallel builds to run, and could perhaps be one plus the number of CPU cores available) 118 * ''' If you cannot manage to compile with the Apple's default compiler (gcc 4.0.1), you may try compiling with gcc 4.2 (recommended) or 4.3 ''' (this worked for me a least) : see the [http://trac.wildfiregames.com/wiki/BuildInstructions#Compilingwithgcc4.2or4.3underOSX detailed section here under]. Note that gcc 4.1 failed to compile FCollada for me, so I don't recommand it 119 * If you encounter any build errors, look for an existing bug report or report a new bug (I myself still get a last error, but it seems harmless). 131 120 132 121 * Finally, launch the game : ` cd ../../../binaries/system && ./pyrogenesis_dbg` 133 122 134 [[BR]]135 136 123 ==== Compiling with gcc 4.2 or 4.3 under OS X ==== 137 138 124 For those who get weird errors, you can try compiling with gcc 4.2 or 4.3, which are not shipped with any version of Apple's XCode. So you first have to get them from !MacPorts and then patch some system libraries (certainly not the better way to do it, but for now the game is targetted for developpers, so you can manage to do it :) ). 139 125 140 * `sudo port install gcc42 gcc43 gcc_select`[[BR]] 141 Select gcc 4.2 or 4.3 : 142 `sudo gcc_select mp-gcc42` or `sudo gcc_select mp-gcc43`[[BR]] 126 * `sudo port install gcc42 gcc43 gcc_select`[[BR]] Select gcc 4.2 or 4.3 : `sudo gcc_select mp-gcc42` or `sudo gcc_select mp-gcc43`[[BR]] 143 127 144 128 * 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, make, and sudo make install.[[BR]] 145 129 146 * Right, you're almost ready to compile 0ad : 147 * you need to patch Apple's OpenAL (/System/Library/Frameworks/OpenAL.Framework/alc.h : replace all ALCvoid by void, except first one which is a typedef). Indeed, as Jan said, "C allows parameters typedefed to void, C++ does not; GCC >=4.2 are now strict about the error" (and will end to compilation error).148 * you'll then need to patch Macports IL (/opt/local/include/IL/il.h and ilu.h : replace all ILvoid by void, except typedefs).130 * Right, you're almost ready to compile 0ad : 131 * you need to patch Apple's OpenAL (/System/Library/Frameworks/OpenAL.Framework/alc.h : replace all ALCvoid by void, except first one which is a typedef). Indeed, as Jan said, "C allows parameters typedefed to void, C++ does not; GCC >=4.2 are now strict about the error" (and will end to compilation error). 132 * you'll then need to patch Macports IL (/opt/local/include/IL/il.h and ilu.h : replace all ILvoid by void, except typedefs). 149 133 150 134 * Then, launch again the compilation starting from `./update-workspace.sh` 151 135 152 [[BR]]153 154 136 === Known problems and solutions === 155 156 137 * 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. 157 138 … … 169 150 make: *** [pyrogenesis] Error 2 170 151 }}} 152 Actually, older versions of glibc doesn't support the stack-protection feature. So, until this is detected by the build system, you can hack it by removing the "-fstack-protector-all" line and the next line too from build/premake/premake.lua 171 153 172 Actually, older versions of glibc doesn't support the stack-protection feature. So, until this is detected by the build system, you can hack it by removing the "-fstack-protector-all" line and the next line too from build/premake/premake.lua173 174 [[BR]]175 154 === Installing thread-safe !SpiderMonkey === 176 177 155 On Linux: 178 156 … … 191 169 192 170 On '''Gentoo''', you could use the system library (with the `threadsafe` flag) instead: 171 193 172 * `echo dev-lang/spidermonkey threadsafe >> /etc/portage/package.use` 194 173 * `emerge -av spidermonkey`