Imprudence:Compiling

Our modest attempt at a tutorial for compiling the Second Life / Imprudence code. Please correct any errors or missing information.

On Linux

 * CMake 2.4.8 (newer versions seem not to work right)
 * Python
 * The standard stuff: gcc, make, tar, etc.

On MacOS X

 * OS Leopard (10.4) or Tiger (10.5)
 * XCode 2.4 (if you have Leopard) or 3.0 (if you have Tiger) (free to download, you just need sign up for a free ADC membership)
 * CMake 2.4.8 or greater

On Windows
To be written. If you know what's needed to compile for Windows, please add the list here.

Downloading the Viewer Source Code & Artwork
Imprudence source code packages aren't available right now. Soon. If you know how to use Git, you can get the source from Jacek's "next" branch.

Otherwise, you can practice compiling with the SL source 1.21.2:
 * Linux/Mac
 * Windows

You also need to download the artwork and fonts (misleadingly called 'libraries' for historical reasons that don't matter right now):
 * Artwork
 * Fonts for Linux/Mac or Windows.

The source, artwork, and font packages should all have a "linden" folder inside them. The contents of those should be combined together into one "linden" folder, so they can be together as one nice little family.

Generating Project Files & Auto-downloading Libraries
Once all that is gathered together, the next step is to run the command to generate the project files. This will also automatically download some software library files for the Viewer to compile with.

Open up the "linden/indra/" directory where you unpacked the source and artwork, and run the "develop.py" program. (I think it should work by double-clicking on Mac and Windows; Linux users may need to cd to that directory and run  from the command line.)

The develop.py command will do a few things: 1. Automatically download a bunch of software libraries and unpack them in the linden/libraries/ folder to be used later when compiling. This will take a while, depending on the speed of your internet connection, but the good news is it only has to download each library once, not every time you compile. 2. Create project files to use for compiling with Visual Studio (on Windows), XCode (on Mac), or Make (on Linux).

Compiling
Now for the actual compiling! The instructions here are different for each operating system, because of the different software they use.

Note: Compiling the first time will usually take a few hours, so you should start it running and then go do something else. Check in from time to time to make sure it hasn't had an error.

On Linux
./develop.py build

This will go through and compile everything, putting it inside the "linden/indra/viewer-i686-linux" or similarly-named directory. The final product goes into "linden/indra/viewer-i686-linux/newview/".

On Mac
Details are fuzzy here, because I've never compiled on a Mac. If you have, please correct this section. My guesses:


 * Look for a directory (in "indra") called "build-something" or "viewer-something". Look for a "something.xcode" file in there, and load it up in XCode. Then click the compile button, do whatever it is you do to compile with XCode.
 * Run this from the command line, from inside the "indra" directory: ./develop.py build

On Windows
Details are a bit fuzzy here too.

Look for a directory (in "indra") called "build-vc___" (the actual directory name depends on what version of Visual Studio you have installed). Open up the "secondlife.sln" or "imprudence.sln" file in Visual Studio. Then click the compile button, do whatever it is you do to compile with Visual Studio.

Removing Bad Libraries on Gentoo Linux
If you are running Gentoo Linux, you may need to remove some of the auto-downloaded libraries in order for the executable to successfully link at the end. From, remove:

libatk-1.0.so libgdk_pixbuf-2.0.so libgdk-x11-2.0.so libglib-2.0.so libGLU.so libGLU.so.1 libGLU.so.1.3.070002 libgmodule-2.0.so libgobject-2.0.so libgthread-2.0.so libgtk-x11-2.0.so libgtk-x11-2.0.so.0.400.14 libpango-1.0.so libpangoft2-1.0.so libpangox-1.0.so libpangoxft-1.0.so

This will cause the compile process to use the libraries installed on your system. So, you'll need to have these installed via portage:

dev-libs/atk dev-libs/glib media-libs/mesa x11-libs/gtk+ x11-libs/pango