Hammer Script

From WorldForgeWiki

Jump to: navigation, search

Script for automating the process of installing dependencies and compiling Worldforge projects in a self contained environment. This is useful for building and installing worldforge for development and testing purposes.

Contents

Install Packages

You also need to install a couple of development packages. Under Debian or Ubuntu this could be done with following command.

apt-get -y install g++ make autoconf automake libtool dpkg-dev cvs git-core libdevil-dev liblua5.1-0-dev libtolua++5.1-dev libzzip-dev \
                   libbz2-dev libxaw7-dev libxxf86vm-dev libopenal-dev libalut-dev libsigc++-2.0-dev libcurl4-openssl-dev \
                   libjpeg62-dev libpng12-dev libtiff4-dev libsdl1.2-dev nvidia-cg-toolkit libpcre3-dev libxrandr-dev libmng-dev \
                   libgcrypt-dev libboost-all-dev cmake-core

If you plan on building Cyphesis, you must also install PostgreSQL dev package:

apt-get -y install postgresql postgresql-server-dev-8.3

Note for Ubuntu: nvidia-cg-toolkit might fail to install. If it does go to here and download it. Then just merge into your /usr directory.

Do note that there are also a couple of OGRE and CEGUI packages available, such as this and this. If you want to use this script (or build ogre from source) make sure what you have no ubuntu libogre package installed due to linker error arising.

Download and Install

Pull the Hammer script from the Git repository into the folder you want to use for Worldforge (example: /home/<yourname>/worldforge).

git clone git://git.worldforge.org/hammer.git

I create a link to the script at the root of my Worldforge directory. To do this execute this:

ln -s hammer/hammer.sh Hammer

Setting Up Build Environment

Installing dependencies

To install all needed dependencies (Ogre3D / CEGUI) into our build environment execute this command:

./Hammer install-deps all

Getting the source

Next we will download all the sources for the Worldforge projects and all needed libraries. Execute this command to begin:

./Hammer checkout all

Build

Now we are ready to build! Just execute this command to build all projects:

./Hammer build all

To build a specific project, type the following instead:

./Hammer build <project>

You may also supply your own Make options like this:

./Hammer build all "-j3"

Running

You will find the binaries in the local/bin folder. Example: to run Ember just type this:

./local/bin/ember

If you get an error such as "error while loading shared libraries: some_lib_name.so.x: cannot open shared object file: No such file or directory", then your LD_LIBRARY_PATH environment variable has not been set up correctly. Do the following to add the ./local/lib path to the linker search path:

export LD_LIBRARY_PATH="/path/to/the/hammer/folder/local/lib:$LD_LIBRARY_PATH"

Clean

To delete build files for a project/library to perform a clean build execute:

./Hammer clean <target>

Example: clean the ember client:

./Hammer clean clients/ember

Logging

Hammer redirects output from make and configure to log files. After executing hammer you will find these inside the logs folder. Each project gets its own folder that contains the log files.

Help

This script has built-in help texts that can help you out. To access them type:

./Hammer help

Script fixes or improvements

This script is hosted here on the Worldforge Git repository. To contributes fixes or improvements please either:

  • contact me in IRC (joshthecoder) to get a patch to me
  • post it in the general mailing list and I will see it
Personal tools