Changes between Version 278 and Version 279 of BuildInstructions


Ignore:
Timestamp:
Nov 12, 2015, 1:28:27 AM (8 years ago)
Author:
scythetwirler
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BuildInstructions

    v278 v279  
    44
    55The 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].
    6 
    7 [[br]]
    8 
    96
    107== General prerequisites ==
     
    2421 * 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.
    2522
    26 [[br]]
    27 
    2823== Windows ==
    29 
    3024The main supported versions are:
     25
    3126 * Windows 10
    3227 * Windows 8.1
     
    3429 * Windows 7
    3530
    36 The only supported IDEs are:
     31If you want to develop, the only supported IDEs are:
     32
    3733 * Visual C++ 2013
    3834
    3935'''Important notes:'''
     36
    4037 * We have dropped support for older versions of Visual Studio when moving to C++11, see #2669.
    4138 * XP and Vista are supported as targets, but not for installing Visual Studio 2013.
     
    5249(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.)
    5350
     51If you only wish to play the most cutting-edge version, this is all you have to do (other than [#Keepinguptodate Keeping up to date]). The executable will be located at `binaries/system/pyrogenesis.exe`.
     52
    5453=== Setting up the build environment ===
    5554The game must be compiled with Microsoft Visual C++. You can get the free Express edition here: [http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx Visual Studio Express 2013]. Choose the version for "Windows Desktop". There is also the free [http://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx Community Edition], which has all the features of the Professional version for open source development.
     
    7978 * 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.)
    8079 * Build again.
    81 
    82 [[br]]
    8380
    8481== Linux ==
     
    110107
    111108To compile editing tools (enabled by default; pass the flag `--disable-atlas` to `update-workspaces.sh` to disable):
     109
    112110 * wxWidgets (packages are probably called wxgtk)
     111
    113112To use shared system libraries instead of bundled copies (default) of libraries (pass the flag `--with-system-$COMPONENT` to `update-workspaces.sh` to use the non-bundled copy):
     113
    114114 * [https://developer.mozilla.org/docs/SpiderMonkey/31 SpiderMonkey 31] (`--with-system-mozjs31`)
    115115 * [http://code.google.com/p/nvidia-texture-tools NVTT] (`--with-system-nvtt`)
    116 For a list of all options to `update-workspaces.sh` see [wiki:premake premake].
     116
     117For a list of all options to `update-workspaces.sh` see [wiki:premake].
    117118
    118119==== Debian / Ubuntu ====
     
    126127    libxml2-dev subversion zlib1g-dev
    127128}}}
    128   * With these dependencies you have to run:
    129    * `./update-workspaces.sh --with-system-nvtt`
     129   * With these dependencies you have to run:
     130     * `./update-workspaces.sh --with-system-nvtt`
    130131 * If you want to use a packaged **mozjs31**, available for example in [https://launchpad.net/~wfg/+archive/ubuntu/0ad.dev/+packages 0ad.dev PPA]:
    131132   * you should replace `libnspr4-dev` with `libmozjs-31-dev` and run `update-workspace.sh` with `--with-system-mozjs31`.
    132133 * On systems **earlier than Debian 8/jessie and Ubuntu 14.04/trusty**:
    133   * you should run `update-workspace.sh` with `--without-miniupnpc` if you don't have `libminiupnpc-dev` >= 1.6;
    134   * you should replace `libwxgtk3.0-dev` with `libwxgtk2.8-dev`;
     134   * you should run `update-workspace.sh` with `--without-miniupnpc` if you don't have `libminiupnpc-dev` >= 1.6;
     135   * you should replace `libwxgtk3.0-dev` with `libwxgtk2.8-dev`;
    135136 * When not using system nvidia-texture-tools, `libnvtt-dev` can be omitted, but `cmake` is needed to build the bundled NVTT.
    136137 * You can also use `libcurl4-openssl-dev` instead of `libcurl4-gnutls-dev` (it's not possible to install both at once), but [http://lintian.debian.org/tags/possible-gpl-code-linked-with-openssl.html note that openssl is not GPL compatible and the resulting binaries could not be redistributed].
     
    145146    libxml2-devel libwxgtku2.8-devel openal-soft-devel libicu-devel
    146147}}}
    147 
    148148==== Fedora ====
    149149Install the dependencies with:
     
    156156    gloox-devel libicu-devel miniupnpc-devel'
    157157}}}
    158 
    159158==== openSUSE ====
    160159Install the dependencies with:
     
    167166    gloox-devel libicu-devel miniupnpc-devel
    168167}}}
    169 
    170168Users of openSUSE 11.4 and later should install the wxWidgets-devel package instead of wxGTK-devel.
    171169
     
    176174
    177175}}}
    178 
    179 
    180176=== Getting the code ===
    1811770 A.D. is primarily developed on SVN. To checkout the latest code from SVN, run this command:
     
    185181svn co http://svn.wildfiregames.com/public/ps/trunk/ 0ad
    186182}}}
    187 
    188183'''Note:''' Sometimes SVN stops before it has downloaded all files. You should check that it outputs something like `at revision rXXXX`. Otherwise run
    189184
     
    192187svn up 0ad
    193188}}}
    194 
    195189'''Note:''' Make sure that the checkout directory doesn't contain special characters (spaces or non-ASCII characters)
    196190
     
    202196}}}
    203197or
     198
    204199{{{
    205200#!sh
    206201git clone https://gitlab.com/0ad/0ad.git
    207202}}}
    208 
    209203=== Building ===
    210204Compile the code with:
     
    217211make -j3
    218212}}}
    219 
    220213 * '''-j3''' gives the number of parallel builds to run, and should typically be one plus the number of CPU cores available.
    221214 * The '''Release''' mode builds (which are the default) are more optimised, but are harder to debug. Use `make config=debug` (and run `pyrogenesis_dbg`) if you need better debugging support. See [wiki:Debugging] for more details.
     
    230223binaries/system/test
    231224}}}
    232 
    233225=== Running ===
    234226If everything went well, compiling the code worked and all tests passed, it's finally time to run the game:
     
    238230binaries/system/pyrogenesis
    239231}}}
    240 
    241232=== Keeping up to date ===
    242233If you want to rebuild quickly after updating from SVN, you can usually get away with:
     
    250241make -j3
    251242}}}
    252 
    253243If 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.
    254244
     
    256246If you want to create packages for a Linux distribution see the current [http://anonscm.debian.org/viewvc/pkg-games/packages/trunk/0ad/debian/ 0ad] and [http://anonscm.debian.org/viewvc/pkg-games/packages/trunk/0ad-data/debian/ 0ad-data] packages on OBS for examples (especially the `control` and `rules` files).
    257247
    258 [[BR]]
    259 
    260248== OS X ==
    261249The process on OS X is similar to Linux:
    262250
    263251 * Obtain the command line tools:
    264   * 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].
    265   * If you're using Lion 10.7.2 or earlier, you'll probably need to install Xcode to get the command line tools:
    266     * If available, use your Mac OS X install DVD which saves downloading 1.72+ GB.
    267     * 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.
    268     * The latest version of Xcode is also available for free from the [http://www.apple.com/mac/app-store/ Mac 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.''
    269   * If you want to build a distributable app bundle as described below, you will need Xcode.
    270   * '''Note:''' As of Mavericks (10.9) and Xcode 5, Apple [https://developer.apple.com/library/mac/releasenotes/DeveloperTools/RN-Xcode/xc5_release_notes/xc5_release_notes.html#//apple_ref/doc/uid/TP40001051-CH2-SW302 no longer supports] llvm-gcc, instead it is required to use clang. Additionally, the default C++ library is now libc++ instead of libstdc++. If you've upgraded and previously built the game, you should pass the `--force-rebuild` flag to `build-osx-libs.sh`.
     252   * 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].
     253   * If you're using Lion 10.7.2 or earlier, you'll probably need to install Xcode to get the command line tools:
     254     * If available, use your Mac OS X install DVD which saves downloading 1.72+ GB.
     255     * 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.
     256     * The latest version of Xcode is also available for free from the [http://www.apple.com/mac/app-store/ Mac 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.''
     257   * If you want to build a distributable app bundle as described below, you will need Xcode.
     258   * '''Note:''' As of Mavericks (10.9) and Xcode 5, Apple [https://developer.apple.com/library/mac/releasenotes/DeveloperTools/RN-Xcode/xc5_release_notes/xc5_release_notes.html#//apple_ref/doc/uid/TP40001051-CH2-SW302 no longer supports] llvm-gcc, instead it is required to use clang. Additionally, the default C++ library is now libc++ instead of libstdc++. If you've upgraded and previously built the game, you should pass the `--force-rebuild` flag to `build-osx-libs.sh`.
    271259 * As of Alpha 18, the game uses SpiderMonkey 31 which requires a Python 2.7 version later than 2.7.3. If you're on Mountain Lion (10.8) or earlier, you will need to first update your Python installation with the latest 2.7.x installer from [https://www.python.org/downloads/release/python-279/ here].
    272260 * Obtain CMake:
    273   * You can download a prebuilt OS X package [http://www.cmake.org/cmake/resources/software.html here].
    274   * If prompted, install the CMake command line tools to the default location.
    275   * '''Note:''' Recent versions have no installer, so after copying the app bundle to '''Applications''', you need to run CMake with elevated permissions to install the command line tools. From the terminal:
    276     {{{
     261   * You can download a prebuilt OS X package [http://www.cmake.org/cmake/resources/software.html here].
     262   * If prompted, install the CMake command line tools to the default location.
     263   * '''Note:''' Recent versions have no installer, so after copying the app bundle to '''Applications''', you need to run CMake with elevated permissions to install the command line tools. From the terminal:
     264{{{
    277265#!sh
    278266 sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install
    279     }}}
    280   * If the install command fails, you can manually add the following line to the end of `/etc/paths`:
    281     {{{
     267}}}
     268   * If the install command fails, you can manually add the following line to the end of `/etc/paths`:
     269{{{
    282270/Applications/CMake.app/Contents/bin
    283     }}}
     271}}}
    284272 * Obtain the game's source code:
    285   * 0 A.D. is primarily developed on SVN. To checkout the latest code from SVN, run this command:
    286    {{{
     273   * 0 A.D. is primarily developed on SVN. To checkout the latest code from SVN, run this command:
     274{{{
    287275#!sh
    288276svn co http://svn.wildfiregames.com/public/ps/trunk/ 0ad
    289    }}}
    290    '''Note:''' Sometimes SVN stops before it has downloaded all files. You should check that it outputs something like `at revision rXXXX`. Otherwise run
    291    {{{
     277}}}
     278     '''Note:''' Sometimes SVN stops before it has downloaded all files. You should check that it outputs something like `at revision rXXXX`. Otherwise run
     279{{{
    292280#!sh
    293281svn up 0ad
    294    }}}
    295   * There is also a Git mirror, which may be slightly less up-to-date but usually offers faster downloads. To use the Git mirror, use this command instead:
    296    {{{
     282}}}
     283   * There is also a Git mirror, which may be slightly less up-to-date but usually offers faster downloads. To use the Git mirror, use this command instead:
     284{{{
    297285#!sh
    298286git clone https://github.com/0ad/0ad.git
    299    }}}
     287}}}
    300288
    301289Now you have two options:
    302290
    303291=== 1. Build the game for your personal use ===
    304 
    305292 * Run [source:/ps/trunk/libraries/osx/build-osx-libs.sh libraries/osx/build-osx-libs.sh], the OS X libraries build script, this will download and build the game's dependencies (except CMake, see above). This script will take some time to finish when first run, after that it will reuse the old build.
    306  {{{
     293{{{
    307294#!sh
    308295cd libraries/osx
    309296./build-osx-libs.sh -j3
    310  }}}
    311   * '''-j3''' gives the number of parallel builds to run, and should typically be one plus the number of CPU cores available.
    312   * To force a rebuild for some reason, e.g. the SVN folder is moved or Xcode / OS X is upgraded, pass in the `--force-rebuild` flag.
     297}}}
     298   * '''-j3''' gives the number of parallel builds to run, and should typically be one plus the number of CPU cores available.
     299   * To force a rebuild for some reason, e.g. the SVN folder is moved or Xcode / OS X is upgraded, pass in the `--force-rebuild` flag.
    313300 * Next, to build the game on the command line, use the following commands:
    314    {{{
     301{{{
    315302#!sh
    316303cd 0ad/build/workspaces
     
    318305cd gcc
    319306make -j3
    320    }}}
    321   * The '''Release''' mode builds (which are the default) are more optimised, but are harder to debug. Use `make config=debug` (and run `pyrogenesis_dbg`) if you need better debugging support. See [wiki:Debugging] for more details.
    322   * If you encounter any build errors, review the [http://trac.wildfiregames.com/report existing bug reports], check the [#Knownproblemsandsolutions known problems section] or please file a [http://trac.wildfiregames.com/newticket new bug in the tracker].
     307}}}
     308   * The '''Release''' mode builds (which are the default) are more optimised, but are harder to debug. Use `make config=debug` (and run `pyrogenesis_dbg`) if you need better debugging support. See [wiki:Debugging] for more details.
     309   * If you encounter any build errors, review the [http://trac.wildfiregames.com/report existing bug reports], check the [#Knownproblemsandsolutions known problems section] or please file a [http://trac.wildfiregames.com/newticket new bug in the tracker].
    323310 * Or if you have Xcode 4 installed, you can open `build/workspaces/xcode4/pyrogenesis.xcworkspace` (see discussion on this [http://www.wildfiregames.com/forum/index.php?showtopic=15511&st=160#entry261743 here]).
    324311 * Run the automated tests to verify that everything works as expected like this:
     
    336323
    337324=== 2. Build the game as a distributable app bundle ===
    338 
    339325 * You will need Xcode installed (for its SDKs)
    340326 * Open [source:/ps/trunk/build/workspaces/build-osx-bundle.sh build/workspaces/build-osx-bundle.sh] and read the comments. You will need to change a few settings depending on your version of OS X, Xcode, etc.
    341327 * Run `build-osx-bundle.sh`, the bundle build script, which will download and build the game's dependencies for the appropriate SDK, build the game's source code, package the mod data, and set up the app bundle info.
    342  {{{
     328{{{
    343329#!sh
    344330cd build/workspaces
    345331./build-osx-bundle.sh -j3
    346  }}}
     332}}}
    347333 * '''-j3''' gives the number of parallel builds to run, and should typically be one plus the number of CPU cores available.
    348334 * When it's finished, there should be a complete '''0ad app''' bundle in `build/workspaces`. You can open it by double-clicking its icon in Finder or with the `open 0ad.app` command in the terminal.
     
    351337   * Package the bundle inside a compressed DMG with background image, for easy distribution (see ReleaseProcess).
    352338
    353 [[BR]]
    354 
    355339== BSD ==
    356340'''Note: The *BSD support is a work in progress and should be considered experimental. That means don't try it unless you "know what you're doing" :)'''
    357341
    358  * Install the following ports or packages (names probably differ depending on the BSD variant):[[BR]]
    359    Install commands for the variants are provided below.
     342 * Install the following ports or packages (names probably differ depending on the BSD variant):[[BR]] Install commands for the variants are provided below.
    360343   * boost-libs
    361344   * cmake
     
    425408 * You probably need to run pyrogenesis with `LD_PRELOAD=/usr/local/lib/libogg.so.6.2:/usr/local/lib/libvorbis.so.8.0` (see #1463).
    426409
    427 [[BR]]
    428 
    429410== Known problems and solutions ==
    430411 * None currently.