Difference between revisions of "Compiling and Patching Snowglobe (Linux)"

From Second Life Wiki
Jump to navigation Jump to search
(→‎Get current libraries and artwork: let's use the easy, snowlgobey way (using Rob's script))
m (this hint is more a note than a tip)
 
(14 intermediate revisions by 6 users not shown)
Line 4: Line 4:
[[Snowglobe]] is where open development is most active right now. Follow these instructions to '''compile (and patch) Snowglobe sources on Linux using SVN'''.  
[[Snowglobe]] is where open development is most active right now. Follow these instructions to '''compile (and patch) Snowglobe sources on Linux using SVN'''.  


This page is meant to be a '''quick, step-to-step''', easy-to-mantain reference. See [[Compiling_the_viewer_(Linux)]] and links provided there for more details and information on dependencies, errors, etc.
{{KBnote|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.}}


<!-- Edit the following section in https://wiki.secondlife.com/wiki/Compiling_the_viewer_(Linux)#Required_tools -->
{{:Compiling the viewer (Linux)}}


== Get last Snowglobe Trunk sources ==
== Get last Snowglobe Trunk sources ==
Working with the Snowglobe 1.x code base:


  svn co http://svn.secondlife.com/svn/linden/projects/2009/snowglobe/trunk
  svn co http://svn.secondlife.com/svn/linden/projects/2009/snowglobe/trunk
If you want to build the Snowglobe 2.x code base:
svn co http://svn.secondlife.com/svn/linden/projects/2010/snowglobe/trunk


== Get current libraries and artwork ==
== Get current libraries and artwork ==


  ./trunk/scripts/public_fetch_tarballs.py
  ./trunk/scripts/public_fetch_tarballs.py
== Prepare / configure (OLD) ==
cd trunk/indra/
./develop.py configure


== Prepare / configure ==
== Prepare / configure ==


  cd trunk/linden/indra/
  cd trunk/indra/
  ./develop.py configure
  cmake .


== PATCH ==
== Patch ==


[http://stephenjungels.com/jungels.net/articles/diff-patch-ten-minutes.html Learn how and where to apply a patch].
[http://stephenjungels.com/jungels.net/articles/diff-patch-ten-minutes.html Learn how and where to apply a patch].


(PLEASE CONFIRM/DENY): ''If you need to apply patch, you will usually have to do it inside linden/ directory''.
cd (...)/trunk/
cd ../
patch -p1 < /path/to/your-patch.txt


cp (...)/your-patch.txt .
== Compile ==
patch -p1 < your-patch.txt


== Compile ==
cd indra/viewer-linux-i686-relwithdebinfo
make


* cd indra/viewer-linux-i686-relwithdebinfo
After compilation you get <code>(...)/linden/indra/viewer-linux-i686-relwithdebinfo/newview/'''Snowglobe-something.tar.bz2'''</code> &mdash; copy it somewhere, extract it and do as usual.
* 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 <code>make</code> after it's completed installing the prebuilts and starts listing compile percentages, remove the offending libraries from <code>linden/libraries/i686-linux/lib_release_client/</code>, run <code>make clean</code>, and finally rerun <code>make</code> to build without any more manual intervention.


[[Category:Compiling viewer]]
[[Category:Compiling viewer]]

Latest revision as of 16:07, 29 July 2010

Snowglobe is where open development is most active right now. Follow these instructions to compile (and patch) Snowglobe sources on Linux using SVN.

KBnote.png 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.


Required tools

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.)
KBtip2.png 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:

svn co http://svn.secondlife.com/svn/linden/projects/2009/snowglobe/trunk


If you want to build the Snowglobe 2.x code base:

svn co http://svn.secondlife.com/svn/linden/projects/2010/snowglobe/trunk

Get current libraries and artwork

./trunk/scripts/public_fetch_tarballs.py

Prepare / configure (OLD)

cd trunk/indra/
./develop.py configure

Prepare / configure

cd trunk/indra/
cmake .

Patch

Learn how and where to apply a patch.

cd (...)/trunk/
patch -p1 < /path/to/your-patch.txt

Compile

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 linden/libraries/i686-linux/lib_release_client/, run make clean, and finally rerun make to build without any more manual intervention.