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 | |
| 95 | By 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` |
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. |
| 98 | The 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. |
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 ==== |
| 116 | If 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` |
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` |