Changes between Version 81 and Version 82 of BuildInstructions


Ignore:
Timestamp:
Mar 28, 2010, 10:48:49 PM (14 years ago)
Author:
Philip Taylor
Comment:

clean up instructions a bit

Legend:

Unmodified
Added
Removed
Modified
  • BuildInstructions

    v81 v82  
    1111
    1212== Windows ==
    13 Windows XP and Vista are the main supported versions; 2000 and 7 may work too.
     13Windows 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).
    1414
    1515=== Acquiring the code ===
     
    1717
    1818 * Download and install [http://tortoisesvn.net/ TortoiseSVN]. (Make sure you reboot when it asks you to.)
    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.
     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 (#482).
    2020
    2121The [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].
     
    4040Run 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`.
    4141
    42 To run the (currently quite minimal) 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.
     42To 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.
    4343
    4444=== Keeping up to date ===
     
    4949 * Build again.
    5050
    51 == Linux ==
    52 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.
     51== Unix ==
     52This is much less streamlined than the process for Windows. But you're cooler than a Windows developer, so you should be able to cope:
     53
     54=== Linux ===
    5355
    5456 * Install various standard tools and development libraries:
     
    6870   * cryptopp
    6971   * wxWidgets (probably called wxgtk on Linux) (optional, but required for the editor tools)
    70    * gamin (Linux only)
     72   * Gamin (FAM should work too) (Linux only)
    7173   * BFD (typically called something like binutils-dev) (Linux only)
    72    * enet
     74   * ENet
    7375   * DevIL
    7476
    75  * For '''Mandriva''', only tested with 2009.1, the following are all the packages requiered to compile '''0 A.D.''' (run in a terminal as root): ''urpmi libboost-devel libcryptopp-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 svn'' . '''Enet''' package isn't available for '''Mandriva''', so please refer to the following page for installing instructions of Enet: http://enet.bespin.org/Installation.html .
    76 
    7777 * 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 libdevil-dev libenet-dev libxml2-dev''
    7878
    79  * For '''Fedora''' (12):
    80 {{{
    81 yum -y install subversion gcc-c++ nasm SDL-devel boost-devel zlib-devel libpng-devel libjpeg-devel libxml2-devel \
    82 openal-devel libogg-devel libvorbis-devel cryptopp-devel wxGTK-devel gamin-devel binutils-devel enet-devel \
    83 DevIL-devel
    84 }}}
    85 
    86  * `svn co http://svn.wildfiregames.com/public/ps/trunk/` (or `http://svn.wildfiregames.com/svn/ps/trunk/` if you have commit access)
     79 * For '''Mandriva''' (tested with 2009.1): ''urpmi libboost-devel libcryptopp-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 svn''. No ENet package is available, so [http://enet.bespin.org/Installation.html install it from source].
     80
     81 * For '''Fedora''' (tested with 12): ''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 cryptopp-devel wxGTK-devel gamin-devel binutils-devel enet-devel DevIL-devel''
     82
     83 * `svn co http://svn.wildfiregames.com/public/ps/trunk/`
    8784 * `cd trunk/build/workspaces`
    88  * `./update-workspaces.sh` (you'll have to repeat this step each time a source file is added or removed)
     85 * `./update-workspaces.sh` (if you update to a later version of the code from SVN, you should run this again each time)
    8986 * `cd gcc`
    9087 * `make -j3` (where `3` is the number of parallel builds to run, and could perhaps be one plus the number of CPU cores available)
    91    * '''Note''': Parallel building can create errors due to race conditions. Run a "make clean" and try just "make" if you encounter problems.
    92  * If you encounter any build errors, look for an existing bug report or report a new bug.
    93  * `( cd ../../../binaries/system && ./pyrogenesis_dbg )`
     88   * '''Note''': Parallel building can cause errors due to race conditions. Run a "make clean" and try just "make" if you encounter problems.
     89 * If you encounter any build errors, look for an existing bug report or report a new bug. Also check the [#Knownproblemsandsolutions known problems section] below.
     90 * `cd ../../../binaries/system`
     91 * Optionally, run the automated tests to verify that everything works as expected: `./test_dbg`
     92 * Run the game: `./pyrogenesis_dbg`
     93 * Optionally, run the map editor: `./pyrogenesis_dbg -editor`
     94
     95By default, the game is compiled in an unoptimised debug configuration, so that errors are easier to detect and understand and fix. To compile an optimised version, build with `CONFIG=Release make` and then run the game as `./pyrogenesis`
    9496
    9597=== OS X ===
    96 Follow this steps to install under OS X:
    97 
    98  * 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.
    99 
    100  * Install Macports : [http://www.macports.org/install.php MacPorts][[BR]] This is the easiest way to install all the dependencies needed by 0ad.
     98The process on OS X is similar to Linux:
     99
     100 * Install Apple's XCode for your system: see your Mac OS X install DVD or go to [http://connect.apple.com 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.
     101
     102 * Install [http://www.macports.org/install.php MacPorts]. This is the easiest way to install all the dependencies needed by the game.
    101103
    102104 * `sudo port install` the following packages :
     
    105107   * xercesc
    106108   * wxWidgets
    107    * ffmpeg
    108109   * libxml2
    109110   * libdevil
    110111   * libenet
    111112
    112  * 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)
    113 
    114  * then compile the game :
    115    * `cd trunk/build/workspaces`
    116    * `./update-workspaces.sh` (you'll have to repeat this step each time a source file is added or removed)
    117    * `cd gcc`
    118    * `make -j3` (where `3` is the number of parallel builds to run, and could perhaps be one plus the number of CPU cores available)
    119      * Note: Parallel building can create errors due to race conditions. Run a "make clean" and try just "make" if you encounter problems.
    120 
    121    * ''' 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 recommend it
    122 
    123    * 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).
    124 
    125  * Finally, launch the game : ` cd ../../../binaries/system && ./pyrogenesis_dbg`
    126 
    127 ==== Compiling with gcc 4.2 or 4.3 under OS X ====
    128 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 :) ).
    129 
    130  * `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]]
    131 
    132  * 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, make, and sudo make install.[[BR]]
    133 
    134  * Right, you're almost ready to compile 0ad :
    135    * 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).
    136 
    137  * 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 [http://trac.wildfiregames.com/wiki/BuildInstructions#Knownproblemsandsolutions known problems section].
    138 
    139  * Then, launch again the compilation starting from `./update-workspace.sh`
     113 * Now follow the same instructions as for Linux above, starting from the `svn co`.
     114
     115==== Compiling with GCC 4.2 or 4.3 under OS X ====
     116If 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:
     117
     118 * `sudo port install gcc42 gcc43 gcc_select`
     119
     120 * Select GCC 4.2 or 4.3: `sudo gcc_select mp-gcc42` or `sudo gcc_select mp-gcc43`
     121
     122 * 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`
     123
     124 * 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++.)
     125
     126 * 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 [#Knownproblemsandsolutions known problems section].
     127
     128 * Then, restart the compilation starting from `./update-workspace.sh`
    140129
    141130=== Known problems and solutions ===
    142131 * 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.
    143132
    144  * If you get '''`/usr/bin/ld: Undefined symbols`''' (see code snippet here under), this comes from your glibc that is older than 2.4 :
    145 
    146 {{{
    147 /usr/bin/ld: warning -L: directory name (../../../libraries/comsuppw/lib) does not exist
    148 /usr/bin/ld: Undefined symbols:
    149 ___stack_chk_fail
    150 ___stack_chk_guard
    151 collect2: ld returned 1 exit status
    152 make[1]: *** [../../../binaries/system/pyrogenesis_dbg.app/Contents/MacOS/pyrogenesis_dbg] Error 1
    153 make: *** [pyrogenesis] Error 2
    154 }}}
    155   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 if needed) from build/premake/premake.lua
     133 * 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`
    156134
    157135 * If you get
     
    167145#endif
    168146}}}
    169 
    170147
    171148