Difference between revisions of "Linux Build Environment"
(→Catznip Source) |
(→Install Build Environment) |
||
(18 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | The following instructions have been tested on both Ubuntu and | + | '''Instructions updated January 2016 for Catznip R10, source download step will not function till after the public release''' |
+ | |||
+ | The following instructions have been tested on both Ubuntu, Mint and Gentoo. You will need at least 1 GB of free disk space on your root partition for the build environment, and 5 GB in your home folder for the source code and compilation results, and at least 4GB of memory. We do not recommend you do this on removable / usb based storage. | ||
Setting up the environment is relatively straight forward, compiling can take several hours depending on hardware. | Setting up the environment is relatively straight forward, compiling can take several hours depending on hardware. | ||
− | '''Commands starting with a $ are to be run on the host, commands starting with ( | + | '''Commands starting with a $ are to be run on the host, commands starting with (jessie)# are to be run inside the schroot.''' Don't type the $ or (trusty)#. |
+ | ==Installing Schroot & Debbootstrap== | ||
− | == | + | ===Debian / Ubuntu / Mint Host=== |
− | |||
− | |||
Install schroot and debootstrap. | Install schroot and debootstrap. | ||
<pre> | <pre> | ||
$ sudo apt-get install schroot debootstrap | $ sudo apt-get install schroot debootstrap | ||
</pre> | </pre> | ||
+ | |||
+ | ===Gentoo Host=== | ||
+ | Add some groups Debian expects and install schroot and debootstrap from portage. Where sudo is used in this guide, su to root then run the command omitting 'sudo'. | ||
+ | <pre> | ||
+ | # groupadd crontab | ||
+ | # groupadd sudo | ||
+ | # groupadd staff | ||
+ | # emerge schroot debootstrap | ||
+ | </pre> | ||
+ | |||
+ | ==Setup the Schroot== | ||
+ | This guided uses a schroot to provide a static build environment that is separate from your running install, a Linux inside a Linux. Once set up this can be easily backed up and copied between machines. | ||
Configure the schroot. Edit ''''/etc/schroot/schroot.conf'''' so it looks like the following, making sure to change '''YOUR_USER_NAME'''... | Configure the schroot. Edit ''''/etc/schroot/schroot.conf'''' so it looks like the following, making sure to change '''YOUR_USER_NAME'''... | ||
<pre> | <pre> | ||
− | [ | + | [jessie] |
− | description=Debian | + | description=Debian Jessie |
type=directory | type=directory | ||
− | directory=/schroot/ | + | directory=/schroot/jessie |
users=YOUR_USER_NAME | users=YOUR_USER_NAME | ||
groups=sbuild | groups=sbuild | ||
Line 29: | Line 42: | ||
<pre> | <pre> | ||
$ sudo mkdir /schroot | $ sudo mkdir /schroot | ||
− | $ sudo mkdir /schroot/ | + | $ sudo mkdir /schroot/jessie |
</pre> | </pre> | ||
− | + | ==Ubuntu Trusty== | |
− | == | + | We build using Debian Jessie, for fewer headaches you should too. There are other distributions you could use in your schroot, good luck! |
− | We build using Debian | ||
<pre> | <pre> | ||
− | $ sudo debootstrap --arch i386 | + | $ sudo debootstrap --arch i386 trusty /schroot/jessie tuhttp://ftp.debian.org/debian |
</pre> | </pre> | ||
Enter the new schroot.. | Enter the new schroot.. | ||
<pre> | <pre> | ||
− | $ sudo schroot -c | + | $ sudo schroot -c jessie -u root |
</pre> | </pre> | ||
If you have done everything right to this point your prompt will change to look something like the following, ignore any 'failed to change directory' warnings. | If you have done everything right to this point your prompt will change to look something like the following, ignore any 'failed to change directory' warnings. | ||
<pre> | <pre> | ||
− | ( | + | (trusty)root@tetsuo:/home/trinity# |
</pre> | </pre> | ||
− | Install a load of things needed to build the viewer. | + | ===Install Build Environment=== |
+ | Next we install a load of things needed to build the viewer including Linden Lab's Autobuild. | ||
+ | <pre> | ||
+ | (trusty)# apt-get update | ||
+ | (trusty)# apt-get install software-properties-common | ||
+ | </pre> | ||
+ | This next bit is one long command, just copy and paste as provided, it will work fine. | ||
+ | <pre> | ||
+ | (trusty)# apt-get install --install-recommends bison bzip2 cmake curl flex g++ m4 \ | ||
+ | nano mercurial python python-dev python-pip libc6-dev libgl1-mesa-dev libglu1-mesa-dev \ | ||
+ | libstdc++6 libxcursor-dev libX11-dev libxinerama-dev libxml2-dev libxrender-dev wget | ||
+ | </pre> | ||
+ | Now Install Linden Lab's Autobuild system wide. | ||
+ | <pre> | ||
+ | (trusty)#pip install 'hg+https://bitbucket.org/lindenlab/autobuild-1.0#egg=autobuild' | ||
+ | </pre> | ||
+ | If all went to plan then you should be able to type #autobuild --version' and see the following. | ||
<pre> | <pre> | ||
− | ( | + | (trusty)root@TETSUO:/home/trinity# autobuild --version |
− | + | autobuild 1.0 | |
− | |||
− | |||
</pre> | </pre> | ||
We're done here. Exit the schroot. | We're done here. Exit the schroot. | ||
<pre> | <pre> | ||
− | ( | + | (trusty)# exit |
</pre> | </pre> | ||
− | |||
==Setting up== | ==Setting up== | ||
Line 72: | Line 97: | ||
<pre> | <pre> | ||
$ cd ~/SecondLife-Dev | $ cd ~/SecondLife-Dev | ||
− | $ schroot -c | + | $ schroot -c trusty |
</pre> | </pre> | ||
If you have done everything correct you should be presented with something like the following. | If you have done everything correct you should be presented with something like the following. | ||
<pre> | <pre> | ||
− | ( | + | (trusty)trinity@tetsuo:~/SecondLife-Dev$ |
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
− | + | Unlike previous versions of this guide we do not need to update cmake. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===Catznip Source=== | ===Catznip Source=== | ||
We do not release source code for a viewer until we have released it to the public. | We do not release source code for a viewer until we have released it to the public. | ||
<pre> | <pre> | ||
− | ( | + | (trusty)$ cd ~/SecondLife-Dev |
</pre> | </pre> | ||
Fetch the source from our [http://hg.catznip.com/ bitbucket] repository. This may take some time ... | Fetch the source from our [http://hg.catznip.com/ bitbucket] repository. This may take some time ... | ||
<pre> | <pre> | ||
− | ( | + | (trusty)$ hg clone http://hg.catznip.com/Catznip-R10 |
</pre> | </pre> | ||
<pre> | <pre> | ||
− | ( | + | (trusty)$ cd ~/SecondLife-Dev/Catznip-R10 |
</pre> | </pre> | ||
Line 135: | Line 132: | ||
<pre> | <pre> | ||
$ cd ~/SecondLife-Dev | $ cd ~/SecondLife-Dev | ||
− | $ schroot -c | + | $ schroot -c trusty |
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | ||
− | |||
===Autobuild configure & build=== | ===Autobuild configure & build=== | ||
Change to the source directory.. | Change to the source directory.. | ||
− | < | + | <pre> |
− | ( | + | (trusty)$ cd ~/SecondLife-Dev/Catznip-R10 |
− | </ | + | </pre> |
Run autobuild, setting the viewer channel to '''Catznip Homebrew''' will get you the homebrew branding, logos and start up screen when you're done (for R9 or later). | Run autobuild, setting the viewer channel to '''Catznip Homebrew''' will get you the homebrew branding, logos and start up screen when you're done (for R9 or later). | ||
<pre> | <pre> | ||
− | ( | + | (trusty)$ autobuild configure -c ReleaseOS -- -DFMODEX:BOOL=OFF \ |
-DVIEWER_CHANNEL="\"Catznip Homebrew\"" -DGCC_DISABLE_FATAL_WARNINGS:BOOL=ON \ | -DVIEWER_CHANNEL="\"Catznip Homebrew\"" -DGCC_DISABLE_FATAL_WARNINGS:BOOL=ON \ | ||
-DLL_TESTS:BOOL=OFF | -DLL_TESTS:BOOL=OFF | ||
</pre> | </pre> | ||
− | There are a number of compilation options you are free to explore but | + | There are a number of compilation options you are free to explore but that's beyond the scope of this document. |
Compile the viewer .. depending on hardware this could take a significant amount of time (over an hour on an i5). | Compile the viewer .. depending on hardware this could take a significant amount of time (over an hour on an i5). | ||
<pre> | <pre> | ||
− | ( | + | (trusty)$ autobuild build -c ReleaseOS --verbose |
</pre> | </pre> | ||
− | The build and all working files will be placed inside '''~/SecondLife-Dev/Catznip- | + | The build and all working files will be placed inside '''~/SecondLife-Dev/Catznip-{{CurrentVersion}}/build-linux-i686'''. This folder should be removed if you wish to run configure again or to save disk space on older source trees. |
==Running the Viewer== | ==Running the Viewer== | ||
Line 172: | Line 163: | ||
Exit from the schroot (or open a new terminal). | Exit from the schroot (or open a new terminal). | ||
<pre> | <pre> | ||
− | ( | + | (trusty)$ exit |
</pre> | </pre> | ||
Change to the directory ... | Change to the directory ... | ||
− | < | + | <pre> |
− | $ cd ~/SecondLife-Dev/ | + | $ cd ~/SecondLife-Dev/Catznip-R10/build-linux-i686/newview/packaged |
− | </ | + | </pre> |
.. and run. No installation or messing about required, menu entries will be created. | .. and run. No installation or messing about required, menu entries will be created. | ||
Line 186: | Line 177: | ||
The viewer will have it's own configuration file '''~/.catznip/user_settings/settings_homebrew.xml''' | The viewer will have it's own configuration file '''~/.catznip/user_settings/settings_homebrew.xml''' | ||
− | |||
==Deep Notes== | ==Deep Notes== | ||
Line 194: | Line 184: | ||
We are bound by the terms of the havok sub licence and as such can not provide libraries or instructions on how to build havok into the viewer. Mesh upload will not function and the pathfinding nav mesh will not be visible. | We are bound by the terms of the havok sub licence and as such can not provide libraries or instructions on how to build havok into the viewer. Mesh upload will not function and the pathfinding nav mesh will not be visible. | ||
+ | |||
Configuration options to explore include '''-DCMAKE_CXX_FLAGS:STRING="\" ..... \""''' and '''-DCMAKE_EXE_LINKER_FLAGS:STRING="\" .... \""'''. | Configuration options to explore include '''-DCMAKE_CXX_FLAGS:STRING="\" ..... \""''' and '''-DCMAKE_EXE_LINKER_FLAGS:STRING="\" .... \""'''. | ||
To compile any changes you make to the source, you only have to run '''../autobuild/bin/autobuild build -c ReleaseOS --verbose''' as detailed above. | To compile any changes you make to the source, you only have to run '''../autobuild/bin/autobuild build -c ReleaseOS --verbose''' as detailed above. | ||
− | If run out of the build folder the viewer XUI files will be loaded from '''~/SecondLife-Dev/ | + | If run out of the build folder the viewer XUI files will be loaded from '''~/SecondLife-Dev/Catznip-R9/indra/newview/skins/default/''' rather than those in location you're running the viewer from. Editing XUI files while running is a good source of crashes, so is messing up the XUI. |
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
[[Category:Development]][[Category:Linux]] | [[Category:Development]][[Category:Linux]] |
Latest revision as of 00:41, 5 November 2016
Instructions updated January 2016 for Catznip R10, source download step will not function till after the public release
The following instructions have been tested on both Ubuntu, Mint and Gentoo. You will need at least 1 GB of free disk space on your root partition for the build environment, and 5 GB in your home folder for the source code and compilation results, and at least 4GB of memory. We do not recommend you do this on removable / usb based storage.
Setting up the environment is relatively straight forward, compiling can take several hours depending on hardware.
Commands starting with a $ are to be run on the host, commands starting with (jessie)# are to be run inside the schroot. Don't type the $ or (trusty)#.
Contents
Installing Schroot & Debbootstrap
Debian / Ubuntu / Mint Host
Install schroot and debootstrap.
$ sudo apt-get install schroot debootstrap
Gentoo Host
Add some groups Debian expects and install schroot and debootstrap from portage. Where sudo is used in this guide, su to root then run the command omitting 'sudo'.
# groupadd crontab # groupadd sudo # groupadd staff # emerge schroot debootstrap
Setup the Schroot
This guided uses a schroot to provide a static build environment that is separate from your running install, a Linux inside a Linux. Once set up this can be easily backed up and copied between machines.
Configure the schroot. Edit '/etc/schroot/schroot.conf' so it looks like the following, making sure to change YOUR_USER_NAME...
[jessie] description=Debian Jessie type=directory directory=/schroot/jessie users=YOUR_USER_NAME groups=sbuild root-groups=root personality=linux32
Make some folders..
$ sudo mkdir /schroot $ sudo mkdir /schroot/jessie
Ubuntu Trusty
We build using Debian Jessie, for fewer headaches you should too. There are other distributions you could use in your schroot, good luck!
$ sudo debootstrap --arch i386 trusty /schroot/jessie tuhttp://ftp.debian.org/debian
Enter the new schroot..
$ sudo schroot -c jessie -u root
If you have done everything right to this point your prompt will change to look something like the following, ignore any 'failed to change directory' warnings.
(trusty)root@tetsuo:/home/trinity#
Install Build Environment
Next we install a load of things needed to build the viewer including Linden Lab's Autobuild.
(trusty)# apt-get update (trusty)# apt-get install software-properties-common
This next bit is one long command, just copy and paste as provided, it will work fine.
(trusty)# apt-get install --install-recommends bison bzip2 cmake curl flex g++ m4 \ nano mercurial python python-dev python-pip libc6-dev libgl1-mesa-dev libglu1-mesa-dev \ libstdc++6 libxcursor-dev libX11-dev libxinerama-dev libxml2-dev libxrender-dev wget
Now Install Linden Lab's Autobuild system wide.
(trusty)#pip install 'hg+https://bitbucket.org/lindenlab/autobuild-1.0#egg=autobuild'
If all went to plan then you should be able to type #autobuild --version' and see the following.
(trusty)root@TETSUO:/home/trinity# autobuild --version autobuild 1.0
We're done here. Exit the schroot.
(trusty)# exit
Setting up
When you switch into a schroot the host OS home folder is fully accessible, for simplicity that's where we're going to viewer source.
$ cd $ mkdir ./SecondLife-Dev
Enter the schroot and fetch some source code (you could just as easily do this with tools installed on the host OS).
$ cd ~/SecondLife-Dev $ schroot -c trusty
If you have done everything correct you should be presented with something like the following.
(trusty)trinity@tetsuo:~/SecondLife-Dev$
Unlike previous versions of this guide we do not need to update cmake.
Catznip Source
We do not release source code for a viewer until we have released it to the public.
(trusty)$ cd ~/SecondLife-Dev
Fetch the source from our bitbucket repository. This may take some time ...
(trusty)$ hg clone http://hg.catznip.com/Catznip-R10
(trusty)$ cd ~/SecondLife-Dev/Catznip-R10
Update the tip (if you were to build without doing this you will get the base Linden viewer).
(squeeze)$ hg update tip
Compiling the Viewer
Enter the Schroot (if you aren't already from the steps above).
$ cd ~/SecondLife-Dev $ schroot -c trusty
Autobuild configure & build
Change to the source directory..
(trusty)$ cd ~/SecondLife-Dev/Catznip-R10
Run autobuild, setting the viewer channel to Catznip Homebrew will get you the homebrew branding, logos and start up screen when you're done (for R9 or later).
(trusty)$ autobuild configure -c ReleaseOS -- -DFMODEX:BOOL=OFF \ -DVIEWER_CHANNEL="\"Catznip Homebrew\"" -DGCC_DISABLE_FATAL_WARNINGS:BOOL=ON \ -DLL_TESTS:BOOL=OFF
There are a number of compilation options you are free to explore but that's beyond the scope of this document.
Compile the viewer .. depending on hardware this could take a significant amount of time (over an hour on an i5).
(trusty)$ autobuild build -c ReleaseOS --verbose
The build and all working files will be placed inside ~/SecondLife-Dev/Catznip-R12.2/build-linux-i686. This folder should be removed if you wish to run configure again or to save disk space on older source trees.
Running the Viewer
The completed viewer will be placed in ~/SecondLife-Dev/catznip-R12.2/build-linux-i686/newview and can be run in place without needing to install.
Exit from the schroot (or open a new terminal).
(trusty)$ exit
Change to the directory ...
$ cd ~/SecondLife-Dev/Catznip-R10/build-linux-i686/newview/packaged
.. and run. No installation or messing about required, menu entries will be created.
$ ./catznip
The viewer will have it's own configuration file ~/.catznip/user_settings/settings_homebrew.xml
Deep Notes
That's it, you have set up a build environment and built the viewer.
These instructions do not cover creating the FMOD / FMODEX packages so there will be no streaming audio. Instructions on how to create these packages yourself may follow ....
We are bound by the terms of the havok sub licence and as such can not provide libraries or instructions on how to build havok into the viewer. Mesh upload will not function and the pathfinding nav mesh will not be visible.
Configuration options to explore include -DCMAKE_CXX_FLAGS:STRING="\" ..... \"" and -DCMAKE_EXE_LINKER_FLAGS:STRING="\" .... \"".
To compile any changes you make to the source, you only have to run ../autobuild/bin/autobuild build -c ReleaseOS --verbose as detailed above.
If run out of the build folder the viewer XUI files will be loaded from ~/SecondLife-Dev/Catznip-R9/indra/newview/skins/default/ rather than those in location you're running the viewer from. Editing XUI files while running is a good source of crashes, so is messing up the XUI.