Difference between revisions of "BuildTheCode"

From Sirikata Wiki
Jump to: navigation, search
(Mac and Linux: add note about mac Frameworks)
Line 24: Line 24:
  
 
You should now have a sirikata/dependencies directory containing all the dependencies.
 
You should now have a sirikata/dependencies directory containing all the dependencies.
 +
 +
Alternatively, if you only want required dependencies (e.g. to avoid building plugins you will not be using), you can install a minimal set of dependencies.
 +
 +
  cd sirikata/
 +
  make minimaldepends
  
 
CMake is not included in this installation.  You should use the install tool from [http://www.cmake.org the CMake website].
 
CMake is not included in this installation.  You should use the install tool from [http://www.cmake.org the CMake website].
Line 48: Line 53:
  
 
You should now have a sirikata/dependencies directory containing all the dependencies.
 
You should now have a sirikata/dependencies directory containing all the dependencies.
 +
 +
Alternatively, if you only want required dependencies (e.g. to avoid building plugins you will not be using), you can install a minimal set of dependencies.
 +
 +
  cd sirikata/
 +
  make minimaldepends
  
 
Again, the Mac may not come with the correct version of cmake. You can go to [http://www.cmake.org the CMake website] for the latest package, or else you can install it using MacPorts.
 
Again, the Mac may not come with the correct version of cmake. You can go to [http://www.cmake.org the CMake website] for the latest package, or else you can install it using MacPorts.
Line 53: Line 63:
 
== Linux ==
 
== 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:
+
Currently the install script expects an Ubuntu system, 8.04 or greater.  There are three modes of installation - basic, full, and minimal.  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/
 
   cd sirikata/
Line 62: Line 72:
 
   cd sirikata/
 
   cd sirikata/
 
   make fulldepends
 
   make fulldepends
 +
 +
The minimal mode installs as little as possibly needed to get up and running. Note that you will get fewer plugins if you use this set.  Note again that this doesn't install any of the system dependencies.
 +
 +
  cd sirikata/
 +
  make minimaldepends
  
 
= Building Sirikata =
 
= Building Sirikata =

Revision as of 05:31, 4 June 2009

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

Using Cygwin (easy)

Windows never requires root access or build tools; all dependencies are binaries that are installed into your source tree (under sirikata/dependencies). To install simply run these commands in a Cygwin bash shell:

 cd sirikata/
 make depends

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

Alternatively, if you only want required dependencies (e.g. to avoid building plugins you will not be using), you can install a minimal set of dependencies.

 cd sirikata/
 make minimaldepends

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

Without Cygwin (manual)

While Cygwin is a useful tool, the requirement of a Cygwin installation for the windows compile is not necessary.

You will need to install a SVN client (e.g. TortoiseSVN). Then, checkout:

and name that directory "dependencies".

If using a command-line SVN client, run "svn co http://sirikata.googlecode.com/.../win32vc9 dependencies"

Then, go into the dependencies folder and unzip all of the packages directly into the dependencies directory ("Extract here"). The extracted directories should have generic names like "installed-curl".

Mac

The mac will not require root access; 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.

Alternatively, if you only want required dependencies (e.g. to avoid building plugins you will not be using), you can install a minimal set of dependencies.

 cd sirikata/
 make minimaldepends

Again, the Mac may not come with the correct version of cmake. You can go to the CMake website for the latest package, or else you can install it using MacPorts.

Linux

Currently the install script expects an Ubuntu system, 8.04 or greater. There are three modes of installation - basic, full, and minimal. 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

The minimal mode installs as little as possibly needed to get up and running. Note that you will get fewer plugins if you use this set. Note again that this doesn't install any of the system dependencies.

 cd sirikata/
 make minimaldepends

Building 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.
  • If you get error 0xc0000022, check the permissions of the sirikata top-level directory. If you used Cygwin's version of git, it will remove execute permissions for security purposes. You may enable execute by doing "chmod -R +x sirikata" in cygwin, or Granting yourself Full Control in Right Click->Properties->Security (make sure to click the Replace All Entries in Child Objects checkbox).

DLL Path under windows

[If you get a message saying anything like 0xc0150002, "failed to initialize properly", "the runtime asked to terminate", or about "reinstalling the application": If you use Visual Studio 2005, you must have Service Pack 1 installed. Also, you may need to install the "Visual C++ Redistributable Package".]

In order to get Sirikata to find the required DLLs, you must put the DLL folders in your path. To set the PATH environment variable:

  • right click on My Computer, select Properties, click on the Advanced tab, and click on Environment Variables....
  • Under the Current User section, click on he PATH variable, and click Edit.... If PATH does not yet exist, click on the New button and name it PATH.
  • Move the cursor to the end of the text field, and add a ";".
  • Add these paths to the end:
    • C:\sirikata\dependencies\boost_1_37_0\lib;C:\sirikata\dependencies\installed-curl;C:\sirikata\dependencies\ogre-1.6.1\bin;C:\sirikata\dependencies\SDL-1.3.0\bin
    • Replace C:\sirikata with the top-level directory you checked out git from.

You must also move OGRE dlls into the same folder as cppoh_d.exe:

  • Open up dependencies\ogre-1.6.1\bin. Copy the .dll's into the Debug folder in the project directory.

Note that Sirikata currently does not work in Windows 2000, due to the lack of a few raw input functions (RegisterRawInputDevice) that SDL 1.3 uses. This will hopefully be fixed in SDL at some point to make it use the old DirectX raw input system.

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.

Notes

For the mac, you must make a symbolic link one level above cmake, to the Frameworks directory in dependencies. This is required to emulate the structure of a Mac Application which has Frameworks one level above the MacOS binary directory.

 cd sirikata/build
 ln -s ../dependencies/Frameworks