Hammer Script

From WorldForgeWiki
(Redirected from Compiling Ember: Script New)
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.

The script itself is available from Github here.

Please read the whole process over carefully before undertaking as some sections include notes following which might be relevant to you.

Install Packages

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

sudo apt-get -y install g++ make liblua5.1-0-dev libtolua++5.1-dev libzzip-dev \
                   libbz2-dev libxaw7-dev libopenal-dev libalut-dev libsigc++-2.0-dev libcurl4-openssl-dev \
                   libjpeg62-dev libpng-dev libpcre3-dev libxrandr-dev libxdg-basedir-dev \
                   libgcrypt20-dev libboost-all-dev cmake libfreeimage-dev curl rsync \
                   libtinyxml-dev libsdl2-dev libglew-dev libbullet-dev libsqlite3-dev python3-dev libpugixml-dev

If you plan on building AppImages (to package the Ember binary and all associated dependencies in a self-contained package) you must also run the following:

apt-get -y install python-xdg xorriso

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.


For Fedora/RHEL/Centos

yum groupinstall "Development Tools"
yum install libXaw-devel libsigc++20-devel swig cppunit-devel alsa-lib-devel SDL-devel openal-soft-devel \
freealut-devel freeimage-devel pcre-devel lua-devel bzip2-devel zziplib-devel freetype-devel boost-devel \
python3-devel cmake curl-devel libcrypt-devel tolua++-devel bullet-devel sqlite-devel readline-devel \
docbook-utils

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://github.com/worldforge/hammer.git
cd hammer

In order to keep your version of the hammer client updated you should also issue this command while standing inside the "hammer" directory.

git pull

Setting Up Build Environment

Installing dependencies

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

./hammer.sh 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.sh checkout all

Build

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

./hammer.sh build all

To build a specific project, type the following instead:

./hammer.sh build <project>

You may also supply your own Make options like this:

./hammer.sh build all "-j3"

Running

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

./work/local/bin/ember

Clean

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

./hammer.sh clean <target>

Example: clean the ember client:

./hammer.sh clean clients/ember

Note that all build artifacts are placed in the "work" directory. This includes both the code and the compiled files.

Logging

Hammer redirects output from make and configure to log files. After executing hammer you will find these inside the work/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.sh help

Script fixes or improvements

This script is hosted here in the Worldforge Github repository. To contribute fixes just fork the project, create commits and issue a pull request through GitHub.

Troubleshooting

For a list of Commonly encountered errors and how to fix them please visit the Troubleshooting page.