Compiling and Patching Snowglobe (Linux)
|Note: This page is meant to be a quick, step-by-step, easy-to-mantain reference. See Compiling the viewer (Linux) for all the gory details and bleeding edge information about dependencies, libraries, standalone, errors, etc.|
There are a number of tools that need to be installed first.
- hg [package: mercurial]
- cmake [package: cmake]
- Currently (snowglobe 1.3.2 and higher) cmake 2.6.2 is the minimum required version.
- yacc or compatible tool [suggested package: bison]
- lex or compatible tool [suggested package: flex]
- python [package: python]
- python 2.4.3 is the minimum required version.
- All more recent 2.x versions should work, too. If you encounter problems or deprecation warnings, please report them.
- python 3.x hasn't been tested yet.
- g++ [package: g++]
- Note (not relevant for standalone): gcc 4.4 (which is in recent Ubuntu and debian) won't work in versions prior to 2.0 (or Snowglobe 1.3) if you are not building standalone (see below), because it chokes on some parts of boost prior to 1.37 (http://svn.boost.org/trac/boost/ticket/2069). The solution is to install GCC 4.3 and to run 'export CXX=/usr/bin/g++-4.3' or whatever your binary is before trying to compile.
- Another workaround is to use update-alternatives; for example, if you already have 4.4 installed, try this:
sudo apt-get install g++-4.3 sudo update-alternatives --remove-all gcc sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.3 43 --slave /usr/bin/g++ g++ /usr/bin/g++-4.3 --slave /usr/bin/gcov gcov /usr/bin/gcov-4.3 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 44 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4 --slave /usr/bin/gcov gcov /usr/bin/gcov-4.4
- then choose 4.3:
sudo update-alternatives --config gcc
- Linden Lab has backported gcc-4.6.3 to Debian Squeeze; this port and its associated libraries are used when building the official Linux viewer.
- The sources and Debian packages for this backport are available from Debian GCC Backport
- libboost-program-options-dev was needed on Ubuntu 8.04 to use cmake, but it's not needed anymore to build a 1.23-render-pipeline on Ubuntu 9.04-beta (nor Snowglobe 2 on Ubuntu 9.10)
- make (package: make)
- bzip2 (package: bzip2)
The build process may use the following optional tools:
- distcc distributed compiler (useful if you have multiple PCs.)
- ccache a fast compiler cache (speed up recompilation, a must if you intend to do development.)
|Tip: To boost your productivity as a developer, try the suggestions at Development Environment for Multiple Viewers about directory structure, multiple viewers and automation of repetitive tasks.|
Get last Snowglobe Trunk sources
Working with the Snowglobe 1.x code base:
If you want to build the Snowglobe 2.x code base:
Get current libraries and artwork
Prepare / configure (OLD)
cd trunk/indra/ ./develop.py configure
Prepare / configure
cd trunk/indra/ cmake .
cd (...)/trunk/ patch -p1 < /path/to/your-patch.txt
cd indra/viewer-linux-i686-relwithdebinfo make
After compilation you get
(...)/linden/indra/viewer-linux-i686-relwithdebinfo/newview/Snowglobe-something.tar.bz2 — copy it somewhere, extract it and do as usual.
If some of the supplied prebuilt libraries are not compatible with your operating system (which you'll only discover after trying), then on future builds, abort the
make after it's completed installing the prebuilts and starts listing compile percentages, remove the offending libraries from
make clean, and finally rerun
make to build without any more manual intervention.