Changes between Version 58 and Version 59 of BuildInstructions


Ignore:
Timestamp:
Aug 6, 2009, 12:55:44 PM (15 years ago)
Author:
Erik Johansson
Comment:

spelling error corrected

Legend:

Unmodified
Added
Removed
Modified
  • BuildInstructions

    v58 v59  
    44
    55== General prerequisites ==
     6You'll need:
    67
    7 You'll need:
    88 * 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).
    99 * Up-to-date system software (Windows service packs, graphics driver updates, etc).
     
    1111
    1212== Windows ==
    13 
    1413Windows XP and Vista are the main supported versions; 2000 and 7 may work too.
    1514
    1615=== Acquiring the code ===
    17 
    1816The 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:
    1917
    2018 * Download and install [http://tortoisesvn.net/ TortoiseSVN]. (Make sure you reboot when it asks you to.)
    2119 * 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.)
    2321
    2422The [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].
     
    2624(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.)
    2725
    28 
    2926=== Setting up the build environment ===
    30 
    3127The 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:
    3228
     
    4339
    4440=== Running ===
    45 
    4641Run 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`.
    4742
     
    4944
    5045=== Keeping up to date ===
     46After you've set everything up, the process for staying up to date is:
    5147
    52 After you've set everything up, the process for staying up to date is:
    5348 * [http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-update.html Update] the root directory of the checkout.
    5449 * 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.)
     
    5651
    5752== Linux ==
    58 
    5953This is much less streamlined than the process for Windows. But you're cooler than a Windows developer, so you should be able to cope.
    6054
    6155 * Install various standard tools and development libraries:
    62   * GCC (at least 4.1, preferably 4.3)
    63   * Subversion
    64   * NASM
    65    * 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   * SDL
    67   * Boost
    68   * zlib
    69   * libpng
    70   * libxml2
    71   * OpenGL
    72   * OpenAL
    73   * libogg
    74   * libvorbis
    75   * cryptopp
    76   * !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   * enet
    81   * DevIL
    82   * 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?
    8377 * 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''
    8478
     
    8680
    8781 * `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.)
    8983 * `( cd trunk/libraries/fcollada/src && make )`
    9084 * `cd trunk/build/workspaces`
     
    9589 * `( cd ../../../binaries/system && ./pyrogenesis_dbg )`
    9690
    97 [[BR]]
     91=== OS X ===
     92Follow this steps to install under OS X:
    9893
    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.
    10095
    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.
    10897
    10998 * `sudo port install` the following packages :
    110   * boost
    111   * libsdl
    112   * spidermonkey
    113   * xercesc
    114   * wxWidgets
    115   * ffmpeg
    116   * libxml2
    117   * libdevil
    118   * libenet
     99   * boost
     100   * libsdl
     101   * spidermonkey
     102   * xercesc
     103   * wxWidgets
     104   * ffmpeg
     105   * libxml2
     106   * libdevil
     107   * libenet
    119108
    120109 * 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)
     
    123112
    124113 * 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 it
    130   * 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).
    131120
    132121 * Finally, launch the game : ` cd ../../../binaries/system && ./pyrogenesis_dbg`
    133122
    134 [[BR]]
    135 
    136123==== Compiling with gcc 4.2 or 4.3 under OS X ====
    137 
    138124For 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 :) ).
    139125
    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]]
    143127
    144128 * 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]]
    145129
    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).
    149133
    150134 * Then, launch again the compilation starting from `./update-workspace.sh`
    151135
    152 [[BR]]
    153 
    154136=== Known problems and solutions ===
    155 
    156137 * 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.
    157138
     
    169150make: *** [pyrogenesis] Error 2
    170151}}}
     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
    171153
    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.lua
    173 
    174 [[BR]]
    175154=== Installing thread-safe !SpiderMonkey ===
    176 
    177155On Linux:
    178156
     
    191169
    192170On '''Gentoo''', you could use the system library (with the `threadsafe` flag) instead:
     171
    193172 * `echo dev-lang/spidermonkey threadsafe >> /etc/portage/package.use`
    194173 * `emerge -av spidermonkey`