BuildTheCode

From Sirikata Wiki
Revision as of 21:30, 23 February 2009 by Ewencp (talk | contribs)
Jump to navigation Jump to search

Dependencies

Sirikata depends on quite a bit of external code to make everything work. We'll try to maintain a full list of dependencies and brief descriptions of how they're used here.

When building Sirikata you have two options: handle installing dependencies yourself or use our install script to help you build and install everything that's needed. The instructions here will explain how to use our install script. Generally, as long as you use the correct version, standard install procedure applies to all packages. For any where we require a custom build or non-standard build parameters, we'll note that on the dependencies page.

You can look at the install script for more details, but the basic outline of what the install procedure does for all platforms is:

  • Figure out which platform you're on, possibly which version and development tools as well.
  • Checkout the platform specific directory from our dependencies repository. This includes a second stage install script and source and binary packages.
  • Run an install script from this repository which:
    • Possibly tries to install system provided packages that we need
    • Extracts binary packages locally in your tree
    • Compiles source packages and installs them locally in your tree

Note that some of the dependency files are quite large. When you run the install commands, it may appear the script has hung, but its likely just checking out the packages.

Windows and Mac

Windows and Mac never require root access or build tools; all dependencies are binaries that are installed into your source tree (under sirikata/dependencies). To install simply run the commands:

 cd sirikata/
 make depends

You should now have a sirikata/dependencies directory containing all the dependencies.

CMake is not included in this installation. You should use the install tool from the CMake website.

Linux

Currently the install script expects an Ubuntu system, 8.04 or greater. There are two modes of installation - basic or full. The basic mode will install everything it can within the source tree and won't try to install any system libraries (i.e. it assumes you have already installed libraries for which the system provided versions are sufficient). This is useful if you just need to get the custom dependencies in a new clone, having already built Sirikata before. To install using the basic mode issue these commands:

 cd sirikata/
 make depends

The full mode requires root access and will install system libraries as well. This mode is a superset of the basic mode. To install in this mode, issue the following commands:

 cd sirikata/
 make fulldepends

Sirikata

We use CMake to generate our build scripts. Make is used on Mac and Linux and Visual Studio is used on Windows to perform the actual build. All three builds follow the same basic steps:

  • Run cmake, possibly modifying the configuration.
  • Run your build tool.

Windows

Start up CMake and point both paths to sirikata/build/cmake. Hit configure twice. If you installed any dependencies in non-standard locations, point CMake to them now. To generate the build files, hit OK.

Now browse to sirikata/build/cmake. Open Sirikata.sln and run Build All.

This should result in all libraries, plugins, and binaries in the sirikata/build/cmake/debug or sirikata/build/cmake release, depending on which configuration you built.

Notes
  • There aren't standard locations to search for dependencies on Windows. Obviously we've setup the build system to work cleanly with the dependency install script. The easiest way to get a manual installation of dependencies on Windows to work is to use the same layout as the install script, where all dependencies are located in sirikata/dependencies. If you don't do this, you will almost certainly need to manually specify the locations of some libraries in CMake.
  • The build is known to work for VS2005 and VS2008. However, be aware that for VS2005 you must have the latest service pack installed.

Mac and Linux

For convenience we provide a top level makefile which performs the standard build operations. If you want a default build and have used the install script for dependencies, do:

 cd sirikata/
 make

If you'd like to run the build manually, do the following (essentially what is in the makefile):

 cd sirikata/build/cmake
 cmake . [-DCMAKE_BUILD_TYPE=Debug|Release]
 make

To interactively adjust settings, for instance to point CMake to a different version of libraries:

 cd sirikata/build/cmake
 ccmake .

When the build completes you should have the libraries, plugins, and binaries in sirikata/build/cmake.