00001 /* 00002 * build-notes.h 00003 * 00004 * Bogus header for doxygen. Don't use this file! 00005 */ 00006 00007 /// \ingroup dev_guide 00008 /// \defgroup aesop_build AESOP Build Instructions 00009 /// 00010 /// These are notes on how to build the set of AESOP binaries. 00011 /// 00012 /// \n 00013 /// <b>Table of Contents</b>\n 00014 /// - \ref dev_general 00015 /// - \ref dev_gen_repo 00016 /// - \ref dev_gen_lib 00017 /// - \ref dev_gen_test 00018 /// - \ref dev_gen_setup 00019 /// - \ref dev_dep 00020 /// - \ref dev_dep_wave 00021 /// - \ref dev_dep_glut 00022 /// - \ref dev_dep_bullet 00023 /// - \ref dev_dep_tcsh 00024 /// - \ref dev_dep_squish 00025 /// - \ref dev_dep_mini 00026 /// - \ref dev_build 00027 /// 00028 /// \n 00029 /// \section dev_general AESOP Build + Development General Overview 00030 /// 00031 /// Welcome to the AESOP codebase! This codebase was meant to be as extensible 00032 /// and usable as possible, but it does have its quirks. 00033 /// 00034 /// The code is spread into multiple different source repositories. <b>Why 00035 /// have I split the codebase into multiple repositories?</b> In a word: 00036 /// <i>dependencies</i>. I want to make sure that core libraries are usable 00037 /// across a wide range of applications, not just AESOP. And even within the 00038 /// AESOP project, I need to make sure that code intended to run on the server 00039 /// does not pick up any dependencies on UI or input libraries, for instance. 00040 /// 00041 /// In general, code is broken up into small, modular libraries. Those 00042 /// libraries are factored to be as general as possible, and pushed downward 00043 /// in the stack as far as they can go (by minimizing their dependencies). Once 00044 /// a code library has the minimal set of dependencies, which repository it 00045 /// resides in depends on what dependencies are left. 00046 /// 00047 /// Over time, I often refactor high-level code libraries to pull out general 00048 /// functionality and push it down into repositories with less dependencies. 00049 /// This is an attempt to keep libraries decoupled and as reusable as possible. 00050 /// 00051 /// \n 00052 /// \subsection dev_gen_repo Relevent Source Repositories 00053 /// 00054 /// First, <b>Don't Panic</b>. You usually don't need to deal with all of these 00055 /// repositories directly. The build system should make most of this 00056 /// transparent. But this is here for your information. 00057 /// 00058 /// The main repositories, and their dependencies, are: 00059 /// - wave-build (http://wave-build.sourceforge.net/). This contains 00060 /// the basic build system. Has dependencies on Perl and build frameworks 00061 /// such as g++ and make. 00062 /// - wavepacket-lib (http://wavepacket-lib.sourceforge.net/). This is a 00063 /// general set of libraries that can be used across many projects, not 00064 /// just AESOP. Depends on wave-build, and a few general libraries such 00065 /// as libjpeg and libpng. This is the most basic repository and the 00066 /// largest, since the goal is to abstract all libraries enough that they 00067 /// can live here. 00068 /// - wave-glut (http://wave-glut.sourceforge.net/). This is the GLUT/OpenGL 00069 /// library. Depends on OpenGL, glut, GLU, GLEW, and a few open source 00070 /// third-party libraries such as libmini and md3 rendering. Also depends 00071 /// on wavepacket-lib. 00072 /// - gamepad (http://gamepad.sourceforge.net/). This abstracts gamepad 00073 /// objects. Has no UI dependencies. Depends on wavepacket-lib. 00074 /// - gamepad-opengl (http://gamepad-opengl.sourceforge.net/). A small library 00075 /// that uses the gamepad library and OpenGL to provide graphical utilties 00076 /// and example programs for OpenGL. Depends on gamepad and wave-glut. 00077 /// - wave-audio (http://wave-audio.sourceforge.net/). A small library that 00078 /// uses audiere to provide 3D sound APIs. Depends on wavepacket-lib and 00079 /// audiere. 00080 /// - aesop-core (http://aesop-core.sourceforge.net/). This is the largest 00081 /// block of code specific to the AESOP project, including the server code, 00082 /// common client logic, physics engines, etc. Everything in aesop-core 00083 /// must be runnable on a headless server, so no UI or input dependencies 00084 /// are allowed. 00085 /// - aesop-server (http://aesop-server.sourceforge.net/). This is a very 00086 /// small library that exists just to provide the server binary. Depends 00087 /// on aesop-core. 00088 /// - aesop-client (http://aesop-client.sourceforge.net/). This is a reference 00089 /// client, available for people to tweak or use as an example to build 00090 /// their own. A lot of interesting client logic is actually kept in 00091 /// aesop-core. aesop-client contains all rendering-, audio-, or input- 00092 /// dependent libraries (for instance, libraries that depend on OpenGL or 00093 /// audio). This library depends on aesop-core, wave-glut, gamepad, and 00094 /// wave-audio. 00095 /// - aesop-mgf (http://aesop-mgf.sourceforge.net/). This is a mostly empty 00096 /// library that exists only to provide a single parent project that makes 00097 /// it easy to build the full suite of AESOP libraries. This library 00098 /// contains no real code, just a lot of documentation. Depends on 00099 /// aesop-client and aesop-server. 00100 /// 00101 /// \n 00102 /// \subsection dev_gen_lib Library Philosophy 00103 /// 00104 /// As noted above, code is refactored as much as possible to stay in very 00105 /// small, modular libraries. Many libraries consist of only a single header 00106 /// and cpp file! That's fine. Only a few libraries contain multiple cpp 00107 /// files, and if a library contains too many, that is a sign that more 00108 /// refactoring is required. 00109 /// 00110 /// The goal is to keep complexity tightly contained within small modules. 00111 /// Header files should be very simple, with all implementation details hidden 00112 /// in the cpp file. I know this codebase takes some of these concepts to 00113 /// extremes but it is the only way I've found I can keep a large codebase 00114 /// maintainable given my short attention span. 00115 /// 00116 /// 00117 /// \n 00118 /// \subsection dev_gen_test Library Tests 00119 /// 00120 /// Each library (may) contain its own set of unit tests and/or demo/example 00121 /// programs. These live in a <b>test</b> directory within the library 00122 /// directory. The <b>test</b> directory has special semantics: each cpp 00123 /// file is used to generate a stand-alone binary of the same name, unlike 00124 /// library directories where all cpp files are used to create a single 00125 /// archive file. 00126 /// 00127 /// One of the goals of refactoring code into small libraries is that then 00128 /// it is easier to build test coverage. 00129 /// 00130 /// The test infrastructure was built some time after many of the repositories 00131 /// were set up, so not all libraries have test subdirectories. But these are 00132 /// being added all the time. 00133 /// 00134 /// At the moment, the build system does not provide support for running a 00135 /// bank of tests, such as by running "make check". But that will be added in 00136 /// the future. For now, the test subdirectories and binaries at least help to 00137 /// develop and test libraries in isolation. 00138 /// 00139 /// \n 00140 /// \subsection dev_gen_setup The Setup Program 00141 /// 00142 /// You can read below for more information about AESOP dependencies. In 00143 /// general, I've tried to make things as simple as possible by having the 00144 /// build system fetch as many dependencies automatically as it can. 00145 /// 00146 /// In the wave-build set of build tools, there is a program (perl script) 00147 /// named Setup that knows how to fetch remote build instruction files and 00148 /// then automatically pull down repositories of the appropriate version. 00149 /// 00150 /// The general rules are: 00151 /// - Use <b>Setup</b> to pull down and refresh local copies of repositories. It 00152 /// is safe to run Setup multiple times (it will refresh local copies but 00153 /// not damage local copies). Be aware, however, that this may result 00154 /// in merge conflicts or other usual complications due to re-syncing to 00155 /// a remote authoritative source repository. 00156 /// - Use <b>make</b> to make binaries locally. Make will only work with 00157 /// local copies of repositories and will never attempt to sync to remote 00158 /// repositories. 00159 /// 00160 /// \n 00161 /// \section dev_dep AESOP Build Dependencies. 00162 /// 00163 /// If you want to build and run a local AESOP source tree, you'll have to get 00164 /// all of the dependencies lined up. 00165 /// 00166 /// There are several dependencies of AESOP! Although I tried to keep this sort 00167 /// of dependency handling 00168 /// to a minimum, I also wanted to re-use as much code as possible. So there are 00169 /// dependencies. 00170 /// 00171 /// These are the dependencies I'm aware of, and instructions (or at least 00172 /// pointers) for installing them. I think it is safest to install them in this 00173 /// order ("safe" in the sense that some of these depend on others). [This is the 00174 /// order for installation if you build aesop-server first, then aesop-client.] 00175 /// 00176 /// \n 00177 /// \subsection dev_dep_wave Wavepacket Libraries 00178 /// 00179 /// wavepacket-lib is a library repository, written by me. It is a separate 00180 /// repository because it contains low-level libraries used by multiple other 00181 /// repositories/projects. 00182 /// 00183 /// \b NOTE: you must keep your svn repositories as child folders within a single 00184 /// parent folder. For instance, I keep all of my svn repositories in a parent 00185 /// folder named "svn", off my personal home directory. But the point is that all 00186 /// svn local directories are peers of each other in the local filesystem. 00187 /// 00188 /// You can retrieve wavepacket-lib from sourceforge by running this from within 00189 /// your parent directory: 00190 /// \code 00191 /// % svn co https://wavepacket-lib.svn.sourceforge.net/svnroot/wavepacket-lib wavepacket-lib 00192 /// \endcode 00193 /// That will check out a local version of the wavepacket-lib repository, and put 00194 /// it in a local subdirectory named "wavepacket-lib". Again, that should be a 00195 /// peer to your "aesop" directory. 00196 /// 00197 /// \n 00198 /// \subsection dev_dep_glut glut: the OpenGL Utility Toolkit 00199 /// 00200 /// A very easy dependency to obtain and install! Installs via yum. As root: 00201 /// \code 00202 /// % yum install freeglut-devel 00203 /// \endcode 00204 /// 00205 /// (This assumes you've already got OpenGL installed on your machine) 00206 /// 00207 /// \n 00208 /// \subsection dev_dep_bullet Bullet Physics Library 00209 /// 00210 /// See http://www.bulletphysics.com/Bullet/wordpress/ 00211 /// 00212 /// Sadly, Bullet does not have a simple (yum) install at this point. 00213 /// This is what I did to install (Fedora 10): 00214 /// - Go to that site, click on the "Bullet Download" link. 00215 /// - Click on the "bullet-2.73-sp1.tgz" link (because I'm on Linux) 00216 /// - Download and save the file locally 00217 /// - Personally, I create a "/usr/share/bullet" directory, and install there 00218 /// - Note that I build + install bullet as root! That is overkill. You can 00219 /// build as another user, and only install as root. 00220 /// - To install: 00221 /// - Go to the build directory ("/usr/share/bullet" in my case) 00222 /// - Copy the bullet.tgz file there if necessary 00223 /// - Unzip running % gunzip bullet-2.73-sp1.tgz 00224 /// - De-archive running % tar -xf bullet-2.73-sp1.tar 00225 /// - Go into the new bullet-2.73 directory 00226 /// - Read the INSTALL file! Avoid jam 00227 /// - Build and install bullet: 00228 /// \code 00229 /// % ./autogen.sh 00230 /// % ./configure 00231 /// % make (takes a long time!) 00232 /// % make install (run this as root) 00233 /// \endcode 00234 /// - Sadly, there is still more to do. First, add a symlink so the 00235 /// headers can be found: 00236 /// \code 00237 /// % cd /usr/local/include 00238 /// % ln -sf /usr/share/bullet/bullet-2.73/src bullet 00239 /// \endcode 00240 /// 00241 /// \n 00242 /// \subsection dev_dep_tcsh tcsh Shell (needed by libMini) 00243 /// 00244 /// Annoyingly, this is only needed by libmini's build script. But it isn't too 00245 /// hard to install: 00246 /// \code 00247 /// % yum install tcsh 00248 /// \endcode 00249 /// 00250 /// \n 00251 /// \subsection dev_dep_squish squish compression library (used by libMini) 00252 /// 00253 /// Squish is easy to get, but I found it didn't compile! To get it to work, I 00254 /// had to: 00255 /// - Download the .tar.gz file from http://code.google.com/p/libsquish/ 00256 /// - unzip and untar (tar -xf) into a local directory 00257 /// - build by typing % make 00258 /// - if that fails, edit squish.h and add this to the top: 00259 /// \code 00260 /// #ifndef INT_MAX 00261 /// #define INT_MAX 0x7fffffff 00262 /// #endif // INT_MAX 00263 /// \endcode 00264 /// (or add a #include to whatever file defines INT_MAX) 00265 /// - % make (should work now) 00266 /// - % make install (as root) 00267 /// 00268 /// \n 00269 /// \subsection dev_dep_mini libMini terrain library 00270 /// 00271 /// I'm not aware of a way to install using yum. The libmini package can be 00272 /// downloaded from http://www.stereofx.org/download/ 00273 /// 00274 /// I have used libmin-8.9 successfully. 00275 /// 00276 /// To install: 00277 /// - download the .zip file 00278 /// - unzip in a local directory 00279 /// - build the configure script by running % ./build.sh 00280 /// - install with % make install 00281 /// 00282 /// 00283 /// \n 00284 /// \section dev_build Building the AESOP Tools and Applications 00285 /// 00286 /// Typically there are only two binaries you care about: the client and server. 00287 /// There are tools and tests you can build as well, but most of the time is 00288 /// spent working with the client and server. Fortunately, building is the same 00289 /// for everything. 00290 /// 00291 /// AESOP uses the Wavepacket Build System, see 00292 /// http://wavepacket-lib.sourceforge.net/group__build.html 00293 /// 00294 /// To build anything, go to the source directory and type 00295 /// \code 00296 /// % make 00297 /// \endcode 00298 /// 00299 /// Directories containing anything buildable also have a Makefile, so you 00300 /// can type 00301 /// \code 00302 /// % make 00303 /// \endcode 00304 /// pretty much anywhere and code should recursively build. 00305 /// 00306 /// That should do it! If the target is an application or tool, the binary 00307 /// will be copied into the aesop/obj/bin directory. Libraries won't be 00308 /// copied, they will remain in their aesop/obj/lib directory for linking 00309 /// with apps and tools. 00310 /// 00311 /// If \p make fails, that's a sign that the Wavepacket Libraries haven't 00312 /// been installed properly. See \ref dev_dep_wave. 00313 /// 00314 /// As an example, to build and run the server, you would: 00315 /// \code 00316 /// % cd aesop/app/aesop-server 00317 /// % make 00318 /// \endcode 00319 /// (although if you ran \p make from the root of the svn tree, that would 00320 /// compile the server along with everything else). 00321 /// 00322 /// That would build the server, which has the side-effect of "installing" the 00323 /// server binary into the aesop/obj/bin directory. 00324 /// 00325 /// You can clean out a local project by typing: 00326 /// \code 00327 /// % make clean 00328 /// \endcode 00329 /// That will clean out the current project, as well as all of its (recursive) 00330 /// dependencies. 00331 /// 00332 /// So if you run 00333 /// \code 00334 /// % make clean 00335 /// \endcode 00336 /// from the svn root, you'll recursively clean out all modules. 00337 ///