Changes between Version 278 and Version 279 of BuildInstructions
- Timestamp:
- Nov 12, 2015, 1:28:27 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BuildInstructions
v278 v279 4 4 5 5 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]. 6 7 [[br]]8 9 6 10 7 == General prerequisites == … … 24 21 * 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. 25 22 26 [[br]]27 28 23 == Windows == 29 30 24 The main supported versions are: 25 31 26 * Windows 10 32 27 * Windows 8.1 … … 34 29 * Windows 7 35 30 36 The only supported IDEs are: 31 If you want to develop, the only supported IDEs are: 32 37 33 * Visual C++ 2013 38 34 39 35 '''Important notes:''' 36 40 37 * We have dropped support for older versions of Visual Studio when moving to C++11, see #2669. 41 38 * XP and Vista are supported as targets, but not for installing Visual Studio 2013. … … 52 49 (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.) 53 50 51 If 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 54 53 === Setting up the build environment === 55 54 The 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. … … 79 78 * 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.) 80 79 * Build again. 81 82 [[br]]83 80 84 81 == Linux == … … 110 107 111 108 To compile editing tools (enabled by default; pass the flag `--disable-atlas` to `update-workspaces.sh` to disable): 109 112 110 * wxWidgets (packages are probably called wxgtk) 111 113 112 To 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 114 114 * [https://developer.mozilla.org/docs/SpiderMonkey/31 SpiderMonkey 31] (`--with-system-mozjs31`) 115 115 * [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 117 For a list of all options to `update-workspaces.sh` see [wiki:premake]. 117 118 118 119 ==== Debian / Ubuntu ==== … … 126 127 libxml2-dev subversion zlib1g-dev 127 128 }}} 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` 130 131 * If you want to use a packaged **mozjs31**, available for example in [https://launchpad.net/~wfg/+archive/ubuntu/0ad.dev/+packages 0ad.dev PPA]: 131 132 * you should replace `libnspr4-dev` with `libmozjs-31-dev` and run `update-workspace.sh` with `--with-system-mozjs31`. 132 133 * 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`; 135 136 * When not using system nvidia-texture-tools, `libnvtt-dev` can be omitted, but `cmake` is needed to build the bundled NVTT. 136 137 * 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]. … … 145 146 libxml2-devel libwxgtku2.8-devel openal-soft-devel libicu-devel 146 147 }}} 147 148 148 ==== Fedora ==== 149 149 Install the dependencies with: … … 156 156 gloox-devel libicu-devel miniupnpc-devel' 157 157 }}} 158 159 158 ==== openSUSE ==== 160 159 Install the dependencies with: … … 167 166 gloox-devel libicu-devel miniupnpc-devel 168 167 }}} 169 170 168 Users of openSUSE 11.4 and later should install the wxWidgets-devel package instead of wxGTK-devel. 171 169 … … 176 174 177 175 }}} 178 179 180 176 === Getting the code === 181 177 0 A.D. is primarily developed on SVN. To checkout the latest code from SVN, run this command: … … 185 181 svn co http://svn.wildfiregames.com/public/ps/trunk/ 0ad 186 182 }}} 187 188 183 '''Note:''' Sometimes SVN stops before it has downloaded all files. You should check that it outputs something like `at revision rXXXX`. Otherwise run 189 184 … … 192 187 svn up 0ad 193 188 }}} 194 195 189 '''Note:''' Make sure that the checkout directory doesn't contain special characters (spaces or non-ASCII characters) 196 190 … … 202 196 }}} 203 197 or 198 204 199 {{{ 205 200 #!sh 206 201 git clone https://gitlab.com/0ad/0ad.git 207 202 }}} 208 209 203 === Building === 210 204 Compile the code with: … … 217 211 make -j3 218 212 }}} 219 220 213 * '''-j3''' gives the number of parallel builds to run, and should typically be one plus the number of CPU cores available. 221 214 * 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. … … 230 223 binaries/system/test 231 224 }}} 232 233 225 === Running === 234 226 If everything went well, compiling the code worked and all tests passed, it's finally time to run the game: … … 238 230 binaries/system/pyrogenesis 239 231 }}} 240 241 232 === Keeping up to date === 242 233 If you want to rebuild quickly after updating from SVN, you can usually get away with: … … 250 241 make -j3 251 242 }}} 252 253 243 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. 254 244 … … 256 246 If 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). 257 247 258 [[BR]]259 260 248 == OS X == 261 249 The process on OS X is similar to Linux: 262 250 263 251 * 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`. 271 259 * 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]. 272 260 * 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 {{{ 277 265 #!sh 278 266 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 {{{ 282 270 /Applications/CMake.app/Contents/bin 283 271 }}} 284 272 * 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 {{{ 287 275 #!sh 288 276 svn 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 run291 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 {{{ 292 280 #!sh 293 281 svn 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 {{{ 297 285 #!sh 298 286 git clone https://github.com/0ad/0ad.git 299 287 }}} 300 288 301 289 Now you have two options: 302 290 303 291 === 1. Build the game for your personal use === 304 305 292 * 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 {{{ 307 294 #!sh 308 295 cd libraries/osx 309 296 ./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. 313 300 * Next, to build the game on the command line, use the following commands: 314 301 {{{ 315 302 #!sh 316 303 cd 0ad/build/workspaces … … 318 305 cd gcc 319 306 make -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]. 323 310 * 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]). 324 311 * Run the automated tests to verify that everything works as expected like this: … … 336 323 337 324 === 2. Build the game as a distributable app bundle === 338 339 325 * You will need Xcode installed (for its SDKs) 340 326 * 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. 341 327 * 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 {{{ 343 329 #!sh 344 330 cd build/workspaces 345 331 ./build-osx-bundle.sh -j3 346 332 }}} 347 333 * '''-j3''' gives the number of parallel builds to run, and should typically be one plus the number of CPU cores available. 348 334 * 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. … … 351 337 * Package the bundle inside a compressed DMG with background image, for easy distribution (see ReleaseProcess). 352 338 353 [[BR]]354 355 339 == BSD == 356 340 '''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" :)''' 357 341 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. 360 343 * boost-libs 361 344 * cmake … … 425 408 * 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). 426 409 427 [[BR]]428 429 410 == Known problems and solutions == 430 411 * None currently.