Difference between revisions of "User:Opensource Obscure/Compiling"

From Second Life Wiki
Jump to navigation Jump to search
m (ahem)
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[User:Opensource_Obscure|BACK to User:Opensource_Obscure]]
{{User:Opensource_Obscure/Quicklinks}}


== 2011 ==
This an incomplete, out-of-date, still possibly useful repository of instructions to build a Linux viewer from sources.. ''You're welcome to read this page, and you may even find it useful, but it's mostly a personal scrapbook page.''
* sudo apt-get *remove* ccache gcc-4.1
* sudo apt-get install cmake flex bison libglu1-mesa-dev libssl-dev libxrender-dev
* sudo apt-get install libogg-dev libpng12-dev libdbus-glib-1-dev libgtk2.0-dev
* sudo apt-get install python-pip
* sudo pip install autobuild
* sudo apt-get install mercurial
* hg clone https://bitbucket.org/merov_linden/viewer-autobuild2010
* cd viewer-autobuild2010
* ...
* autobuild build -c RelWithDebInfo
* ...


== FOLLOWING STUFF MAY BE OUT OF DATE ==
== Overview ==
{| class="lltable" border=1


|-
| ''RESULTS''
| [http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/viewer-development/latest.html Viewer dev]
| '''[http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/snowstorm_viewer-development/latest.html Snowstorm]'''
| [http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/merov_viewer_development_features/arch/Linux/latest.html Linux Merov Features]
|
| '''[http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/mesh-development/latest.html Mesh dev]'''
|-
| ''DOWNLOAD''
| [http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/viewer-development/arch/Linux/quicklink.html Linux Viewer dev]
| '''[http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/snowstorm_viewer-development/arch/Linux/quicklink.html Linux Snowstorm]'''
| [http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/merov-viewer-development-features/arch/Linux/quicklink.html Linux Merov Features]
| Mesh
| [http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/mesh_development/arch/Linux/quicklink.html Linux Mesh dev]
|}


== Pagine utili in questo wiki ==
* [[Compiling_the_viewer_(Linux)]]
* [[Compiling_the_viewer_(Linux)]]
* [[Source_downloads]]
* [[Build_Viewer_With_Autobuild]]
* [[Subversion]]
* [[Get_source_and_compile]]
* [[Viewer source]]
* [[:Category:Compiling_viewer]]
* [[Viewer Architecture]] e relativi link
* [[Downloading_test_builds]]
* [[Adding_a_menu_item]]
* [[Project_Snowstorm]]
* [[UI_Widgets]]
* [[Viewer Architecture]]
* [[UI_Floaters]]
* [[Automated_Build_System]]
* [[Adding_a_dialog]]
* [[Client_parameters]]
* [[User:Dzonatas_Sol]] & [[User:Dzonatas_Sol/Cross_compiling_the_viewer_(i686-mingw32)]]
* [[Viewerhelp:Active Releases]]


== Dipendenze ==
== Dipendenze ==
Ho disinstallato ccache e gcc-4.1.
sudo apt-get install cmake flex bison build-essential python libx11-dev zlib1g-dev libssl-dev mesa-common-dev libglu1-mesa-dev libc6-dev libstdc++6 libxrender-dev
sudo apt-get install libogg-dev libpng12-dev libdbus-glib-1-dev libgtk2.0-dev
sudo apt-get install mercurial python-pip
sudo pip install autobuild


sudo apt-get install build-essential cmake bison flex python gcc-4.1 g++-4.1 libx11-dev zlib1g-dev libssl-dev mesa-common-dev libglu1-mesa-dev libc6-dev libstdc++6 libxrender-dev
== Compilare i sorgenti ==


=== gcc / Ubuntu ===
'''hg clone''' ''https://bitbucket.org/merov_linden/viewer-autobuild2010''
cd ''viewer-autobuild2010''
'''autobuild build -c RelWithDebInfoOS'''
 
Nota su ''hg clone''
* once you have a local clone, you should keep that repository, and next time, just use pull. this will just download the latest changes, ie. from the last time you cloned or pulled. and then issue an update: basically, you would issue this command:
hg pull -u
* to overcome the initial problem of cloning over a slow network, you could clone parts of the repository as well. For instance, if the remote repository consists of 1000 changesets, you can use this command:
hg clone URL . -r 250
* with the dot, you say: clone into the current directory. Without it, mercurial might create a directory for your clone
* this will clone 250 changesets, then you can pull in batches as well: hg pull -r 500, hg pull -r 750 and then hg pull -u
this might overcome the timeout problem, otherwise you're just going to have to retry
* once you have the local clone, a pull should take far less time, and if a pull times out, just retry the pull, it will still only have to download new changesets, not the whole repository
 
=== Build Download Permalinks ===
 
Informazioni prese da [[Automated_Build_System]].
 
* Links to the latest build results:
** <code>${S3PUBLIC_URL}/${S3PREFIX}/repo/${basename}/latest.html</code>
** Example: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/snowstorm_viewer-development/latest.html
* Links to the latest platform results:
** <code>${S3PUBLIC_URL}/${S3PREFIX}/repo/${basename}/arch/${arch}/partial.html</code>
** Example: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/snowstorm_viewer-development/arch/Linux/partial.html
* Links to the latest installer (viewer builds only):
** <code>${S3PUBLIC_URL}/${S3PREFIX}/repo/${basename}/arch/${arch}/quicklink.html</code>
** Example: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/snowstorm_viewer-development/arch/Linux/quicklink.html
* Links to a specific installer identified by build number (viewer only)
** <code>${S3PUBLIC_URL}/${S3PREFIX}/repo/${basename}/arch/${arch}/quicklink.html</code>
** Example: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/mesh-dev-to-v-d/rev/223501/arch/Linux/quicklink.html
 
== gcc / Ubuntu ==
 
'''''informazioni probabilmente obsolete'''''


Il gcc che c'è di default nelle versioni recenti di Ubuntu non va bene, si deve usare invece la versione 4.1. Ecco come mantenere entrambe le versioni di gcc installate nel sistema, scegliendo con ''update-alternatives --config gcc'' quale versione usare effettivamente quando viene chiamato gcc:
Il gcc che c'è di default nelle versioni recenti di Ubuntu non va bene, si deve usare invece la versione 4.1. Ecco come mantenere entrambe le versioni di gcc installate nel sistema, scegliendo con ''update-alternatives --config gcc'' quale versione usare effettivamente quando viene chiamato gcc:
Line 50: Line 92:
D'ora in poi il sistema userà la versione 4.1 di gcc. Ripetere l'ultimo passo se c'è bisogno di usare la versione più recente di gcc.
D'ora in poi il sistema userà la versione 4.1 di gcc. Ripetere l'ultimo passo se c'è bisogno di usare la versione più recente di gcc.


== Preparazione dei Build Scripts ==
== Applicare una patch ==
 
cd linden/indra/
./develop.py configure
 
 
== FMOD ==
 
* necessario a meno di disabilitarlo esplicitamente
* da fare dopo il primo ''./develop.py configure''
* le istruzioni seguenti presuppongono che la directory di fmod sia posta nella stessa directory che contiene linden/indra/, e che ci si trovi in quest'ultima
 
cd ../../fmodapi375linux/ && cp api/inc/* ../linden/libraries/i686-linux/include/ && cp api/libfmod-3.75.so ../linden/libraries/i686-linux/lib_release_client/ && cp api/libfmod-3.75.so ../linden/libraries/i686-linux/lib_release/ && cp api/libfmod-3.75.so ../linden/libraries/i686-linux/lib_debug/ && cd ../linden/indra
 
oppure
cd ../../fmodapi375linux/ \
cp api/inc/* ../linden/libraries/i686-linux/include/ \
cp api/libfmod-3.75.so ../linden/libraries/i686-linux/lib_release_client/ \
cp api/libfmod-3.75.so ../linden/libraries/i686-linux/lib_release/ \
cp api/libfmod-3.75.so ../linden/libraries/i686-linux/lib_debug/ \
cd ../linden/indra/
 
 
== Compilare as usual ==
 
cd indra/
./develop.py build
o
cd indra/viewer-linux-i686/
make
 
 
== Patches, personalizzazione interfaccia, menu etc. ==
 
=== Applicare una patch ===


Esempio:
Esempio:
  user@box:~/snowglobe/linden$ '''patch -p0 <''' SNOW-247_translation_breaks_chat_bubbles.diff  
  user@box:~/snowglobe/linden$ '''patch -p0 <''' SNOW-247_translation_breaks_chat_bubbles.diff  


=== Cambio di Shortcut per poter nascondere la GUI ===
== SpaceNavigator ==


Modificare indra/newview/llviewermenu.cpp
Nota: Non funziona più con i kernel recenti. Con Kirstens funziona.
 
=== altro ===
(Non sicuro) - viewer-linux-i686-relwithdebinfo/CMakeCache.txt --> per sostituire "(Developer)" nel floater '''About Second Life'''
 
== Build Types ==
 
* Usare directory separate per build types diversi
* RelWithDebInfo e' il default
* Sembra che [https://lists.secondlife.com/pipermail/sldev/2009-March/013151.html non valga la pena] di compilare versioni Debug
Debug:
./develop.py -t Debug configure
./develop.py -t Debug build
Release:
./develop.py -t Release configure
./develop.py -t Release build
 
 
== SpaceNavigator ==


Va inizialmente creato (una tantum) il file /etc/udev/rules.d/41-spacenavigator.rules con questo contenuto (forse basta la terza riga):
Va inizialmente creato (una tantum) il file /etc/udev/rules.d/41-spacenavigator.rules con questo contenuto (forse basta la terza riga):
Line 116: Line 106:
  KERNEL=="event[0-9]*", SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c626", SYMLINK+="input/spacenavigator", GROUP="plugdev"
  KERNEL=="event[0-9]*", SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c626", SYMLINK+="input/spacenavigator", GROUP="plugdev"


Per i viewer fino alla 1.22:
== Old stuff ==
* copiare libndofdev.a in libraries/i686-linux/lib_release_client/
* sostituire ''DARWIN'' con ''DARWIN OR LINUX'' in indra/cmake/NDOF.cmake
 
== Ombre / Shadows ==  
 
Il ramo di sviluppo da usare e' render-pipeline.
([https://lists.secondlife.com/pipermail/sldev/2009-March/012999.html vedi qui]) - Open up the debug settings, and search for
RenderShadowClipPlanes(?)
Put in values like
50 150 300
and you will find the distance at which shadows show to be increased, be aware tho that they might be a little more rough up close. The other settings I tinkered with, but in the end left at the default...tho you can also increase the amount of blur passes (beware FPS hits), and the strength of the blur and gaussian.
 


== Pacchetti da installare ==
Prob. obsolete: [[User:Opensource_Obscure/Compiling/FMOD]]


apt-get install cmake flex bison libglu1-mesa-dev libssl-dev
=== Come trovare le dipendenze richieste ===
 
([https://lists.secondlife.com/pipermail/sldev/2009-March/013050.html vedi qui]) - ESEMPIO con omvviewer:
Come trovare le dipendenze richieste ([https://lists.secondlife.com/pipermail/sldev/2009-March/013050.html vedi qui]) - ESEMPIO con omvviewer:
  omvviewer/indra/build/newview>ldd ./omvviewer
  omvviewer/indra/build/newview>ldd ./omvviewer


== Errori ==
=== llcubemap / typedef struct Vertex ===
[ 31%] Building CXX object llrender/CMakeFiles/llrender.dir/llcubemap.o
cc1plus: warnings being treated as errors
In file included from ;)/sources/1-21-r99587/linden/indra/llrender/llcubemap.cpp:44:
;)/sources/1-21-r99587/linden/indra/llrender/llrender.h:222: error: ‘typedef’ was ignored in this declaration
make[2]: *** [llrender/CMakeFiles/llrender.dir/llcubemap.o] Error 1
make[1]: *** [llrender/CMakeFiles/llrender.dir/all] Error 2
make: *** [all] Error 2
[https://lists.secondlife.com/pipermail/sldev/2008-August/011428.html Solution by Robin Cornelius]
=== format not a string literal and no format arguments ===
Se si ottiene questo errore, fare una delle due:
* sostituire in indra/linux_crash_logger/llcrashloggerlinux.cpp :
dialog_text);
con
"%s", dialog_text);
* In indra/cmake/00-Common.cmake > Line 183, commentare cosi' ([https://lists.secondlife.com/pipermail/sldev/2009-March/013048.html vedi qui] - [https://lists.secondlife.com/pipermail/sldev/2009-March/013049.html spiegazione]):
set(GCC_WARNINGS "${GCC_WARNINGS} -Werror")


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

Latest revision as of 15:16, 20 August 2011

User page - JIRA - Interests - Groups - LSL - Places - Stores - Translations - other pages



This an incomplete, out-of-date, still possibly useful repository of instructions to build a Linux viewer from sources.. You're welcome to read this page, and you may even find it useful, but it's mostly a personal scrapbook page.

Overview

RESULTS Viewer dev Snowstorm Linux Merov Features Mesh dev
DOWNLOAD Linux Viewer dev Linux Snowstorm Linux Merov Features Mesh Linux Mesh dev

Dipendenze

Ho disinstallato ccache e gcc-4.1.

sudo apt-get install cmake flex bison build-essential python libx11-dev zlib1g-dev libssl-dev mesa-common-dev libglu1-mesa-dev libc6-dev libstdc++6 libxrender-dev
sudo apt-get install libogg-dev libpng12-dev libdbus-glib-1-dev libgtk2.0-dev
sudo apt-get install mercurial python-pip
sudo pip install autobuild

Compilare i sorgenti

hg clone https://bitbucket.org/merov_linden/viewer-autobuild2010
cd viewer-autobuild2010
autobuild build -c RelWithDebInfoOS

Nota su hg clone

  • once you have a local clone, you should keep that repository, and next time, just use pull. this will just download the latest changes, ie. from the last time you cloned or pulled. and then issue an update: basically, you would issue this command:
hg pull -u
  • to overcome the initial problem of cloning over a slow network, you could clone parts of the repository as well. For instance, if the remote repository consists of 1000 changesets, you can use this command:
hg clone URL . -r 250
  • with the dot, you say: clone into the current directory. Without it, mercurial might create a directory for your clone
  • this will clone 250 changesets, then you can pull in batches as well: hg pull -r 500, hg pull -r 750 and then hg pull -u

this might overcome the timeout problem, otherwise you're just going to have to retry

  • once you have the local clone, a pull should take far less time, and if a pull times out, just retry the pull, it will still only have to download new changesets, not the whole repository

Build Download Permalinks

Informazioni prese da Automated_Build_System.

gcc / Ubuntu

informazioni probabilmente obsolete

Il gcc che c'è di default nelle versioni recenti di Ubuntu non va bene, si deve usare invece la versione 4.1. Ecco come mantenere entrambe le versioni di gcc installate nel sistema, scegliendo con update-alternatives --config gcc quale versione usare effettivamente quando viene chiamato gcc:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.1 41 --slave /usr/bin/g++ g++ /usr/bin/g++-4.1 --slave /usr/bin/gcov gcov /usr/bin/gcov-4.1
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
sudo update-alternatives --config gcc

a questo punto, selezionare gcc-4.1:

------------------------------------------------------------
* 0            /usr/bin/gcc-4.4   44        modalità automatica
  1            /usr/bin/gcc-4.1   41        modalità manuale
  2            /usr/bin/gcc-4.4   44        modalità manuale
Premere Invio per mantenere il valore predefinito[*] o digitare il numero della selezione:1
update-alternatives: viene usato /usr/bin/gcc-4.1 per fornire /usr/bin/gcc (gcc) in modalità manuale.

D'ora in poi il sistema userà la versione 4.1 di gcc. Ripetere l'ultimo passo se c'è bisogno di usare la versione più recente di gcc.

Applicare una patch

Esempio:

user@box:~/snowglobe/linden$ patch -p0 < SNOW-247_translation_breaks_chat_bubbles.diff 

SpaceNavigator

Nota: Non funziona più con i kernel recenti. Con Kirstens funziona.

Va inizialmente creato (una tantum) il file /etc/udev/rules.d/41-spacenavigator.rules con questo contenuto (forse basta la terza riga):

KERNEL=="event[0-9]*", SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c603", SYMLINK+="input/spacemouse", GROUP="plugdev"
KERNEL=="event[0-9]*", SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c623", SYMLINK+="input/spacetraveler", GROUP="plugdev"
KERNEL=="event[0-9]*", SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c626", SYMLINK+="input/spacenavigator", GROUP="plugdev"

Old stuff

Prob. obsolete: User:Opensource_Obscure/Compiling/FMOD

Come trovare le dipendenze richieste

(vedi qui) - ESEMPIO con omvviewer:

omvviewer/indra/build/newview>ldd ./omvviewer