https://wiki.secondlife.com/w/api.php?action=feedcontributions&user=Jenn+Linden&feedformat=atomSecond Life Wiki - User contributions [en]2024-03-29T13:45:48ZUser contributionsMediaWiki 1.36.1https://wiki.secondlife.com/w/index.php?title=InventoryBetaTest&diff=1162454InventoryBetaTest2012-02-03T19:39:48Z<p>Jenn Linden: </p>
<hr />
<div>= Overview =<br />
We are performing a functional test of some Inventory infrastructure changes on ADITI between Thursday 11/10 and Wednesday 11/16, 2011. We can use as many willing participants as we can get.<br />
<br />
= Details =<br />
* Who: You!<br />
* What: A functional test of Inventory changes<br />
* Where: ADITI, the preview grid.<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* When: Ongoing<br />
* Why: To help make Inventory more reliable and faster<br />
* How: However you can.<br />
<br />
= How To Help =<br />
Testing will be as simple as rezzing objects and transferring them between yourselves and others by any method you can imagine.<br />
* '''Step 1''': Log into ADITI with any Viewer<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* '''Step 2''': Teleport to a random region chosen below:<br />
* '''Step 3''': Start performing various inventory operations.<br />
** Derez an object.<br />
** Remove an attachment such that it tries but cannot rez and must be returned.<br />
** Create a landmark.<br />
** Create an inventory link or outfit.<br />
** Create an inventory item.<br />
** Create a notecard.<br />
** Copy a notecard.<br />
** Create a notecard with contained objects<br />
** Add a calling card.<br />
** Buy an object in-world.<br />
** Give inventory (various object types) from a script to a user.<br />
** Give inventory (various object types) from a user to another user.<br />
** Move objects back and forth between inventory and an inworld object (as a container for those objects) <br />
* '''Step 4''': File JIRAs for any issues you find using project '''SVC''' and component '''"Inventory"'''<br />
<br />
== Regions ==<br />
* GC Test 2: secondlife://Aditi/secondlife/GC%20Test%202/128/128/26<br />
* GC Test 3: secondlife://Aditi/secondlife/GC%20Test%203/128/128/26<br />
* GC Test 8: secondlife://Aditi/secondlife/GC%20Test%208/128/128/26<br />
* GC Test 9: secondlife://Aditi/secondlife/GC%20Test%209/128/128/26<br />
== Special Testing Parcels ==<br />
* We have some special parcels set up to help facilitate testing needs. <br />
* No rez, no object entry parcel<br />
** Red color<br />
** secondlife://Aditi/secondlife/GC%20Test%209/24/225/26<br />
* No rez, parcel<br />
** Yellow color<br />
** secondlife://Aditi/secondlife/GC%20Test%209/24/194/26<br />
* No object entry parcel<br />
** Blue color<br />
** secondlife://Aditi/secondlife/GC%20Test%209/24/148/26<br />
* Fast autoreturn<br />
** Green color<br />
** secondlife://Aditi/secondlife/GC%20Test%209/24/111/26</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=InventoryBetaTest&diff=1162453InventoryBetaTest2012-02-03T19:39:38Z<p>Jenn Linden: </p>
<hr />
<div>= Overview =<br />
We are performing a functional test of some Inventory infrastructure changes on ADITI between Thursday 11/10 and Wednesday 11/16, 2011. We can use as many willing participants as we can get.<br />
<br />
= Details =<br />
* Who: You!<br />
* What: A functional test of Inventory changes<br />
* Where: ADITI, the preview grid.<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* When: '''Ongoing''' <br />
* Why: To help make Inventory more reliable and faster<br />
* How: However you can.<br />
<br />
= How To Help =<br />
Testing will be as simple as rezzing objects and transferring them between yourselves and others by any method you can imagine.<br />
* '''Step 1''': Log into ADITI with any Viewer<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* '''Step 2''': Teleport to a random region chosen below:<br />
* '''Step 3''': Start performing various inventory operations.<br />
** Derez an object.<br />
** Remove an attachment such that it tries but cannot rez and must be returned.<br />
** Create a landmark.<br />
** Create an inventory link or outfit.<br />
** Create an inventory item.<br />
** Create a notecard.<br />
** Copy a notecard.<br />
** Create a notecard with contained objects<br />
** Add a calling card.<br />
** Buy an object in-world.<br />
** Give inventory (various object types) from a script to a user.<br />
** Give inventory (various object types) from a user to another user.<br />
** Move objects back and forth between inventory and an inworld object (as a container for those objects) <br />
* '''Step 4''': File JIRAs for any issues you find using project '''SVC''' and component '''"Inventory"'''<br />
<br />
== Regions ==<br />
* GC Test 2: secondlife://Aditi/secondlife/GC%20Test%202/128/128/26<br />
* GC Test 3: secondlife://Aditi/secondlife/GC%20Test%203/128/128/26<br />
* GC Test 8: secondlife://Aditi/secondlife/GC%20Test%208/128/128/26<br />
* GC Test 9: secondlife://Aditi/secondlife/GC%20Test%209/128/128/26<br />
== Special Testing Parcels ==<br />
* We have some special parcels set up to help facilitate testing needs. <br />
* No rez, no object entry parcel<br />
** Red color<br />
** secondlife://Aditi/secondlife/GC%20Test%209/24/225/26<br />
* No rez, parcel<br />
** Yellow color<br />
** secondlife://Aditi/secondlife/GC%20Test%209/24/194/26<br />
* No object entry parcel<br />
** Blue color<br />
** secondlife://Aditi/secondlife/GC%20Test%209/24/148/26<br />
* Fast autoreturn<br />
** Green color<br />
** secondlife://Aditi/secondlife/GC%20Test%209/24/111/26</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=InventoryBetaTest&diff=1157629InventoryBetaTest2011-11-10T23:40:22Z<p>Jenn Linden: </p>
<hr />
<div>= Overview =<br />
We are performing a functional test of some Inventory infrastructure changes on ADITI between Thursday 11/10 and Wednesday 11/16, 2011. We can use as many willing participants as we can get.<br />
<br />
= Details =<br />
* Who: You!<br />
* What: A functional test of Inventory changes<br />
* Where: ADITI, the preview grid.<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* When: '''Thursday 11/10 to Wednesday 11/16 2011''' <br />
* Why: To help make Inventory more reliable and faster<br />
* How: However you can.<br />
<br />
= How To Help =<br />
Testing will be as simple as rezzing objects and transferring them between yourselves and others by any method you can imagine.<br />
* '''Step 1''': Log into ADITI with any Viewer<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* '''Step 2''': Teleport to a random region chosen below:<br />
* '''Step 3''': Start performing various inventory operations.<br />
** Derez an object.<br />
** Remove an attachment such that it tries but cannot rez and must be returned.<br />
** Create a landmark.<br />
** Create an inventory link or outfit.<br />
** Create an inventory item.<br />
** Create a notecard.<br />
** Copy a notecard.<br />
** Create a notecard with contained objects<br />
** Add a calling card.<br />
** Buy an object in-world.<br />
** Give inventory (various object types) from a script to a user.<br />
** Give inventory (various object types) from a user to another user.<br />
** Move objects back and forth between inventory and an inworld object (as a container for those objects) <br />
* '''Step 4''': File JIRAs for any issues you find using project SVC and component "Inventory"<br />
<br />
== Regions ==<br />
* GC Test 2: secondlife://Aditi/secondlife/GC%20Test%202/128/128/26<br />
* GC Test 3: secondlife://Aditi/secondlife/GC%20Test%203/128/128/26<br />
* GC Test 8: secondlife://Aditi/secondlife/GC%20Test%208/128/128/26<br />
* GC Test 9: secondlife://Aditi/secondlife/GC%20Test%209/128/128/26</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=InventoryBetaTest&diff=1157625InventoryBetaTest2011-11-10T23:19:58Z<p>Jenn Linden: </p>
<hr />
<div>= Overview =<br />
We are performing a functional test of some Inventory infrastructure changes on ADITI between Thursday 11/10 and Wednesday 11/16, 2011. We can use as many willing participants as we can get.<br />
<br />
= Details =<br />
* Who: You!<br />
* What: A functional test of Inventory changes<br />
* Where: ADITI, the preview grid.<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* When: '''Thursday 11/10 to Wednesday 11/16 2011''' <br />
* Why: To help make Inventory more reliable and faster<br />
* How: However you can.<br />
<br />
= How To Help =<br />
Testing will be as simple as rezzing objects and transferring them between yourselves and others by any method you can imagine.<br />
* '''Step 1''': Log into ADITI with any Viewer<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* '''Step 2''': Teleport to a random region chosen below:<br />
* '''Step 3''': Start performing various inventory operations.<br />
** Derez an object.<br />
** Remove an attachment such that it tries but cannot rez and must be returned.<br />
** Create a landmark.<br />
** Create an inventory link or outfit.<br />
** Create an inventory item.<br />
** Create a notecard.<br />
** Copy a notecard.<br />
** Create a notecard with contained objects<br />
** Add a calling card.<br />
** Buy an object in-world.<br />
** Give inventory (various object types) from a script to a user.<br />
** Give inventory (various object types) from a user to another user.<br />
** Move objects back and forth between inventory and an inworld object (as a container for those objects) <br />
<br />
== Regions ==<br />
* GC Test 2: secondlife://Aditi/secondlife/GC%20Test%202/128/128/26<br />
* GC Test 3: secondlife://Aditi/secondlife/GC%20Test%203/128/128/26<br />
* GC Test 8: secondlife://Aditi/secondlife/GC%20Test%208/128/128/26<br />
* GC Test 9: secondlife://Aditi/secondlife/GC%20Test%209/128/128/26</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=InventoryBetaTest&diff=1157616InventoryBetaTest2011-11-10T22:21:11Z<p>Jenn Linden: </p>
<hr />
<div>= Overview =<br />
We are performing a functional test of some Inventory infrastructure changes on ADITI between Thursday 11/10 and Wednesday 11/16, 2011. We can use as many willing participants as we can get.<br />
<br />
= Details =<br />
* Who: You!<br />
* What: A functional test of Inventory changes<br />
* Where: ADITI, the preview grid.<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* When: '''Thursday 11/10 to Wednesday 11/16 2011''' <br />
* Why: To help make Inventory more reliable and faster<br />
* How: However you can.<br />
<br />
= How To Help =<br />
Testing will be as simple as rezzing objects and transferring them between yourselves and others by any method you can imagine.<br />
* '''Step 1''': Log into ADITI with any Viewer<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* '''Step 2''': Teleport to a random region chosen below:<br />
* '''Step 3''': Join the group "Second Life Beta"<br />
** secondlife://Aditi/app/group/19657888-576f-83e9-2580-7c3da7c0e4ca/about<br />
** There are group join objects in each region as well<br />
* '''Step 4''': Start performing various inventory operations.<br />
<br />
== Regions ==<br />
* GC Test 2: secondlife://Aditi/secondlife/GC%20Test%209/128/128/26<br />
* GC Test 3: secondlife://Aditi/secondlife/GC%20Test%203/128/128/26<br />
* GC Test 8: secondlife://Aditi/secondlife/GC%20Test%208/128/128/26<br />
* GC Test 9: secondlife://Aditi/secondlife/GC%20Test%209/128/128/26</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=InventoryBetaTest&diff=1157615InventoryBetaTest2011-11-10T21:56:40Z<p>Jenn Linden: </p>
<hr />
<div>= Overview =<br />
We are performing a functional test of some Inventory infrastructure changes on ADITI between Thursday 11/10 and Wednesday 11/16, 2011. We can use as many willing participants as we can get.<br />
<br />
= Details =<br />
* Who: You!<br />
* What: A functional test of Inventory changes<br />
* Where: ADITI, the preview grid.<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* When: '''Thursday 11/10 to Wednesday 11/16 2011''' <br />
* Why: To help make Inventory more reliable and faster<br />
* How: However you can.<br />
<br />
= How To Help =<br />
Testing will be as simple as rezzing objects and transferring them between yourselves and others by any method you can imagine.<br />
* '''Step 1''': Log into ADITI with any Viewer<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* '''Step 2''': Teleport to a random region chosen below:<br />
* '''Step 3''': Join the group "Second Life Beta"<br />
** secondlife://Aditi/app/group/19657888-576f-83e9-2580-7c3da7c0e4ca/about<br />
** There are group join objects in each region as well<br />
* '''Step 4''': Start performing various inventory operations.<br />
* Additional instructions will be sent via god shout.<br />
<br />
== Regions ==<br />
* GC Test 2: secondlife://Aditi/secondlife/GC%20Test%209/128/128/26<br />
* GC Test 3: secondlife://Aditi/secondlife/GC%20Test%203/128/128/26<br />
* GC Test 8: secondlife://Aditi/secondlife/GC%20Test%208/128/128/26<br />
* GC Test 9: secondlife://Aditi/secondlife/GC%20Test%209/128/128/26</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=InventoryBetaTest&diff=1157614InventoryBetaTest2011-11-10T21:56:02Z<p>Jenn Linden: </p>
<hr />
<div>= Overview =<br />
We are performing a functional test of some Inventory infrastructure changes on ADITI between Thursday 11/10 and Wednesday 11/16, 2011. We can use as many willing participants as we can get.<br />
<br />
= Details =<br />
* Who: You!<br />
* What: A functional test of Inventory changes<br />
* Where: ADITI, the preview grid.<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* When: '''Thursday 11/10 to Wednesday 11/16 2011''' <br />
* Why: To help make Inventory more reliable and faster<br />
* How: However you can.<br />
<br />
= How To Help =<br />
Testing will be as simple as rezzing objects and transferring them between yourselves and others by any method you can imagine.<br />
* '''Step 1''': Log into ADITI with any Viewer<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* '''Step 2''': Teleport to a random region chosen below:<br />
** If your region is full or crowded we encourage you to spread out. We need each region to be as full as possible.<br />
* '''Step 3''': Join the group "Second Life Beta"<br />
** secondlife://Aditi/app/group/19657888-576f-83e9-2580-7c3da7c0e4ca/about<br />
** There are group join objects in each region as well<br />
* '''Step 4''': Start performing various inventory operations.<br />
* Additional instructions will be sent via god shout.<br />
<br />
== Regions ==<br />
* GC Test 2: secondlife://Aditi/secondlife/GC%20Test%209/128/128/26<br />
* GC Test 3: secondlife://Aditi/secondlife/GC%20Test%203/128/128/26<br />
* GC Test 8: secondlife://Aditi/secondlife/GC%20Test%208/128/128/26<br />
* GC Test 9: secondlife://Aditi/secondlife/GC%20Test%209/128/128/26</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=InventoryBetaTest&diff=1157613InventoryBetaTest2011-11-10T21:55:16Z<p>Jenn Linden: </p>
<hr />
<div>= Overview =<br />
We are performing a functional test of some Inventory infrastructure changes on ADITI between Thursday 11/10 and Wednesday 11/16, 2011. We can use as many willing participants as we can get.<br />
<br />
= Details =<br />
* Who: You!<br />
* What: A functional test of Inventory changes<br />
* Where: ADITI, the preview grid.<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* When: '''Thursday 11/10 to Wednesday 11/16 2011''' <br />
* Why: To help make Inventory more reliable and faster<br />
* How: However you can.<br />
<br />
= How To Help =<br />
Testing will be as simple as rezzing objects and transferring them between yourselves by any method you can imagine.<br />
* '''Step 1''': Log into ADITI with any Viewer<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* '''Step 2''': Teleport to a random region chosen below:<br />
** If your region is full or crowded we encourage you to spread out. We need each region to be as full as possible.<br />
* '''Step 3''': Join the group "Second Life Beta"<br />
** secondlife://Aditi/app/group/19657888-576f-83e9-2580-7c3da7c0e4ca/about<br />
** There are group join objects in each region as well<br />
* '''Step 4''': Start performing various inventory operations.<br />
* Additional instructions will be sent via god shout.<br />
<br />
== Regions ==<br />
* GC Test 2: secondlife://Aditi/secondlife/GC%20Test%209/128/128/26<br />
* GC Test 3: secondlife://Aditi/secondlife/GC%20Test%203/128/128/26<br />
* GC Test 8: secondlife://Aditi/secondlife/GC%20Test%208/128/128/26<br />
* GC Test 9: secondlife://Aditi/secondlife/GC%20Test%209/128/128/26</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=InventoryBetaTest&diff=1157605InventoryBetaTest2011-11-10T20:40:28Z<p>Jenn Linden: Created page with "= Overview = We are performing a functional test of some Inventory infrastructure changes on ADITI between Thursday 11/10 and Wednesday 11/16. We can use as many willing particip…"</p>
<hr />
<div>= Overview =<br />
We are performing a functional test of some Inventory infrastructure changes on ADITI between Thursday 11/10 and Wednesday 11/16. We can use as many willing participants as we can get.<br />
<br />
= Details =<br />
* Who: You!<br />
* What: A functional test of Inventory changes<br />
* Where: ADITI, the preview grid.<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* When: '''Thursday 11/10 to Wednesday 11/16 2011''' <br />
* Why: To help make Inventory more reliable and faster<br />
* How: However you can.<br />
<br />
= How To Help =<br />
Testing will be as simple as rezzing objects and transferring them between yourselves by any method you can imagine.<br />
* '''Step 1''': Log into ADITI with any Viewer<br />
** Instructions for accessing ADITI are here: [[Preview Grid#How do I log in to Aditi?]]<br />
* '''Step 2''': Teleport to a random region chosen below:<br />
** If your region is full or crowded we encourage you to spread out. We need each region to be as full as possible.<br />
* '''Step 3''': Join the group "Second Life Beta"<br />
** secondlife://Aditi/app/group/19657888-576f-83e9-2580-7c3da7c0e4ca/about<br />
** There are group join objects in each region as well<br />
* '''Step 4''': Start performing various inventory operations.<br />
* Additional instructions will be sent via god shout.<br />
<br />
== Regions ==<br />
* GC Test 2: secondlife://Aditi/secondlife/GC%20Test%209/128/128/26<br />
* GC Test 3: secondlife://Aditi/secondlife/GC%20Test%203/128/128/26<br />
* GC Test 8: secondlife://Aditi/secondlife/GC%20Test%208/128/128/26<br />
* GC Test 9: secondlife://Aditi/secondlife/GC%20Test%209/128/128/26</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Viewer_2_Microsoft_Windows_Builds&diff=1151677Viewer 2 Microsoft Windows Builds2011-08-18T23:26:19Z<p>Jenn Linden: Undo revision 1151613 by Jenn Linden (Talk) - will attempt to do this more correctly, preserving history etc. in new location</p>
<hr />
<div>{{multi-lang}}<br />
{{CompileNav}} <br />
<br />
Philosophy: to keep it brief, this page should only include steps we KNOW ARE NEEDED, not random hints. Extra details or open issues can go on the talk page.<br />
<br />
{{KBnote|Following this recipe will probably take 6 to 12 hours of wall-clock time, and 2 to 6 hours of your time, if you're starting from a fresh Windows XP/Vista/7 system.}}<br />
<br />
== Establish your programming environment ==<br />
<br />
This is needed for compiling any viewer based on the LL open source code and only needs to be done once.<br />
<br />
=== Install and update Visual Studio and SDKs ===<br />
<br />
# Install [http://www.microsoft.com/express/download/ Visual Studio 2010] (Express is okay)<br />
#* If you installed VS2010 Express also install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84&displaylang=en Microsoft Visual C++ 2010 Redistributable Package] or [http://www.microsoft.com/download/en/confirmation.aspx?id=14632 64-bit Windows] version.<br />
# Install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=35aeda01-421d-4ba5-b44b-543dc8c33a20 Windows SDK for Windows 7 and .NET Framework 4] (ISO) or [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6B6C21D2-2006-4AFA-9702-529FA782D63B Windows SDK for Windows 7 and .NET Framework 4] (Web Install)<br />
# Install [http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba DirectX SDK (June 2010)]<br />
# Run [http://www.update.microsoft.com/microsoftupdate/v6 Microsoft Update], and keep running it until no updates are needed. This may take 6~8 iterations on older versions of windows.<br />
#* For Windows Vista and Windows 7, you need to select "Get updates from other Microsoft products" to get the updates for Visual Studio. <br />
#* For Windows XP, use the provided link above. The Windows Update menu item on your computer is not the correct updater to use.<br />
#* During the update cycles make sure you have picked up Microsoft Visual Studio 2010 Service Pack 1 [http://go.microsoft.com/fwlink/?LinkId=210710 (ISO)] or [http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=75568aa6-8107-475d-948a-ef22627e57a5 (Web Install)]<br />
<br />
=== Install required development tools ===<br />
<br />
{{KBnote|The order of the following installations should not matter.}}<br />
{{KBnote|If the installer for a particular package does not update your PATH environment variable you will have to do this manually.}}<br />
<br />
# '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])<br />
#* This should be version 2.8.4 (or above in the 2.8.x series).<br />
#*Add the <code>\bin</code> directory to your path.<br />
# '''Python''' (either [http://www.python.org/download/ Standard Python] or [http://www.activestate.com/activepython/downloads ActivePython])<br />
#* Version 2.7.1 works with the build scripts.<br />
# '''Mercurial''' (either [http://tortoisehg.bitbucket.org/ TortoiseHg] or [http://mercurial.selenic.com/ Mercurial Hg])<br />
# '''Cygwin''' ([http://www.cygwin.com/ download Cygwin])<br />
#* When you run the cygwin setup utility make sure you have selected to install '''unzip''' (under "Archives"), '''bison''', '''flex''', '''patchutils''' (all located under "devel"), and '''curl''' (under "Web"), which are not part of the default install. Do not install Cygwin Python or Mercurial. You won't need to use the Cygwin shell for anything.<br />
#*Add the <code>cygwin\bin</code> directory to the '''very end''' of your path and make sure it stays that way.<br />
<br />
=== Install optional development tools ===<br />
<br />
# [http://code.google.com/p/unsis/downloads/list Unicode NSIS (Nullsoft Scriptable Install System)]<br />
#* This is the package installer used to build <code>Second_Life_<version-code>_LindenDeveloper_Setup.exe</code>. You only need this package if you are going to distribute the viewer you compile or if you want to install it locally.<br />
#: In the [[#Configuring_the_Viewer|Configure VS2010 step]] below you will need to add a line in the '''Executable Directories''' section:<br />
#:* 64 bit systems use <code>%ProgramFiles(x86)%\NSIS\Unicode</code><br />
#:* 32 bit systems use <code>%ProgramFiles%\NSIS\Unicode</code><br />
# [http://notepadplusplus.org/ Notepad++]<br />
#* You need to use an editor that conforms to the [[Coding Standard]]. In particular, you must not check in files with DOS line endings except in very limited circumstances; see [[How to avoid DOS line endings in Windows tools]].<br />
<br />
=== Install Autobuild ===<br />
* Follow the directions at [[Autobuild#Getting_Autobuild|Getting Autobuild]] to install Autobuild<br />
* Add an environment variable, so that autobuild doesn't default to using (or trying) older compiler versions:<br />
** Right-click "My Computer" and select '''Properties'''.<br />
** When the Properties dialog opens, click the '''Advanced''' tab followed by the '''Environmental Variables''' button. This will open a new window with a list of System and User variables.<br />
** In the User section, click '''New'''. Set '''Variable Name''' to AUTOBUILD_VSVER and set '''Variable Value''' to 100.<br />
** Click the OK/Close buttons to close all the windows.<br />
<br />
=== Configure VC2010 ===<br />
While you may choose to use autobuild for all your compiling you still need to establish certain settings internal to VC2010.<br />
<br />
*Start the IDE<br />
<br />
*Navigate to '''Tools''' > '''Options''' > '''Projects and Solutions''' > '''Build and Run''' and set '''maximum number of parallel projects builds''' to <code>1</code>.<br />
<br />
* (VC Express only) Enable '''Tools''' > '''Settings''' > '''Expert Settings''' to get the '''Build''' (and other) menus. If you already have a '''Build''' menu you do not need to perform this step.<br />
<br />
{{KBnote|The following steps require an open visual studio project. It does not matter which project you use, as you will only change some global settings used by all projects when they are opened. The open project itself won't be changed.}}<br />
<br />
You need to set a number of paths. <br />
* Open any existing project you may have or make a New Project.<br />
<br />
At the bottom on the Solution Explorer you will see three tabs.<br />
*Click the one on the right labeled '''Property Manager'''. (The name may be somewhat truncated.)<br />
<br />
[[File:VS2010_Property_Manager.PNG|100px]]<br />
[[:File:VS2010_Property_Manager.PNG|Example image]]<br />
<br />
*On the left side click to expand any project and then click again to expand the '''Release''' folder.<br />
<br />
[[File:VS2010_Project_Config.PNG|100px]]<br />
[[:File:VS2010_Project_Config.PNG|Example image]]<br />
<br />
*Right click on '''Microsoft.Cpp.Win32.user'''.<br />
<br />
*Pick '''Properties''' > '''VC++ Directories'''.<br />
<br />
This is where the build environment is pulled together into a functional VC2010 build system and also where much hand wringing, hair pulling, and fist pounding frustration takes place.<br />
<br />
*Set '''Executable Directories''' to:<br />
<br />
$(ExecutablePath)<br />
$(DXSDK_DIR)<br />
$(WindowsSdkDir)\Bin<br />
C:\cygwin\bin<br />
$(SystemRoot)<br />
<br />
[[File:32BitExecutableDirectories.png|100px]]<br />
[[:File:32BitExecutableDirectories.png|32 bit Executable Directories example image]]<br />
<br />
*Set '''Include Directories''' to:<br />
<br />
$(WindowsSdkDir)\Include<br />
$(WindowsSdkDir)\Include\gl<br />
$(DXSDK_DIR)\Include<br />
<br />
[[File:32BitIncludeDirectories.png|100px]]<br />
[[:File:32BitIncludeDirectories.png|32 bit Include Directories example image]]<br />
<br />
*Set '''Library Directories''' to:<br />
<br />
$(WindowsSdkDir)\Lib<br />
$(DXSDK_DIR)<br />
<br />
[[File:32BitLibraryDirectories.png|100px]]<br />
[[:File:32BitLibraryDirectories.png|32 bit Library Directories example image]]<br />
<br />
== Set up your source code tree ==<br />
<br />
Plan your directory structure ahead of time. If you are going to be producing changes or patches you will be cloning a copy of an unaltered source code tree for every change or patch you make, so you might want to have all this work stored in it's own directory.<br />
<br />
To get a copy of the source code tree:<br />
* Open up a DOS Command window<br />
* CD to where you want to install viewer-development. Do not have any spaces in this path.<br />
* Do:<br />
hg clone <nowiki>http://hg.secondlife.com/viewer-development</nowiki><br />
<br />
Let's say some time has gone by since you have performed the previous steps and now you want to develop a change or work on a jira. You will update your clean local repository with all the changes committed to viewer-development since you last synchronized your files:<br />
* CD into <code>viewer-development</code><br />
* Do:<br />
hg pull -u<br />
<br />
* Move up one level from <code>viewer-development</code><br />
* Do:<br />
hg clone viewer-development VWR-nnnnn<br />
Note: <code>nnnnn</code> is the jira number. You can also clone to a name of your choosing if you are making changes not associated with the LL jira system.<br />
<br />
== Prepare third party libraries ==<br />
Most third party libraries needed to build the viewer will be automatically downloaded for you and installed into the build directory within your source tree during the [[#Configuring_the_Viewer|configuration step]] below. Some few need to be manually set up, though, when using an open source developer configuration (<code>Release'''OS'''</code>, <code>RelWithDebInfo'''OS'''</code> or <code>Debug'''OS'''</code>)<br />
<br />
=== Fmod method 1 (using autobuild) ===<br />
<br />
CD to where you want to install the 3p-fmod repository and do:<br />
hg clone <nowiki>https://bitbucket.org/lindenlab/3p-fmod</nowiki><br />
<br />
CD into the <code>3p-fmod</code> directory you created and build it:<br />
autobuild build --all<br />
<br />
Package the results:<br />
autobuild package <br />
<br />
Update autobuild with the filename and hash just displayed. CD to the directory where you cloned viewer-development and do:<br />
<br />
copy autobuild.xml my_autobuild.xml<br />
set AUTOBUILD_CONFIG_FILE=my_autobuild.xml<br />
autobuild installables edit fmod platform=windows hash=<hash> url=file:///<fmod-filespec><br />
<br />
Example:<br />
<br />
copy autobuild.xml my_autobuild.xml<br />
autobuild installables edit fmod platform=windows hash=0f196f00e7dff49f22252efb68525658 url=file:///C:/3p-fmod/fmod-3.75-windows-20110531.tar.bz2<br />
<br />
{{KBnote|Having to copy <code>autobuild.xml</code> and modify the copy from within a cloned repository is a lot of work for every repository you make, but this is the only way to guarantee you pick up upstream changes to <code>autobuild.xml</code> and do not send up a modified <code>autobuild.xml</code> when you do an hg push.}}<br />
<br />
=== Fmod method 2 (using switches) ===<br />
[To be written up]<br />
<br />
== Configuring the Viewer Build ==<br />
<br />
Fmod is the audio library the viewer uses. If you are compiling with Fmod you will need to do:<br />
set AUTOBUILD_CONFIG_FILE=my_autobuild.xml<br />
<br />
At the command line in the source tree's root directory (presumably a directory you have cloned from viewer-development, as it is not a good idea to work in viewer-development, unless you are only compiling for youself) e.g. <code>C:\linden\VWR-12345\</code>) run:<br />
autobuild configure -c [CONFIGURATION]<br />
where <code>[CONFIGURATION]</code> is one of those listed at [[Building the Viewer with Autobuild#Build a desired configuration]] (<code>ReleaseOS</code>, <code>RelWithDebInfoOS</code>, <code>DebugOS</code>)<br />
<br />
=== Configuration Switches ===<br />
There are a number of switches you can use to modify the configuration process. The name of each switch is followed by its type and then by the value you want to set.<br />
<br />
* '''FMOD''' (bool) controls if the Fmod package is incorporated into the viewer. You must have performed the Fmod installation steps in [[Viewer_2_Microsoft_Windows_Builds#Fmod_method_1_.28using_autobuild.29]] for this to work.<br />
* '''LL_TESTS''' (bool) controls if the tests are compiled and run. There are quite a lot of them so excluding them is recommended unless you have some reason to need one or more of them.<br />
* '''PACKAGE''' (bool) controls if the package step is run. You must have installed NSIS described in [[Viewer_2_Microsoft_Windows_Builds#Install_optional_development_tools]] for this to work.<br />
<br />
{{KBnote|'''OFF''' and '''NO''' are the same as '''FALSE'''; anything else is considered to be '''TRUE'''.}}<br />
<br />
Example: <br />
autobuild configure -c ReleaseOS -- -DLL_TESTS:BOOL=FALSE -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE<br />
<br />
== Compiling the Viewer ==<br />
=== Compiling the viewer with autobuild ===<br />
You can compile the viewer with either autobuild (the encouraged/supported method) or with the VS IDE.<br />
<br />
When compiling with autobuild you will have the best chance of success if you work from within a preconfigured Command Prompt window. Depending on how your computer has been set up there are two possible ways to open this window and you need to find which works in your particular case:<br />
*Method 1<br />
**From '''All Programs''' Navigate into the '''Microsoft Windows SDK V7.1''' program menu<br />
**Click on '''Windows SDK 7.1 Command Prompt'''<br />
*Method 2<br />
**From '''All Programs''' Navigate into the '''Microsoft Visual Studio 2010''' program menu<br />
**Click on '''Microsoft Visual Studio Command Prompt (2010)''' <br />
<br />
{{KBcaution|If you are building with Fmod and have followed the previous Fmod setup instructions AND you are now using a new command window you will need to redo the <code>set AUTOBUILD_CONFIG_FILE{{=}}my_autobuild.xml</code>.}}<br />
<br />
*Run:<br />
autobuild build -c [CONFIGURATION] --no-configure<br />
<br />
There are some useful switches to know about, so your commands may look like this:<br />
autobuild configure -c ReleaseOS -- -DLL_TESTS:BOOL=FALSE -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE<br />
autobuild build -c ReleaseOS --no-configure<br />
<br />
{{KBnote|It is possible to use autobuild to do both the configure step (only needed once) and the build step with one command. I find it is clearer and saves a bit of time if these steps are done separately.}}<br />
<br />
{{KBnote|Do not be alarmed if you see groups of messages with '''warning LNK4099: PDB''' in them.}}<br />
<br />
=== Compiling the viewer with the IDE ===<br />
<br />
The autobuild configure step created the <code>\build-vc100</code> directory at the root of the source tree. In here is the <code>SecondLife.sln</code> solution file.<br />
<br />
Start the IDE and open this solution.<br />
<br />
You might want to change the build type in the drop-down located in the toolbar from '''Debug''' to '''Release''' or '''RelWithDebInfo'''.<br />
<br />
[[File:VS2010BuildType.png|100px]]<br />
[[:File:VS2010BuildType.png|Changing build type example image]]<br />
<br />
You need to adjust the Platform Toolset setting.<br />
* Select all the projects in the Solution Explorer list on the left of the screen.<br />
** Click on the first project and scroll to the bottom of this list and {{K|shift}}-click on the last project.<br />
* Right click on the selected list<br />
* Navigate to '''Properties''' > '''Configuration Properties''' > '''General''' > '''Platform Toolset'''<br />
* Change this value to <code>Windows7.1SDK</code><br />
<br />
* Push {{K|F7}} to start the compiler.<br />
<br />
== Running your newly built viewer ==<br />
=== Running from a desktop shortcut ===<br />
* Make a desktop shortcut for <code>Drive:\your-path\build-vc100\newview\Release\secondlife-bin.exe</code><br />
<br />
* Right-click the shortcut<br />
* Select '''Properties'''<br />
* Set '''Start in:''' to <code>Drive:\your-path\indra\newview</code><br />
<br />
=== Running from within the IDE ===<br />
* In the Solution Explorer pane right click on '''secondlife-bin'''<br />
** Click '''Set as StartUp Project'''<br />
** Pick '''Properties''' > '''Configuration Properties''' > '''Debugging'''<br />
*** Set '''Command''' to <code>Drive:\your-path\build-vc100\newview\Release\secondlife-bin.exe</code><br />
*** Set '''Working Directory''' to <code>..\..\indra\newview</code><br />
<br />
== Handling Problems ==<br />
<br />
If you encounter errors or run into problems following the instructions above, please first check whether someone else already had the same issue. A solution might be known already. See the [[#Common_Issues.2FBugs.2FGlitches_And_Solutions|issue list below]], check [[{{TALKPAGENAME}}|the talk page]] (and report useful experiences there) and search our [[issue tracker]]. Even when no description of your problem has been written down yet, someone might know about it, so get in touch with the community to [[#Getting_help|get help]].<br />
<br />
=== Getting help ===<br />
* Subscribe to [[OpenSource-Dev|OpenSource-Dev Mailing List]] ([https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev subscribe]) and post your question there.<br />
* For faster response, join the general open source viewer discussion and development [[IRC]] channel [irc://irc.freenode.org/opensl #opensl on freenode]. Hopefully a helpful person is online when you ask your question.<br />
<br />
=== Common Issues/Bugs/Glitches And Solutions ===<br />
<br />
==== Not being able to find objidl.h in the Microsoft Windows SDK, when compiling llwindow ====<br />
https://lists.secondlife.com/pipermail/opensource-dev/2011-April/006562.html<br />
* Can be caused by path problems or some installation conflicts with the DirectX SDK.<br />
<br />
==== stdint.h typedef conflicts between Quicktime and VS2010 ====<br />
https://lists.secondlife.com/pipermail/opensource-dev/2011-April/006565.html<br />
*: Can be solved by some small edits to header files to make sure the two don't bash on each other.<br />
<br />
==== Eliminate depreciated switches messages and use memory more efficiently ====<br />
<br />
The VS2010 compiler uses a lot of memory while compiling the viewer. If you run out of memory you will start to page heavily and your compile time will become much longer. The /Zm1000 switch affects compiler memory usage.<br />
<br />
You may see this message while compiling:<br />
use 'EHsc' instead of 'GX'<br />
<br />
Here is how to free up some memory the compiler allocates and to eliminate these messages:<br />
<br />
*Edit <code>\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-cl.cmake</code><br />
<br />
*Replace line 156 with:<br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR")<br />
ENDIF(MSVC10)<br />
<br />
*Replace line 172 with: <br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")<br />
ENDIF(MSVC10)<br />
<br />
*Replace line 184 with:<br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")<br />
ENDIF(MSVC10)<br />
<br />
== References ==<br />
<br />
Tip of the hat to Nicky_Perian for [[User:Nicky_Perian/Visual_Studio_10_Autobuild]]<br />
<br />
[[Category:Compiling viewer]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Viewer_2_Microsoft_Windows_Builds&diff=1151613Viewer 2 Microsoft Windows Builds2011-08-18T01:05:26Z<p>Jenn Linden: Moved updated VS2010 content to canonical location.</p>
<hr />
<div>#REDIRECT [[Microsoft Windows Builds]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Microsoft_Windows_Builds&diff=1151612Microsoft Windows Builds2011-08-18T01:02:34Z<p>Jenn Linden: </p>
<hr />
<div>{{multi-lang}}<br />
{{CompileNav}} <br />
<br />
Philosophy: to keep it brief, this page should only include steps we KNOW ARE NEEDED, not random hints. Extra details or open issues can go on the talk page.<br />
<br />
{{KBnote|Following this recipe will probably take 6 to 12 hours of wall-clock time, and 2 to 6 hours of your time, if you're starting from a fresh Windows XP/Vista/7 system.}}<br />
<br />
== Establish your programming environment ==<br />
<br />
This is needed for compiling any viewer based on the LL open source code and only needs to be done once.<br />
<br />
=== Install and update Visual Studio and SDKs ===<br />
<br />
# Install [http://www.microsoft.com/express/download/ Visual Studio 2010] (Express is okay)<br />
#* If you installed VS2010 Express also install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84&displaylang=en Microsoft Visual C++ 2010 Redistributable Package] or [http://www.microsoft.com/download/en/confirmation.aspx?id=14632 64-bit Windows] version.<br />
# Install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=35aeda01-421d-4ba5-b44b-543dc8c33a20 Windows SDK for Windows 7 and .NET Framework 4] (ISO) or [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6B6C21D2-2006-4AFA-9702-529FA782D63B Windows SDK for Windows 7 and .NET Framework 4] (Web Install)<br />
# Install [http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba DirectX SDK (June 2010)]<br />
# Run [http://www.update.microsoft.com/microsoftupdate/v6 Microsoft Update], and keep running it until no updates are needed. This may take 6~8 iterations on older versions of windows.<br />
#* For Windows Vista and Windows 7, you need to select "Get updates from other Microsoft products" to get the updates for Visual Studio. <br />
#* For Windows XP, use the provided link above. The Windows Update menu item on your computer is not the correct updater to use.<br />
#* During the update cycles make sure you have picked up Microsoft Visual Studio 2010 Service Pack 1 [http://go.microsoft.com/fwlink/?LinkId=210710 (ISO)] or [http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=75568aa6-8107-475d-948a-ef22627e57a5 (Web Install)]<br />
<br />
=== Install required development tools ===<br />
<br />
{{KBnote|The order of the following installations should not matter.}}<br />
{{KBnote|If the installer for a particular package does not update your PATH environment variable you will have to do this manually.}}<br />
<br />
# '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])<br />
#* This should be version 2.8.4 (or above in the 2.8.x series).<br />
#*Add the <code>\bin</code> directory to your path.<br />
# '''Python''' (either [http://www.python.org/download/ Standard Python] or [http://www.activestate.com/activepython/downloads ActivePython])<br />
#* Version 2.7.1 works with the build scripts.<br />
# '''Mercurial''' (either [http://tortoisehg.bitbucket.org/ TortoiseHg] or [http://mercurial.selenic.com/ Mercurial Hg])<br />
# '''Cygwin''' ([http://www.cygwin.com/ download Cygwin])<br />
#* When you run the cygwin setup utility make sure you have selected to install '''unzip''' (under "Archives"), '''bison''', '''flex''', '''patchutils''' (all located under "devel"), and '''curl''' (under "Web"), which are not part of the default install. Do not install Cygwin Python or Mercurial. You won't need to use the Cygwin shell for anything.<br />
#*Add the <code>cygwin\bin</code> directory to the '''very end''' of your path and make sure it stays that way.<br />
<br />
=== Install optional development tools ===<br />
<br />
# [http://code.google.com/p/unsis/downloads/list Unicode NSIS (Nullsoft Scriptable Install System)]<br />
#* This is the package installer used to build <code>Second_Life_<version-code>_LindenDeveloper_Setup.exe</code>. You only need this package if you are going to distribute the viewer you compile or if you want to install it locally.<br />
#: In the [[#Configuring_the_Viewer|Configure VS2010 step]] below you will need to add a line in the '''Executable Directories''' section:<br />
#:* 64 bit systems use <code>%ProgramFiles(x86)%\NSIS\Unicode</code><br />
#:* 32 bit systems use <code>%ProgramFiles%\NSIS\Unicode</code><br />
# [http://notepadplusplus.org/ Notepad++]<br />
#* You need to use an editor that conforms to the [[Coding Standard]]. In particular, you must not check in files with DOS line endings except in very limited circumstances; see [[How to avoid DOS line endings in Windows tools]].<br />
<br />
=== Install Autobuild ===<br />
* Follow the directions at [[Autobuild#Getting_Autobuild|Getting Autobuild]] to install Autobuild<br />
* Add an environment variable, so that autobuild doesn't default to using (or trying) older compiler versions:<br />
** Right-click "My Computer" and select '''Properties'''.<br />
** When the Properties dialog opens, click the '''Advanced''' tab followed by the '''Environmental Variables''' button. This will open a new window with a list of System and User variables.<br />
** In the User section, click '''New'''. Set '''Variable Name''' to AUTOBUILD_VSVER and set '''Variable Value''' to 100.<br />
** Click the OK/Close buttons to close all the windows.<br />
<br />
=== Configure VC2010 ===<br />
While you may choose to use autobuild for all your compiling you still need to establish certain settings internal to VC2010.<br />
<br />
*Start the IDE<br />
<br />
*Navigate to '''Tools''' > '''Options''' > '''Projects and Solutions''' > '''Build and Run''' and set '''maximum number of parallel projects builds''' to <code>1</code>.<br />
<br />
* (VC Express only) Enable '''Tools''' > '''Settings''' > '''Expert Settings''' to get the '''Build''' (and other) menus. If you already have a '''Build''' menu you do not need to perform this step.<br />
<br />
{{KBnote|The following steps require an open visual studio project. It does not matter which project you use, as you will only change some global settings used by all projects when they are opened. The open project itself won't be changed.}}<br />
<br />
You need to set a number of paths. <br />
* Open any existing project you may have or make a New Project.<br />
<br />
At the bottom on the Solution Explorer you will see three tabs.<br />
*Click the one on the right labeled '''Property Manager'''. (The name may be somewhat truncated.)<br />
<br />
[[File:VS2010_Property_Manager.PNG|100px]]<br />
[[:File:VS2010_Property_Manager.PNG|Example image]]<br />
<br />
*On the left side click to expand any project and then click again to expand the '''Release''' folder.<br />
<br />
[[File:VS2010_Project_Config.PNG|100px]]<br />
[[:File:VS2010_Project_Config.PNG|Example image]]<br />
<br />
*Right click on '''Microsoft.Cpp.Win32.user'''.<br />
<br />
*Pick '''Properties''' > '''VC++ Directories'''.<br />
<br />
This is where the build environment is pulled together into a functional VC2010 build system and also where much hand wringing, hair pulling, and fist pounding frustration takes place.<br />
<br />
*Set '''Executable Directories''' to:<br />
<br />
$(ExecutablePath)<br />
$(DXSDK_DIR)<br />
$(WindowsSdkDir)\Bin<br />
C:\cygwin\bin<br />
$(SystemRoot)<br />
<br />
[[File:32BitExecutableDirectories.png|100px]]<br />
[[:File:32BitExecutableDirectories.png|32 bit Executable Directories example image]]<br />
<br />
*Set '''Include Directories''' to:<br />
<br />
$(WindowsSdkDir)\Include<br />
$(WindowsSdkDir)\Include\gl<br />
$(DXSDK_DIR)\Include<br />
<br />
[[File:32BitIncludeDirectories.png|100px]]<br />
[[:File:32BitIncludeDirectories.png|32 bit Include Directories example image]]<br />
<br />
*Set '''Library Directories''' to:<br />
<br />
$(WindowsSdkDir)\Lib<br />
$(DXSDK_DIR)<br />
<br />
[[File:32BitLibraryDirectories.png|100px]]<br />
[[:File:32BitLibraryDirectories.png|32 bit Library Directories example image]]<br />
<br />
== Set up your source code tree ==<br />
<br />
Plan your directory structure ahead of time. If you are going to be producing changes or patches you will be cloning a copy of an unaltered source code tree for every change or patch you make, so you might want to have all this work stored in it's own directory.<br />
<br />
To get a copy of the source code tree:<br />
* Open up a DOS Command window<br />
* CD to where you want to install viewer-development. Do not have any spaces in this path.<br />
* Do:<br />
hg clone <nowiki>http://hg.secondlife.com/viewer-development</nowiki><br />
<br />
Let's say some time has gone by since you have performed the previous steps and now you want to develop a change or work on a jira. You will update your clean local repository with all the changes committed to viewer-development since you last synchronized your files:<br />
* CD into <code>viewer-development</code><br />
* Do:<br />
hg pull -u<br />
<br />
* Move up one level from <code>viewer-development</code><br />
* Do:<br />
hg clone viewer-development VWR-nnnnn<br />
Note: <code>nnnnn</code> is the jira number. You can also clone to a name of your choosing if you are making changes not associated with the LL jira system.<br />
<br />
== Prepare third party libraries ==<br />
Most third party libraries needed to build the viewer will be automatically downloaded for you and installed into the build directory within your source tree during the [[#Configuring_the_Viewer|configuration step]] below. Some few need to be manually set up, though, when using an open source developer configuration (<code>Release'''OS'''</code>, <code>RelWithDebInfo'''OS'''</code> or <code>Debug'''OS'''</code>)<br />
<br />
=== Fmod method 1 (using autobuild) ===<br />
<br />
CD to where you want to install the 3p-fmod repository and do:<br />
hg clone <nowiki>https://bitbucket.org/lindenlab/3p-fmod</nowiki><br />
<br />
CD into the <code>3p-fmod</code> directory you created and build it:<br />
autobuild build --all<br />
<br />
Package the results:<br />
autobuild package <br />
<br />
Update autobuild with the filename and hash just displayed. CD to the directory where you cloned viewer-development and do:<br />
<br />
copy autobuild.xml my_autobuild.xml<br />
set AUTOBUILD_CONFIG_FILE=my_autobuild.xml<br />
autobuild installables edit fmod platform=windows hash=<hash> url=file:///<fmod-filespec><br />
<br />
Example:<br />
<br />
copy autobuild.xml my_autobuild.xml<br />
autobuild installables edit fmod platform=windows hash=0f196f00e7dff49f22252efb68525658 url=file:///C:/3p-fmod/fmod-3.75-windows-20110531.tar.bz2<br />
<br />
{{KBnote|Having to copy <code>autobuild.xml</code> and modify the copy from within a cloned repository is a lot of work for every repository you make, but this is the only way to guarantee you pick up upstream changes to <code>autobuild.xml</code> and do not send up a modified <code>autobuild.xml</code> when you do an hg push.}}<br />
<br />
=== Fmod method 2 (using switches) ===<br />
[To be written up]<br />
<br />
== Configuring the Viewer Build ==<br />
<br />
Fmod is the audio library the viewer uses. If you are compiling with Fmod you will need to do:<br />
set AUTOBUILD_CONFIG_FILE=my_autobuild.xml<br />
<br />
At the command line in the source tree's root directory (presumably a directory you have cloned from viewer-development, as it is not a good idea to work in viewer-development, unless you are only compiling for youself) e.g. <code>C:\linden\VWR-12345\</code>) run:<br />
autobuild configure -c [CONFIGURATION]<br />
where <code>[CONFIGURATION]</code> is one of those listed at [[Building the Viewer with Autobuild#Build a desired configuration]] (<code>ReleaseOS</code>, <code>RelWithDebInfoOS</code>, <code>DebugOS</code>)<br />
<br />
=== Configuration Switches ===<br />
There are a number of switches you can use to modify the configuration process. The name of each switch is followed by its type and then by the value you want to set.<br />
<br />
* '''FMOD''' (bool) controls if the Fmod package is incorporated into the viewer. You must have performed the Fmod installation steps in [[Viewer_2_Microsoft_Windows_Builds#Fmod_method_1_.28using_autobuild.29]] for this to work.<br />
* '''LL_TESTS''' (bool) controls if the tests are compiled and run. There are quite a lot of them so excluding them is recommended unless you have some reason to need one or more of them.<br />
* '''PACKAGE''' (bool) controls if the package step is run. You must have installed NSIS described in [[Viewer_2_Microsoft_Windows_Builds#Install_optional_development_tools]] for this to work.<br />
<br />
{{KBnote|'''OFF''' and '''NO''' are the same as '''FALSE'''; anything else is considered to be '''TRUE'''.}}<br />
<br />
Example: <br />
autobuild configure -c ReleaseOS -- -DLL_TESTS:BOOL=FALSE -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE<br />
<br />
== Compiling the Viewer ==<br />
=== Compiling the viewer with autobuild ===<br />
You can compile the viewer with either autobuild (the encouraged/supported method) or with the VS IDE.<br />
<br />
When compiling with autobuild you will have the best chance of success if you work from within a preconfigured Command Prompt window. Depending on how your computer has been set up there are two possible ways to open this window and you need to find which works in your particular case:<br />
*Method 1<br />
**From '''All Programs''' Navigate into the '''Microsoft Windows SDK V7.1''' program menu<br />
**Click on '''Windows SDK 7.1 Command Prompt'''<br />
*Method 2<br />
**From '''All Programs''' Navigate into the '''Microsoft Visual Studio 2010''' program menu<br />
**Click on '''Microsoft Visual Studio Command Prompt (2010)''' <br />
<br />
{{KBcaution|If you are building with Fmod and have followed the previous Fmod setup instructions AND you are now using a new command window you will need to redo the <code>set AUTOBUILD_CONFIG_FILE{{=}}my_autobuild.xml</code>.}}<br />
<br />
*Run:<br />
autobuild build -c [CONFIGURATION] --no-configure<br />
<br />
There are some useful switches to know about, so your commands may look like this:<br />
autobuild configure -c ReleaseOS -- -DLL_TESTS:BOOL=FALSE -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE<br />
autobuild build -c ReleaseOS --no-configure<br />
<br />
{{KBnote|It is possible to use autobuild to do both the configure step (only needed once) and the build step with one command. I find it is clearer and saves a bit of time if these steps are done separately.}}<br />
<br />
{{KBnote|Do not be alarmed if you see groups of messages with '''warning LNK4099: PDB''' in them.}}<br />
<br />
=== Compiling the viewer with the IDE ===<br />
<br />
The autobuild configure step created the <code>\build-vc100</code> directory at the root of the source tree. In here is the <code>SecondLife.sln</code> solution file.<br />
<br />
Start the IDE and open this solution.<br />
<br />
You might want to change the build type in the drop-down located in the toolbar from '''Debug''' to '''Release''' or '''RelWithDebInfo'''.<br />
<br />
[[File:VS2010BuildType.png|100px]]<br />
[[:File:VS2010BuildType.png|Changing build type example image]]<br />
<br />
You need to adjust the Platform Toolset setting.<br />
* Select all the projects in the Solution Explorer list on the left of the screen.<br />
** Click on the first project and scroll to the bottom of this list and {{K|shift}}-click on the last project.<br />
* Right click on the selected list<br />
* Navigate to '''Properties''' > '''Configuration Properties''' > '''General''' > '''Platform Toolset'''<br />
* Change this value to <code>Windows7.1SDK</code><br />
<br />
* Push {{K|F7}} to start the compiler.<br />
<br />
== Running your newly built viewer ==<br />
=== Running from a desktop shortcut ===<br />
* Make a desktop shortcut for <code>Drive:\your-path\build-vc100\newview\Release\secondlife-bin.exe</code><br />
<br />
* Right-click the shortcut<br />
* Select '''Properties'''<br />
* Set '''Start in:''' to <code>Drive:\your-path\indra\newview</code><br />
<br />
=== Running from within the IDE ===<br />
* In the Solution Explorer pane right click on '''secondlife-bin'''<br />
** Click '''Set as StartUp Project'''<br />
** Pick '''Properties''' > '''Configuration Properties''' > '''Debugging'''<br />
*** Set '''Command''' to <code>Drive:\your-path\build-vc100\newview\Release\secondlife-bin.exe</code><br />
*** Set '''Working Directory''' to <code>..\..\indra\newview</code><br />
<br />
== Handling Problems ==<br />
<br />
If you encounter errors or run into problems following the instructions above, please first check whether someone else already had the same issue. A solution might be known already. See the [[#Common_Issues.2FBugs.2FGlitches_And_Solutions|issue list below]], check [[{{TALKPAGENAME}}|the talk page]] (and report useful experiences there) and search our [[issue tracker]]. Even when no description of your problem has been written down yet, someone might know about it, so get in touch with the community to [[#Getting_help|get help]].<br />
<br />
=== Getting help ===<br />
* Subscribe to [[OpenSource-Dev|OpenSource-Dev Mailing List]] ([https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev subscribe]) and post your question there.<br />
* For faster response, join the general open source viewer discussion and development [[IRC]] channel [irc://irc.freenode.org/opensl #opensl on freenode]. Hopefully a helpful person is online when you ask your question.<br />
<br />
=== Common Issues/Bugs/Glitches And Solutions ===<br />
<br />
==== Not being able to find objidl.h in the Microsoft Windows SDK, when compiling llwindow ====<br />
https://lists.secondlife.com/pipermail/opensource-dev/2011-April/006562.html<br />
* Can be caused by path problems or some installation conflicts with the DirectX SDK.<br />
<br />
==== stdint.h typedef conflicts between Quicktime and VS2010 ====<br />
https://lists.secondlife.com/pipermail/opensource-dev/2011-April/006565.html<br />
*: Can be solved by some small edits to header files to make sure the two don't bash on each other.<br />
<br />
==== Eliminate depreciated switches messages and use memory more efficiently ====<br />
<br />
The VS2010 compiler uses a lot of memory while compiling the viewer. If you run out of memory you will start to page heavily and your compile time will become much longer. The /Zm1000 switch affects compiler memory usage.<br />
<br />
You may see this message while compiling:<br />
use 'EHsc' instead of 'GX'<br />
<br />
Here is how to free up some memory the compiler allocates and to eliminate these messages:<br />
<br />
*Edit <code>\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-cl.cmake</code><br />
<br />
*Replace line 156 with:<br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR")<br />
ENDIF(MSVC10)<br />
<br />
*Replace line 172 with: <br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")<br />
ENDIF(MSVC10)<br />
<br />
*Replace line 184 with:<br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")<br />
ENDIF(MSVC10)<br />
<br />
== References ==<br />
<br />
Tip of the hat to Nicky_Perian for [[User:Nicky_Perian/Visual_Studio_10_Autobuild]]<br />
<br />
[[Category:Compiling viewer]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Compiling_the_viewer_(MSVS2005)&diff=1151611Compiling the viewer (MSVS2005)2011-08-18T01:01:43Z<p>Jenn Linden: </p>
<hr />
<div>{{multi-lang}}<br />
{{CompileNav}}<br />
{{Warning|These instructions will not work with newer versions of the viewer. See [[Microsoft Windows Builds]] for building the latest version of the viewer.}}<br />
<br />
On Windows, there are several options on build (compile) environment of the Second Life.<br />
<br />
This page explains how you can compile the Viewer on Microsoft Windows.<br />
<br />
Currently, only 32 bit binary is tested. There seems to be several trials to produce 64 bit Windows <code>.exe</code> of the Viewer. If you did, please write your experience on [[Talk:Microsoft Windows Builds|the discussion page]] (regardless it was successful or not!)<br />
<br />
== Choosing and preparing a compiler ==<br />
<br />
=== Linden-supported compilers ===<br />
<br />
Supported compiler: '''Visual Studio .NET 2005 Professional'''<br />
<br />
You need to setup the compiler and Microsoft Development tools as follows:<br />
* Setup [[Microsoft Visual Studio]]<br />
<br />
=== Community experimental compilers ===<br />
<br />
If you don't have Visual Studio .NET 2005 Professional, you may wish to try one of the following alternatives.<br />
<br />
* Visual C++ 2005 Express ([[Microsoft Visual Studio|instructions]], but the screenshots for [[Compiling the Viewer (MSVS2008)|VS2008]] are worth a glance too)<br />
* Visual Studio 2008 ([[Compiling the Viewer (MSVS2008)|instructions]])<br />
* Visual C++ 2008 Express ([[Compiling the Viewer (MSVS2008)|instructions]])<br />
<br />
{{KBwarning|Boost support with Visual Studio 2008 is problematic as of this writing. Check {{jira|VWR-9541}} before continuing on this path.}}<br />
<br />
{{KBcaution|Make sure you install to paths without spaces in it.}}<br />
<br />
== Getting other development tools ==<br />
<br />
You will need to install the following tools to compile the Viewer:<br />
* '''UniCode NSIS''' ([http://code.google.com/p/unsis/downloads/list download Unicode NSIS])<br />
** This is the package installer used to build <code>Setup.exe</code>. ''<b>Note:</b> NSIS is now hosted by Google Code (linked above). Previously at: http://www.scratchpaper.com/home/downloads.'' --[[User:Jenn Linden|Jenn Linden]] 21:56, 25 October 2010 (UTC)<br />
** NSIS must be installed to the default location for your windows install, i.e. "Program Files"<br />
* '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])<br />
** Use the latest point version for Cmake 2.6. As of this writing, the latest version is 2.6.4. <b>Note</b>: There are many known issues with CMake 2.6.0 and 2.6.1 in conjunction with building the Second Life Viewer. CMake 2.4.8 is supported for compiling the 1.21 version of the Second Life Viewer, but 2.6.2 is likely to become the new minimum requirement in the near future.<br />
* '''Cygwin''' ([http://www.cygwin.com/ download Cygwin])<br />
** When you run the cygwin setup utility make sure you have selected to install '''patchutils''', '''flex''', '''bison''', and '''zlib-devel'''(all located under "devel"), '''openssh''' (located under "Net"), which are not part of the default install. (If you missed one of these, the easiest thing to do is to re-run the entire installation.)<br />
** '''NOTE:''' '''DO NOT''' use the Cygwin version of CMake or Python. The Build will fail. (CMake specifically excludes the Cygwin version of Python, in the <code>Python.cmake</code> file)<br />
* '''Python''' (download either [http://www.python.org/download/ Python.org Standard Python] or [http://www.activestate.com/Products/ActivePython/?mp=1 ActivePython]<br />
** 2.4.3 is the minimum required version.<br />
** Use version v2.5 preferably. If you use a version newer than 2.5, you may need to change the <code>Python.cmake</code> file. See the [[Talk:CMake#CMake_and_Python_2.6|CMake discussion]] for details (this change was necessary as of 1.21-r99587 source branch). ) <br />
* '''The Windows Platform SDK'''<br />
** Get the latest version (as of 23 March 2010) here: [http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=c17ba869-9671-4330-a63e-1fd44e0e2505&displayLang=en Windows SDK for Windows Server 2008 and .NET Framework 3.5 SP1] (If you use the web installer, you can choose only the "Development Tools" and "Samples Win32", which is referenced by viewer-development source, to cut the download size significantly. Watch those version descriptions closely. v6.1 seems to work fine but v7.0, when combined with the components above, results in linking errors stating libraries are corrupted.) <br />
* '''DirectX SDK'''<br />
** Get the latest version (as of 7 June 2010) here: [http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba DirectX SDK (June 2010)]<br />
<br />
Verify that Cygwin, CMake, and Python are in the windows "PATH".<br />
<br />
== Downloading Source Code ==<br />
<br />
{{KBcaution|Make sure you install to paths without spaces in it.}}<br />
<br />
You can download the Viewer source code on the [[source downloads]] page. You can also use a [[version control repository]]. If you're just starting out, it's probably best to get the latest Release version, rather than a Release Candidate, because the Release Candidates get updated quite often. But if you would rather work with the latest code, go for the [[version control repository]] "trunk". Don't forget to also download the artwork and library bundles relevant to the repository branch you're using as explained in [[Version_control_repository#Artwork_and_Library_Bundles|Artwork and Library Bundles]].<br />
<br />
If you're downloading from the [[source downloads]] page, there are three packages to get: the source package, the artwork package, and the library package. In versions 1.20 and earlier, Linden packaged the library binaries in the Libs package. For 1.21 and beyond, the CMake <code>develop.py</code> script now downloads '''most''' of the libraries that were previously in the libs zip file. This saves developers who are tracking trunk from constantly downloading them every update and only downloads updated libraries. As of this writing, there are some pieces packages that still require downloading, so be sure to grab the library and artwork bundles from the [[source downloads]] page.<br />
<br />
'''WARNING:'''<br />
* If the directory path you keep the SL source in has a space in it, the batch file that copies <code>message_template.msg</code> will fail. So, if you unzip or checkout the source tree into, e.g., <code>C:\Projects\Dir with space in name\Etc\linden</code>, it won't work!<br />
* You should also avoid using non-ASCII (national) characters in the paths, although some localized versions of the tool puts some as a default...<br />
* Unzip or checkout your source tree into a directory that has as short full pathname as possible, since long paths cause some unexpected trouble during the build.<br />
<br />
In other words, the easiest way to get this working is to get '''source''', '''artwork''', and '''libs''' from the [[source downloads]] page and unpack them all into the same directory/folder, which ideally would be a folder in (or near) the root directory with a short name like <code>sl_1_21_6</code>.<br />
<br />
== Installing libraries ==<br />
<br />
SL Viewer depends on some third party libraries. Some of them are open source, some others are not.<br />
<br />
=== Open source libraries ===<br />
<br />
As of Viewer version 1.21, all open source libraries are automatically downloaded as part of the build script invoked by <code>develop.py</code>, unless you choose to configure a standalone build.<br />
<br />
=== Proprietary libraries ===<br />
<br />
Linden Lab does not provide proprietary libraries. You will need to follow the instructions here under to acquire and copy them to your source tree.<br />
<br />
It's probably a good idea to build an empty directory tree for those files, copy the relevant proprietary files there and, once done, copy the whole to your source tree (like <code>XCOPY OLIB SL_1_16_0_5 /S</code>). The reason is that these steps are cumbersome and will have to be repeated for each new release (at least if you keep the source for each release in its own folder). If you do not want to do this, you can just as well copy the files directly into the linden source paths.<br />
<br />
rem OLIBS.CMD to build a folder tree for 3rd party libraries and includes<br />
md olibs<br />
md olibs\linden\<br />
md olibs\linden\libraries<br />
md olibs\linden\libraries\include<br />
md olibs\linden\libraries\i686-win32<br />
md olibs\linden\libraries\i686-win32\lib_release<br />
md olibs\linden\libraries\i686-win32\lib_debug<br />
md olibs\linden\libraries\i686-win32\include<br />
md olibs\linden\libraries\i686-win32\include\GL<br />
md olibs\linden\libraries\i686-win32\include\quicktime<br />
md olibs\linden\indra<br />
md olibs\linden\indra\newview<br />
<br />
<br />
==== Fmod ==== <br />
* Download & extract [http://www.fmod.org/files/fmod3/fmodapi375win.zip FMOD3.75 API for Windows]. (later versions, like FMOD Ex, are incompatible).<br />
* Copy <code>fmodapi375win\api\inc\fmod.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\inc\fmod_errors.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\inc\fmoddyn.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\lib\fmodvc.lib</code> to <code>linden\libraries\i686-win32\lib_release</code> and to <code>linden\libraries\i686-win32\lib_debug</code><br />
(If using cmake, copy <code>fmodapi375win\api\lib\fmodvc.lib</code> to <code>linden\libraries\i686-win32\lib\release</code> and to <code>linden\libraries\i686-win32\lib\debug</code>)<br />
* Copy <code>fmodapi375win\api\fmod.dll</code> to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
<br />
Note to Snowstorm users: if you are building using the Mercurial repository [https://bitbucket.org/lindenlab/viewer-development lindenlab/viewer-development], these steps have been simplified and cleaned up. In particular, there's no need to drop anything under <code>linden\indra</code> anymore, all the files are under <code>linden\libraries</code> like for other 3rd party libraries. The <code>fmodvc.lib</code> however needs to be renamed <code>fmod.lib</code>. The new instructions are:<br />
* Download & extract [http://www.fmod.org/files/fmod3/fmodapi375win.zip FMOD3.75 API for Windows]<br />
* From <code>fmodapi375win\api\inc\</code>, copy <code>fmod.h</code> and <code>fmod_errors.h</code> to <code>linden\libraries\include</code><br />
* From <code>fmodapi375win\api\lib</code>, choose the relevant <code>.lib</code> that correspond to your environment (e.g. <code>fmodvc.lib</code> for Visual Studio), rename it <code>fmod.lib</code> and copy it to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
* From <code>fmodapi375win\api</code> copy <code>fmod.dll</code> to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
<br />
==== Quicktime ====<br />
<br />
Currently - as of version 1.21 - CMake requires Quicktime to be installed.<br />
<br />
'''Note:''' This download requires a registration at the Apple Quicktime website and take a bit of time. You can avoid using QuickTime if you want, see [[Compiling_older_Viewers_(1.20_and_earlier_with_MSVS)#QuickTime_removal|this]] for details. Remember that your Viewer '''can't play in-world movies''' if you do so.<br />
* Download & install the [http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wo/11.1.17.2.1.3.3.1.0.1.1.0.3.11.3.3.1#main Quicktime SDK for Windows]<br />
* Copy <code>QuicktimeSDK\Libraries\QTMLClient.lib</code> to <code>linden\libraries\i686-win32\lib_release</code> and to <code>linden\libraries\i686-win32\lib_debug</code>.<br />
<br />
(If using CMake, copy <code>QuicktimeSDK\Libraries\QTMLClient.lib</code> to <code>linden\libraries\i686-win32\lib\release</code> and to <code>linden\libraries\i686-win32\lib\debug</code> instead)<br />
<br />
* Copy the contents of <code>QuicktimeSDK\CIncludes</code> into <code>linden\libraries\i686-win32\include\quicktime</code>.<br />
<br />
== Building the Viewer ==<br />
<br />
At this point, you should be ready to use [[CMake]] to build the Visual Studio solution for the project. <br />
<br />
'''NOTE''': CMake is only supported for Viewer versions 1.21 and beyond. <br />
<br />
Before you first run a build, you'll need to configure things. It is recommended that you use the <code>develop.py</code> script that will create a default configuration for you.<br />
<br />
You must make sure that cmake is registered in the Windows environment or you will get strange errors from <code>develop.py</code>. To ensure everything is correct, right click My Computer -> Properties -> Advanced -> Environment Variables -> Inside System Variables, choose PATH (case insensitive) and click Edit. Now in the value field, go to the end of the value and add a semicolon (<code>;</code>), and then the folder containing the CMake binaries (example: <code>C:\Program Files\CMake 2.8\bin</code>). This might already have been set by the CMake installer.<br />
<br />
From the command line, navigate to the <code>indra</code> folder of your source tree and run:<br />
<br />
python develop.py<br />
<br />
CMake will pick the most recent version of Visual Studio we support. If you want to specify the version of Visual Studio to use.<br />
<br />
* VisualStudio 2005:<br />
<br />
python develop.py -G VC80<br />
<br />
* VisualStudio 2008:<br />
<br />
python develop.py -G VC90<br />
<br />
'''NOTE:''' The above commands will configure a "non-standalone" version of the source code tree. This means that the required third party library packages (as built by Linden Lab) will be downloaded during the CMake process.<br />
<br />
=== Finding your build directory ===<br />
<br />
In the CMake world, we keep source and object files separate. The <code>develop.py</code> script did create and populate a build directory for you. It is in one of the following locations:<br />
* VS 2005: <code>indra/build-vc80</code><br />
* VS 2008: <code>indra/build-vc90</code> <br />
<br />
=== Compiling ===<br />
<br />
To start a build, do one of the following:<br />
* Run <code>python develop.py build</code> from the <code>indra</code> directory.<br />
** '''NOTE FOR VS 2008 USERS:''' This command will not work, since it will only look for VS 2005. Instead, run the command <code>python develop.py -G VC90 build</code><br />
* Load the Visual Studio solution into your IDE. For MSVS VC++:<br />
** Use "File -> Open -> Project/Solution", and open the <code>linden/indra/build-VC80/SecondLife.sln</code> solution file<br />
*** '''NOTE FOR VS 2008 USERS:''' Even though a build-VC90 was created in the above steps, <code>developer.py</code> places the VS 2008 solution/project files in the <code>indra</code> directory. Don't move them to <code>build-VC90</code> - the paths in the project files are relative to the <code>indra</code> directory.<br />
** In the MSVS toolbar, just to the right of the triangular "Start Debugging" arrow, is a text box whose tooltip is "Solution Configurations". Select RelWithDebugInfo.<br />
** If ALL_BUILD is not set as your StartUp Project (the StartUp Project is displayed in bold font), right-click on ALL_BUILD and choose "Set as StartUp Project".<br />
** Right-click on ALL_BUILD and choose "Properties". In "Configuration Properties -> Debugging", find "Working Directory" and navigate to <code>linden\indra\newview</code>.<br />
** (For Snowglobe 1.x) In the Solution Explorer pane, right-click on the project named "prepare" and select Project Only -> Build Only prepare. This downloads and installs precompiled libraries and only needs to be done when the source tree is clean or if libraries in the list included in the source tree get updated. Running this when not required is brief and causes no harm.<br />
** Build -> Build Solution (F7)<br />
** Debug -> "Start Debugging" or "Start without debugging".<br />
** MSVC might not be able to find the executable. If not, point it to <code>linden\indra\build-VC80\newview\relwithdebinfo\secondlife-bin.exe</code>, and try again.<br />
** You may see an error due to not being able to find <code>fmod.dll</code>. If so, find a copy (remember, you copied this in a step above) and copy it into <code>indra\build-VC80\newview\relwithdebinfo</code>. Try again.<br />
** You may see an error due to not finding <code>llkdu.dll</code>. If so, find it in the normal installed version (make sure it's the same version as your source) and copy it into <code>indra\build-VC80\newview\relwithdebinfo</code>. Try again.<br />
** Good luck!<br />
<br />
=== Where's the built Viewer? ===<br />
<br />
On Windows, the built Viewer ought to run from VS2005.<br />
<br />
To run outside MS VS, see Discussion tab:<br />
[[Talk:Microsoft_Windows_Builds#Running_viewer_outside_of_MS_VS]]<br />
<br />
=== Build instructions for 1.20 and earlier ===<br />
<br />
See [[Compiling older Viewers (1.20 and earlier with MSVS)]] if you'd like to compile a version of the Viewer older than 1.20.<br />
<br />
== What to do if it doesn't work for you ==<br />
<br />
* Ask for help on [[IRC]] ([irc://irc.freenode.net/opensl #opensl on freenode])<br />
* Find someone on the [[OpenSource-Dev|OpenSource-Dev mailing list]]<br />
* Fix it: [[Modifying CMake Files]] (and please, submit a patch!)<br />
<br />
Please also see the (user contributed) instructions at [[User:Michelle2_Zenovka/cmake]]<br />
<br />
[[Category:Compiling viewer]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Viewer_2_Microsoft_Windows_Builds&diff=1151610Viewer 2 Microsoft Windows Builds2011-08-17T23:31:31Z<p>Jenn Linden: </p>
<hr />
<div>{{multi-lang}}<br />
{{CompileNav}} <br />
<br />
Philosophy: to keep it brief, this page should only include steps we KNOW ARE NEEDED, not random hints. Extra details or open issues can go on the talk page.<br />
<br />
{{KBnote|Following this recipe will probably take 6 to 12 hours of wall-clock time, and 2 to 6 hours of your time, if you're starting from a fresh Windows XP/Vista/7 system.}}<br />
<br />
== Establish your programming environment ==<br />
<br />
This is needed for compiling any viewer based on the LL open source code and only needs to be done once.<br />
<br />
=== Install and update Visual Studio and SDKs ===<br />
<br />
# Install [http://www.microsoft.com/express/download/ Visual Studio 2010] (Express is okay)<br />
#* If you installed VS2010 Express also install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84&displaylang=en Microsoft Visual C++ 2010 Redistributable Package] or [http://www.microsoft.com/download/en/confirmation.aspx?id=14632 64-bit Windows] version.<br />
# Install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=35aeda01-421d-4ba5-b44b-543dc8c33a20 Windows SDK for Windows 7 and .NET Framework 4] (ISO) or [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6B6C21D2-2006-4AFA-9702-529FA782D63B Windows SDK for Windows 7 and .NET Framework 4] (Web Install)<br />
# Install [http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba DirectX SDK (June 2010)]<br />
# Run [http://www.update.microsoft.com/microsoftupdate/v6 Microsoft Update], and keep running it until no updates are needed. This may take 6~8 iterations on older versions of windows.<br />
#* For Windows Vista and Windows 7, you need to select "Get updates from other Microsoft products" to get the updates for Visual Studio. <br />
#* For Windows XP, use the provided link above. The Windows Update menu item on your computer is not the correct updater to use.<br />
#* During the update cycles make sure you have picked up Microsoft Visual Studio 2010 Service Pack 1 [http://go.microsoft.com/fwlink/?LinkId=210710 (ISO)] or [http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=75568aa6-8107-475d-948a-ef22627e57a5 (Web Install)]<br />
<br />
=== Install required development tools ===<br />
<br />
{{KBnote|The order of the following installations should not matter.}}<br />
{{KBnote|If the installer for a particular package does not update your PATH environment variable you will have to do this manually.}}<br />
<br />
# '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])<br />
#* This should be version 2.8.4 (or above in the 2.8.x series).<br />
#*Add the <code>\bin</code> directory to your path.<br />
# '''Python''' (either [http://www.python.org/download/ Standard Python] or [http://www.activestate.com/activepython/downloads ActivePython])<br />
#* Version 2.7.1 works with the build scripts.<br />
# '''Mercurial''' (either [http://tortoisehg.bitbucket.org/ TortoiseHg] or [http://mercurial.selenic.com/ Mercurial Hg])<br />
# '''Cygwin''' ([http://www.cygwin.com/ download Cygwin])<br />
#* When you run the cygwin setup utility make sure you have selected to install '''unzip''' (under "Archives"), '''bison''', '''flex''', '''patchutils''' (all located under "devel"), and '''curl''' (under "Web"), which are not part of the default install. Do not install Cygwin Python or Mercurial. You won't need to use the Cygwin shell for anything.<br />
#*Add the <code>cygwin\bin</code> directory to the '''very end''' of your path and make sure it stays that way.<br />
<br />
=== Install optional development tools ===<br />
<br />
# [http://code.google.com/p/unsis/downloads/list Unicode NSIS (Nullsoft Scriptable Install System)]<br />
#* This is the package installer used to build <code>Second_Life_<version-code>_LindenDeveloper_Setup.exe</code>. You only need this package if you are going to distribute the viewer you compile or if you want to install it locally.<br />
#: In the [[#Configuring_the_Viewer|Configure VS2010 step]] below you will need to add a line in the '''Executable Directories''' section:<br />
#:* 64 bit systems use <code>%ProgramFiles(x86)%\NSIS\Unicode</code><br />
#:* 32 bit systems use <code>%ProgramFiles%\NSIS\Unicode</code><br />
# [http://notepadplusplus.org/ Notepad++]<br />
#* You need to use an editor that conforms to the [[Coding Standard]]. In particular, you must not check in files with DOS line endings except in very limited circumstances; see [[How to avoid DOS line endings in Windows tools]].<br />
<br />
=== Install Autobuild ===<br />
* Follow the directions at [[Autobuild#Getting_Autobuild|Getting Autobuild]] to install Autobuild<br />
* Add an environment variable, so that autobuild doesn't default to using (or trying) older compiler versions:<br />
** Right-click "My Computer" and select '''Properties'''.<br />
** When the Properties dialog opens, click the '''Advanced''' tab followed by the '''Environmental Variables''' button. This will open a new window with a list of System and User variables.<br />
** In the User section, click '''New'''. Set '''Variable Name''' to AUTOBUILD_VSVER and set '''Variable Value''' to 100.<br />
** Click the OK/Close buttons to close all the windows.<br />
<br />
=== Configure VC2010 ===<br />
While you may choose to use autobuild for all your compiling you still need to establish certain settings internal to VC2010.<br />
<br />
*Start the IDE<br />
<br />
*Navigate to '''Tools''' > '''Options''' > '''Projects and Solutions''' > '''Build and Run''' and set '''maximum number of parallel projects builds''' to <code>1</code>.<br />
<br />
* (VC Express only) Enable '''Tools''' > '''Settings''' > '''Expert Settings''' to get the '''Build''' (and other) menus. If you already have a '''Build''' menu you do not need to perform this step.<br />
<br />
{{KBnote|The following steps require an open visual studio project. It does not matter which project you use, as you will only change some global settings used by all projects when they are opened. The open project itself won't be changed.}}<br />
<br />
You need to set a number of paths. <br />
* Open any existing project you may have or make a New Project.<br />
<br />
At the bottom on the Solution Explorer you will see three tabs.<br />
*Click the one on the right labeled '''Property Manager'''. (The name may be somewhat truncated.)<br />
<br />
[[File:VS2010_Property_Manager.PNG|100px]]<br />
[[:File:VS2010_Property_Manager.PNG|Example image]]<br />
<br />
*On the left side click to expand any project and then click again to expand the '''Release''' folder.<br />
<br />
[[File:VS2010_Project_Config.PNG|100px]]<br />
[[:File:VS2010_Project_Config.PNG|Example image]]<br />
<br />
*Right click on '''Microsoft.Cpp.Win32.user'''.<br />
<br />
*Pick '''Properties''' > '''VC++ Directories'''.<br />
<br />
This is where the build environment is pulled together into a functional VC2010 build system and also where much hand wringing, hair pulling, and fist pounding frustration takes place.<br />
<br />
*Set '''Executable Directories''' to:<br />
<br />
$(ExecutablePath)<br />
$(DXSDK_DIR)<br />
$(WindowsSdkDir)\Bin<br />
C:\cygwin\bin<br />
$(SystemRoot)<br />
<br />
[[File:32BitExecutableDirectories.png|100px]]<br />
[[:File:32BitExecutableDirectories.png|32 bit Executable Directories example image]]<br />
<br />
*Set '''Include Directories''' to:<br />
<br />
$(WindowsSdkDir)\Include<br />
$(WindowsSdkDir)\Include\gl<br />
$(DXSDK_DIR)\Include<br />
<br />
[[File:32BitIncludeDirectories.png|100px]]<br />
[[:File:32BitIncludeDirectories.png|32 bit Include Directories example image]]<br />
<br />
*Set '''Library Directories''' to:<br />
<br />
$(WindowsSdkDir)\Lib<br />
$(DXSDK_DIR)<br />
<br />
[[File:32BitLibraryDirectories.png|100px]]<br />
[[:File:32BitLibraryDirectories.png|32 bit Library Directories example image]]<br />
<br />
== Set up your source code tree ==<br />
<br />
Plan your directory structure ahead of time. If you are going to be producing changes or patches you will be cloning a copy of an unaltered source code tree for every change or patch you make, so you might want to have all this work stored in it's own directory.<br />
<br />
To get a copy of the source code tree:<br />
* Open up a DOS Command window<br />
* CD to where you want to install viewer-development. Do not have any spaces in this path.<br />
* Do:<br />
hg clone <nowiki>http://hg.secondlife.com/viewer-development</nowiki><br />
<br />
Let's say some time has gone by since you have performed the previous steps and now you want to develop a change or work on a jira. You will update your clean local repository with all the changes committed to viewer-development since you last synchronized your files:<br />
* CD into <code>viewer-development</code><br />
* Do:<br />
hg pull -u<br />
<br />
* Move up one level from <code>viewer-development</code><br />
* Do:<br />
hg clone viewer-development VWR-nnnnn<br />
Note: <code>nnnnn</code> is the jira number. You can also clone to a name of your choosing if you are making changes not associated with the LL jira system.<br />
<br />
== Prepare third party libraries ==<br />
Most third party libraries needed to build the viewer will be automatically downloaded for you and installed into the build directory within your source tree during the [[#Configuring_the_Viewer|configuration step]] below. Some few need to be manually set up, though, when using an open source developer configuration (<code>Release'''OS'''</code>, <code>RelWithDebInfo'''OS'''</code> or <code>Debug'''OS'''</code>)<br />
<br />
=== Fmod method 1 (using autobuild) ===<br />
<br />
CD to where you want to install the 3p-fmod repository and do:<br />
hg clone <nowiki>https://bitbucket.org/lindenlab/3p-fmod</nowiki><br />
<br />
CD into the <code>3p-fmod</code> directory you created and build it:<br />
autobuild build --all<br />
<br />
Package the results:<br />
autobuild package <br />
<br />
Update autobuild with the filename and hash just displayed. CD to the directory where you cloned viewer-development and do:<br />
<br />
copy autobuild.xml my_autobuild.xml<br />
set AUTOBUILD_CONFIG_FILE=my_autobuild.xml<br />
autobuild installables edit fmod platform=windows hash=<hash> url=file:///<fmod-filespec><br />
<br />
Example:<br />
<br />
copy autobuild.xml my_autobuild.xml<br />
autobuild installables edit fmod platform=windows hash=0f196f00e7dff49f22252efb68525658 url=file:///C:/3p-fmod/fmod-3.75-windows-20110531.tar.bz2<br />
<br />
{{KBnote|Having to copy <code>autobuild.xml</code> and modify the copy from within a cloned repository is a lot of work for every repository you make, but this is the only way to guarantee you pick up upstream changes to <code>autobuild.xml</code> and do not send up a modified <code>autobuild.xml</code> when you do an hg push.}}<br />
<br />
=== Fmod method 2 (using switches) ===<br />
[To be written up]<br />
<br />
== Configuring the Viewer Build ==<br />
<br />
Fmod is the audio library the viewer uses. If you are compiling with Fmod you will need to do:<br />
set AUTOBUILD_CONFIG_FILE=my_autobuild.xml<br />
<br />
At the command line in the source tree's root directory (presumably a directory you have cloned from viewer-development, as it is not a good idea to work in viewer-development, unless you are only compiling for youself) e.g. <code>C:\linden\VWR-12345\</code>) run:<br />
autobuild configure -c [CONFIGURATION]<br />
where <code>[CONFIGURATION]</code> is one of those listed at [[Building the Viewer with Autobuild#Build a desired configuration]] (<code>ReleaseOS</code>, <code>RelWithDebInfoOS</code>, <code>DebugOS</code>)<br />
<br />
=== Configuration Switches ===<br />
There are a number of switches you can use to modify the configuration process. The name of each switch is followed by its type and then by the value you want to set.<br />
<br />
* '''FMOD''' (bool) controls if the Fmod package is incorporated into the viewer. You must have performed the Fmod installation steps in [[Viewer_2_Microsoft_Windows_Builds#Fmod_method_1_.28using_autobuild.29]] for this to work.<br />
* '''LL_TESTS''' (bool) controls if the tests are compiled and run. There are quite a lot of them so excluding them is recommended unless you have some reason to need one or more of them.<br />
* '''PACKAGE''' (bool) controls if the package step is run. You must have installed NSIS described in [[Viewer_2_Microsoft_Windows_Builds#Install_optional_development_tools]] for this to work.<br />
<br />
{{KBnote|'''OFF''' and '''NO''' are the same as '''FALSE'''; anything else is considered to be '''TRUE'''.}}<br />
<br />
Example: <br />
autobuild configure -c ReleaseOS -- -DLL_TESTS:BOOL=FALSE -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE<br />
<br />
== Compiling the Viewer ==<br />
=== Compiling the viewer with autobuild ===<br />
You can compile the viewer with either autobuild (the encouraged/supported method) or with the VS IDE.<br />
<br />
When compiling with autobuild you will have the best chance of success if you work from within a preconfigured Command Prompt window. Depending on how your computer has been set up there are two possible ways to open this window and you need to find which works in your particular case:<br />
*Method 1<br />
**From '''All Programs''' Navigate into the '''Microsoft Windows SDK V7.1''' program menu<br />
**Click on '''Windows SDK 7.1 Command Prompt'''<br />
*Method 2<br />
**From '''All Programs''' Navigate into the '''Microsoft Visual Studio 2010''' program menu<br />
**Click on '''Microsoft Visual Studio Command Prompt (2010)''' <br />
<br />
{{KBcaution|If you are building with Fmod and have followed the previous Fmod setup instructions AND you are now using a new command window you will need to redo the <code>set AUTOBUILD_CONFIG_FILE{{=}}my_autobuild.xml</code>.}}<br />
<br />
*Run:<br />
autobuild build -c [CONFIGURATION] --no-configure<br />
<br />
There are some useful switches to know about, so your commands may look like this:<br />
autobuild configure -c ReleaseOS -- -DLL_TESTS:BOOL=FALSE -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE<br />
autobuild build -c ReleaseOS --no-configure<br />
<br />
{{KBnote|It is possible to use autobuild to do both the configure step (only needed once) and the build step with one command. I find it is clearer and saves a bit of time if these steps are done separately.}}<br />
<br />
{{KBnote|Do not be alarmed if you see groups of messages with '''warning LNK4099: PDB''' in them.}}<br />
<br />
=== Compiling the viewer with the IDE ===<br />
<br />
The autobuild configure step created the <code>\build-vc100</code> directory at the root of the source tree. In here is the <code>SecondLife.sln</code> solution file.<br />
<br />
Start the IDE and open this solution.<br />
<br />
You might want to change the build type in the drop-down located in the toolbar from '''Debug''' to '''Release''' or '''RelWithDebInfo'''.<br />
<br />
[[File:VS2010BuildType.png|100px]]<br />
[[:File:VS2010BuildType.png|Changing build type example image]]<br />
<br />
You need to adjust the Platform Toolset setting.<br />
* Select all the projects in the Solution Explorer list on the left of the screen.<br />
** Click on the first project and scroll to the bottom of this list and {{K|shift}}-click on the last project.<br />
* Right click on the selected list<br />
* Navigate to '''Properties''' > '''Configuration Properties''' > '''General''' > '''Platform Toolset'''<br />
* Change this value to <code>Windows7.1SDK</code><br />
<br />
* Push {{K|F7}} to start the compiler.<br />
<br />
== Running your newly built viewer ==<br />
=== Running from a desktop shortcut ===<br />
* Make a desktop shortcut for <code>Drive:\your-path\build-vc100\newview\Release\secondlife-bin.exe</code><br />
<br />
* Right-click the shortcut<br />
* Select '''Properties'''<br />
* Set '''Start in:''' to <code>Drive:\your-path\indra\newview</code><br />
<br />
=== Running from within the IDE ===<br />
* In the Solution Explorer pane right click on '''secondlife-bin'''<br />
** Click '''Set as StartUp Project'''<br />
** Pick '''Properties''' > '''Configuration Properties''' > '''Debugging'''<br />
*** Set '''Command''' to <code>Drive:\your-path\build-vc100\newview\Release\secondlife-bin.exe</code><br />
*** Set '''Working Directory''' to <code>..\..\indra\newview</code><br />
<br />
== Handling Problems ==<br />
<br />
If you encounter errors or run into problems following the instructions above, please first check whether someone else already had the same issue. A solution might be known already. See the [[#Common_Issues.2FBugs.2FGlitches_And_Solutions|issue list below]], check [[{{TALKPAGENAME}}|the talk page]] (and report useful experiences there) and search our [[issue tracker]]. Even when no description of your problem has been written down yet, someone might know about it, so get in touch with the community to [[#Getting_help|get help]].<br />
<br />
=== Getting help ===<br />
* Subscribe to [[OpenSource-Dev|OpenSource-Dev Mailing List]] ([https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev subscribe]) and post your question there.<br />
* For faster response, join the general open source viewer discussion and development [[IRC]] channel [irc://irc.freenode.org/opensl #opensl on freenode]. Hopefully a helpful person is online when you ask your question.<br />
<br />
=== Common Issues/Bugs/Glitches And Solutions ===<br />
<br />
==== Not being able to find objidl.h in the Microsoft Windows SDK, when compiling llwindow ====<br />
https://lists.secondlife.com/pipermail/opensource-dev/2011-April/006562.html<br />
* Can be caused by path problems or some installation conflicts with the DirectX SDK.<br />
<br />
==== stdint.h typedef conflicts between Quicktime and VS2010 ====<br />
https://lists.secondlife.com/pipermail/opensource-dev/2011-April/006565.html<br />
*: Can be solved by some small edits to header files to make sure the two don't bash on each other.<br />
<br />
==== Eliminate depreciated switches messages and use memory more efficiently ====<br />
<br />
The VS2010 compiler uses a lot of memory while compiling the viewer. If you run out of memory you will start to page heavily and your compile time will become much longer. The /Zm1000 switch affects compiler memory usage.<br />
<br />
You may see this message while compiling:<br />
use 'EHsc' instead of 'GX'<br />
<br />
Here is how to free up some memory the compiler allocates and to eliminate these messages:<br />
<br />
*Edit <code>\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-cl.cmake</code><br />
<br />
*Replace line 156 with:<br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR")<br />
ENDIF(MSVC10)<br />
<br />
*Replace line 172 with: <br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")<br />
ENDIF(MSVC10)<br />
<br />
*Replace line 184 with:<br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")<br />
ENDIF(MSVC10)<br />
<br />
== References ==<br />
<br />
Tip of the hat to Nicky_Perian for [[User:Nicky_Perian/Visual_Studio_10_Autobuild]]<br />
<br />
[[Category:Compiling viewer]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Viewer_2_Microsoft_Windows_Builds&diff=1151582Viewer 2 Microsoft Windows Builds2011-08-17T18:45:27Z<p>Jenn Linden: Link to instructions at Autobuild#Getting_Autobuild rather than repeating them verbatim.</p>
<hr />
<div>{{multi-lang}}<br />
{{CompileNav}} <br />
<br />
Philosophy: to keep it brief, this page should only include steps we KNOW ARE NEEDED, not random hints. Extra details or open issues can go on the talk page.<br />
<br />
{{KBnote|Following this recipe will probably take 6 to 12 hours of wall-clock time, and 2 to 6 hours of your time, if you're starting from a fresh Windows XP/Vista/7 system.}}<br />
<br />
== Establish your programming environment ==<br />
<br />
This is needed for compiling any viewer based on the LL open source code and only needs to be done once.<br />
<br />
=== Install and update Visual Studio and SDKs ===<br />
<br />
# Install [http://www.microsoft.com/express/download/ Visual Studio 2010] (Express is okay)<br />
#* If you installed VS2010 Express also install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84&displaylang=en Microsoft Visual C++ 2010 Redistributable Package] or [http://www.microsoft.com/download/en/confirmation.aspx?id=14632 64-bit Windows] version.<br />
# Install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=35aeda01-421d-4ba5-b44b-543dc8c33a20 Windows SDK for Windows 7 and .NET Framework 4] (ISO) or [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6B6C21D2-2006-4AFA-9702-529FA782D63B Windows SDK for Windows 7 and .NET Framework 4] (Web Install)<br />
# Install [http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba DirectX SDK (June 2010)]<br />
# Run [http://www.update.microsoft.com/microsoftupdate/v6 Microsoft Update], and keep running it until no updates are needed. This may take 6~8 iterations on older versions of windows.<br />
#* For Windows Vista and Windows 7, you need to select "Get updates from other Microsoft products" to get the updates for Visual Studio. <br />
#* For Windows XP, use the provided link above. The Windows Update menu item on your computer is not the correct updater to use.<br />
#* During the update cycles make sure you have picked up Microsoft Visual Studio 2010 Service Pack 1 [http://go.microsoft.com/fwlink/?LinkId=210710 (ISO)] or [http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=75568aa6-8107-475d-948a-ef22627e57a5 (Web Install)]<br />
<br />
=== Install required development tools ===<br />
<br />
{{KBnote|The order of the following installations should not matter.}}<br />
{{KBnote|If the installer for a particular package does not update your PATH environment variable you will have to do this manually.}}<br />
<br />
# '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])<br />
#* This should be version 2.8.4 (or above in the 2.8.x series).<br />
#*Add the <code>\bin</code> directory to your path.<br />
# '''Python''' (either [http://www.python.org/download/ Standard Python] or [http://www.activestate.com/activepython/downloads ActivePython])<br />
#* Version 2.7.1 works with the build scripts.<br />
# '''Mercurial''' (either [http://tortoisehg.bitbucket.org/ TortoiseHg] or [http://mercurial.selenic.com/ Mercurial Hg])<br />
# '''Cygwin''' ([http://www.cygwin.com/ download Cygwin])<br />
#* When you run the cygwin setup utility make sure you have selected to install '''unzip''' (under "Archives"), '''bison''', '''flex''', '''patchutils''' (all located under "devel"), and '''curl''' (under "Web"), which are not part of the default install. Do not install Cygwin Python or Mercurial. You won't need to use the Cygwin shell for anything.<br />
#*Add the <code>cygwin\bin</code> directory to the '''very end''' of your path and make sure it stays that way.<br />
<br />
=== Install optional development tools ===<br />
<br />
# [http://code.google.com/p/unsis/downloads/list Unicode NSIS (Nullsoft Scriptable Install System)]<br />
#* This is the package installer used to build <code>Second_Life_<version-code>_LindenDeveloper_Setup.exe</code>. You only need this package if you are going to distribute the viewer you compile or if you want to install it locally.<br />
#: In the [[#Configuring_the_Viewer|Configure VS2010 step]] below you will need to add a line in the '''Executable Directories''' section:<br />
#:* 64 bit systems use <code>%ProgramFiles(x86)%\NSIS\Unicode</code><br />
#:* 32 bit systems use <code>%ProgramFiles%\NSIS\Unicode</code><br />
# [http://notepadplusplus.org/ Notepad++]<br />
#* You need to use an editor that conforms to the [[Coding Standard]]. In particular, you must not check in files with DOS line endings except in very limited circumstances; see [[How to avoid DOS line endings in Windows tools]].<br />
<br />
=== Install Autobuild ===<br />
* Follow the directions at [[Autobuild#Getting_Autobuild|Getting Autobuild]] to install Autobuild<br />
* Add an environment variable, so that autobuild doesn't default to using (or trying) older compiler versions:<br />
** Right-click "My Computer" and select '''Properties'''.<br />
** When the Properties dialog opens, click the '''Advanced''' tab followed by the '''Environmental Variables''' button. This will open a new window with a list of System and User variables.<br />
** In the User section, click '''New'''. Set '''Variable Name''' to AUTOBUILD_VSVER and set '''Variable Value''' to 100.<br />
** Click the OK/Close buttons to close all the windows.<br />
<br />
=== Configure VC2010 ===<br />
While you may choose to use autobuild for all your compiling you still need to establish certain settings internal to VC2010.<br />
<br />
*Start the IDE<br />
<br />
*Navigate to '''Tools''' > '''Options''' > '''Projects and Solutions''' > '''Build and Run''' and set '''maximum number of parallel projects builds''' to <code>1</code>.<br />
<br />
* (VC Express only) Enable '''Tools''' > '''Settings''' > '''Expert Settings''' to get the '''Build''' (and other) menus. If you already have a '''Build''' menu you do not need to perform this step.<br />
<br />
{{KBnote|The following steps require an open visual studio project. It does not matter which project you use, as you will only change some global settings used by all projects when they are opened. The open project itself won't be changed.}}<br />
<br />
You need to set a number of paths. <br />
* Open any existing project you may have or make a New Project.<br />
<br />
At the bottom on the Solution Explorer you will see three tabs.<br />
*Click the one on the right labeled '''Property Manager'''. (The name may be somewhat truncated.)<br />
<br />
[[File:VS2010_Property_Manager.PNG|100px]]<br />
[[:File:VS2010_Property_Manager.PNG|Example image]]<br />
<br />
*On the left side click to expand any project and then click again to expand the '''Release''' folder.<br />
<br />
[[File:VS2010_Project_Config.PNG|100px]]<br />
[[:File:VS2010_Project_Config.PNG|Example image]]<br />
<br />
*Right click on '''Microsoft.Cpp.Win32.user'''.<br />
<br />
*Pick '''Properties''' > '''VC++ Directories'''.<br />
<br />
This is where the build environment is pulled together into a functional VC2010 build system and also where much hand wringing, hair pulling, and fist pounding frustration takes place.<br />
<br />
*Set '''Executable Directories''' to:<br />
<br />
$(ExecutablePath)<br />
$(DXSDK_DIR)<br />
$(WindowsSdkDir)\Bin<br />
C:\cygwin\bin<br />
$(SystemRoot)<br />
<br />
[[File:32BitExecutableDirectories.png|100px]]<br />
[[:File:32BitExecutableDirectories.png|32 bit Executable Directories example image]]<br />
<br />
*Set '''Include Directories''' to:<br />
<br />
$(WindowsSdkDir)\Include<br />
$(WindowsSdkDir)\Include\gl<br />
$(DXSDK_DIR)\Include<br />
<br />
[[File:32BitIncludeDirectories.png|100px]]<br />
[[:File:32BitIncludeDirectories.png|32 bit Include Directories example image]]<br />
<br />
*Set '''Library Directories''' to:<br />
<br />
$(WindowsSdkDir)\Lib<br />
$(DXSDK_DIR)<br />
<br />
[[File:32BitLibraryDirectories.png|100px]]<br />
[[:File:32BitLibraryDirectories.png|32 bit Library Directories example image]]<br />
<br />
== Set up your source code tree ==<br />
<br />
Plan your directory structure ahead of time. If you are going to be producing changes or patches you will be cloning a copy of an unaltered source code tree for every change or patch you make, so you might want to have all this work stored in it's own directory.<br />
<br />
To get a copy of the source code tree:<br />
* Open up a DOS Command window<br />
* CD to where you want to install viewer-development. Do not have any spaces in this path.<br />
* Do:<br />
hg clone <nowiki>http://hg.secondlife.com/viewer-development</nowiki><br />
<br />
Let's say some time has gone by since you have performed the previous steps and now you want to develop a change or work on a jira. You will update your clean local repository with all the changes committed to viewer-development since you last synchronized your files:<br />
* CD into <code>viewer-development</code><br />
* Do:<br />
hg pull -u<br />
<br />
* Move up one level from <code>viewer-development</code><br />
* Do:<br />
hg clone viewer-development VWR-nnnnn<br />
Note: <code>nnnnn</code> is the jira number. You can also clone to a name of your choosing if you are making changes not associated with the LL jira system.<br />
<br />
== Prepare third party libraries ==<br />
Most third party libraries needed to build the viewer will be automatically downloaded for you and installed into the build directory within your source tree during the [[#Configuring_the_Viewer|configuration step]] below. Some few need to be manually set up, though, when using an open source developer configuration (<code>Release'''OS'''</code>, <code>RelWithDebInfo'''OS'''</code> or <code>Debug'''OS'''</code>)<br />
<br />
=== Fmod method 1 (using autobuild) ===<br />
<br />
CD to where you want to install the 3p-fmod repository and do:<br />
hg clone <nowiki>https://bitbucket.org/lindenlab/3p-fmod</nowiki><br />
<br />
CD into the <code>3p-fmod</code> directory you created and build it:<br />
autobuild build --all<br />
<br />
Package the results:<br />
autobuild package <br />
<br />
Update autobuild with the filename and hash just displayed. CD to the directory where you cloned viewer-development and do:<br />
<br />
copy autobuild.xml my_autobuild.xml<br />
set AUTOBUILD_CONFIG_FILE=my_autobuild.xml<br />
autobuild installables edit fmod platform=windows hash=<hash> url=file:///<fmod-filespec><br />
<br />
Example:<br />
<br />
copy autobuild.xml my_autobuild.xml<br />
autobuild installables edit fmod platform=windows hash=0f196f00e7dff49f22252efb68525658 url=file:///C:/3p-fmod/fmod-3.75-windows-20110531.tar.bz2<br />
<br />
{{KBnote|Having to copy <code>autobuild.xml</code> and modify the copy from within a cloned repository is a lot of work for every repository you make, but this is the only way to guarantee you pick up upstream changes to <code>autobuild.xml</code> and do not send up a modified <code>autobuild.xml</code> when you do an hg push.}}<br />
<br />
=== Fmod method 2 (using switches) ===<br />
[To be written up]<br />
<br />
== Configuring the Viewer ==<br />
<br />
Fmod is the audio library the viewer uses. If you are compiling with Fmod you will need to do:<br />
set AUTOBUILD_CONFIG_FILE=my_autobuild.xml<br />
<br />
At the command line in the source tree's root directory (presumably a directory you have cloned from viewer-development, as it is not a good idea to work in viewer-development, unless you are only compiling for youself) e.g. <code>C:\linden\VWR-12345\</code>) run:<br />
autobuild configure -c [CONFIGURATION]<br />
where <code>[CONFIGURATION]</code> is one of those listed at [[Building the Viewer with Autobuild#Build a desired configuration]] (<code>ReleaseOS</code>, <code>RelWithDebInfoOS</code>, <code>DebugOS</code>)<br />
<br />
=== Configuration Switches ===<br />
There are a number of switches you can use to modify the configuration process. The name of each switch is followed by its type and then by the value you want to set.<br />
<br />
* '''FMOD''' (bool) controls if the Fmod package is incorporated into the viewer. You must have performed the Fmod installation steps in [[Viewer_2_Microsoft_Windows_Builds#Fmod_method_1_.28using_autobuild.29]] for this to work.<br />
* '''LL_TESTS''' (bool) controls if the tests are compiled and run. There are quite a lot of them so excluding them is recommended unless you have some reason to need one or more of them.<br />
* '''PACKAGE''' (bool) controls if the package step is run. You must have installed NSIS described in [[Viewer_2_Microsoft_Windows_Builds#Install_optional_development_tools]] for this to work.<br />
<br />
{{KBnote|'''OFF''' and '''NO''' are the same as '''FALSE'''; anything else is considered to be '''TRUE'''.}}<br />
<br />
Example: <br />
autobuild configure -c ReleaseOS -- -DLL_TESTS:BOOL=FALSE -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE<br />
<br />
== Compiling the Viewer ==<br />
=== Compiling the viewer with autobuild ===<br />
You can compile the viewer with either autobuild (the encouraged/supported method) or with the VS IDE.<br />
<br />
When compiling with autobuild you will have the best chance of success if you work from within a preconfigured Command Prompt window. Depending on how your computer has been set up there are two possible ways to open this window and you need to find which works in your particular case:<br />
*Method 1<br />
**From '''All Programs''' Navigate into the '''Microsoft Windows SDK V7.1''' program menu<br />
**Click on '''Windows SDK 7.1 Command Prompt'''<br />
*Method 2<br />
**From '''All Programs''' Navigate into the '''Microsoft Visual Studio 2010''' program menu<br />
**Click on '''Microsoft Visual Studio Command Prompt (2010)''' <br />
<br />
{{KBcaution|If you are building with Fmod and have followed the previous Fmod setup instructions AND you are now using a new command window you will need to redo the <code>set AUTOBUILD_CONFIG_FILE{{=}}my_autobuild.xml</code>.}}<br />
<br />
*Run:<br />
autobuild build -c [CONFIGURATION] --no-configure<br />
<br />
There are some useful switches to know about, so your commands may look like this:<br />
autobuild configure -c ReleaseOS -- -DLL_TESTS:BOOL=FALSE -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE<br />
autobuild build -c ReleaseOS --no-configure<br />
<br />
{{KBnote|It is possible to use autobuild to do both the configure step (only needed once) and the build step with one command. I find it is clearer and saves a bit of time if these steps are done separately.}}<br />
<br />
{{KBnote|Do not be alarmed if you see groups of messages with '''warning LNK4099: PDB''' in them.}}<br />
<br />
=== Compiling the viewer with the IDE ===<br />
<br />
The autobuild configure step created the <code>\build-vc100</code> directory at the root of the source tree. In here is the <code>SecondLife.sln</code> solution file.<br />
<br />
Start the IDE and open this solution.<br />
<br />
You might want to change the build type in the drop-down located in the toolbar from '''Debug''' to '''Release''' or '''RelWithDebInfo'''.<br />
<br />
[[File:VS2010BuildType.png|100px]]<br />
[[:File:VS2010BuildType.png|Changing build type example image]]<br />
<br />
You need to adjust the Platform Toolset setting.<br />
* Select all the projects in the Solution Explorer list on the left of the screen.<br />
** Click on the first project and scroll to the bottom of this list and {{K|shift}}-click on the last project.<br />
* Right click on the selected list<br />
* Navigate to '''Properties''' > '''Configuration Properties''' > '''General''' > '''Platform Toolset'''<br />
* Change this value to <code>Windows7.1SDK</code><br />
<br />
* Push {{K|F7}} to start the compiler.<br />
<br />
== Running your newly built viewer ==<br />
=== Running from a desktop shortcut ===<br />
* Make a desktop shortcut for <code>Drive:\your-path\build-vc100\newview\Release\secondlife-bin.exe</code><br />
<br />
* Right-click the shortcut<br />
* Select '''Properties'''<br />
* Set '''Start in:''' to <code>Drive:\your-path\indra\newview</code><br />
<br />
=== Running from within the IDE ===<br />
* In the Solution Explorer pane right click on '''secondlife-bin'''<br />
** Click '''Set as StartUp Project'''<br />
** Pick '''Properties''' > '''Configuration Properties''' > '''Debugging'''<br />
*** Set '''Command''' to <code>Drive:\your-path\build-vc100\newview\Release\secondlife-bin.exe</code><br />
*** Set '''Working Directory''' to <code>..\..\indra\newview</code><br />
<br />
== Handling Problems ==<br />
<br />
If you encounter errors or run into problems following the instructions above, please first check whether someone else already had the same issue. A solution might be known already. See the [[#Common_Issues.2FBugs.2FGlitches_And_Solutions|issue list below]], check [[{{TALKPAGENAME}}|the talk page]] (and report useful experiences there) and search our [[issue tracker]]. Even when no description of your problem has been written down yet, someone might know about it, so get in touch with the community to [[#Getting_help|get help]].<br />
<br />
=== Getting help ===<br />
* Subscribe to [[OpenSource-Dev|OpenSource-Dev Mailing List]] ([https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev subscribe]) and post your question there.<br />
* For faster response, join the general open source viewer discussion and development [[IRC]] channel [irc://irc.freenode.org/opensl #opensl on freenode]. Hopefully a helpful person is online when you ask your question.<br />
<br />
=== Common Issues/Bugs/Glitches And Solutions ===<br />
<br />
==== Not being able to find objidl.h in the Microsoft Windows SDK, when compiling llwindow ====<br />
https://lists.secondlife.com/pipermail/opensource-dev/2011-April/006562.html<br />
* Can be caused by path problems or some installation conflicts with the DirectX SDK.<br />
<br />
==== stdint.h typedef conflicts between Quicktime and VS2010 ====<br />
https://lists.secondlife.com/pipermail/opensource-dev/2011-April/006565.html<br />
*: Can be solved by some small edits to header files to make sure the two don't bash on each other.<br />
<br />
==== Eliminate depreciated switches messages and use memory more efficiently ====<br />
<br />
The VS2010 compiler uses a lot of memory while compiling the viewer. If you run out of memory you will start to page heavily and your compile time will become much longer. The /Zm1000 switch affects compiler memory usage.<br />
<br />
You may see this message while compiling:<br />
use 'EHsc' instead of 'GX'<br />
<br />
Here is how to free up some memory the compiler allocates and to eliminate these messages:<br />
<br />
*Edit <code>\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-cl.cmake</code><br />
<br />
*Replace line 156 with:<br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR")<br />
ENDIF(MSVC10)<br />
<br />
*Replace line 172 with: <br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")<br />
ENDIF(MSVC10)<br />
<br />
*Replace line 184 with:<br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")<br />
ENDIF(MSVC10)<br />
<br />
== References ==<br />
<br />
Tip of the hat to Nicky_Perian for [[User:Nicky_Perian/Visual_Studio_10_Autobuild]]<br />
<br />
[[Category:Compiling viewer]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Autobuild&diff=1151581Autobuild2011-08-17T18:38:31Z<p>Jenn Linden: </p>
<hr />
<div>{{Autobuild Nav}}<br />
<br />
== Overview ==<br />
Autobuild is a framework for maintaining and building libraries. It acts as director providing a common interface to build and package libraries, but it is not a build system like make or cmake. You will still need platform-specific make, cmake, or project files to configure and build your library. Autobuild will, however, allow you invoke these commands and package the product with a common interface. <br />
<br />
{{KBcaution|Linden Lab Autobuild is not the same as or derived from [http://josefsson.org/autobuild/ GNU Autobuild], but they are similar enough to cause confusion.}}<br />
<br />
For Linden old hands: Autobuild is designed as a replacement for the old [https://svn.lindenlab.com/svn/lindenlib/trunk lindenlib] policies; doing the right thing so you don't have to.<br />
<br />
== Getting Autobuild ==<br />
<br />
Autobuild is under active development, so it's recommended that you get the latest version and keep it up to date.<br />
<br />
Inside a DOS command window:<br />
* CD to where you want to install autobuild. Do not have any spaces in the path to this directory.<br />
* Do:<br />
hg clone <nowiki>http://hg.secondlife.com/autobuild</nowiki><br />
* Modify your path statement to include the autobuild <code>\bin</code> directory<br />
<br />
== Running Autobuild == <br />
<br />
=== Building the Viewer ===<br />
<br />
Windows users see: [[Viewer_2_Microsoft_Windows_Builds]]<br />
<br />
Everyone else see: [[Building the Viewer with Autobuild]] (these instructions may still be in a rough form)<br />
<br />
=== Changing or Adding Build Configuration Details ===<br />
Usage:<br />
{{Syntax|autobuild ''options'' ''sub-command''<br />
}}<br />
<br />
Supply zero or more options, and one sub-command.<br />
<br />
'''Options''':<br />
{|border="1" class="lltable"<br />
<br />
|--<br />
! Option<br />
! Description <br />
<br />
|--<br />
| --debug<br />
| Display debug information<br />
<br />
|--<br />
| --dry-run<br />
| Run tool in dry run mode if available<br />
<br />
|--<br />
| --help&nbsp;[''command'']<br />
| Find all valid Autobuild tools and show help<br />
<br />
|--<br />
| --quiet<br />
| Display minimal output<br />
<br />
|--<br />
| --verbose<br />
| Display verbose output<br />
<br />
|--<br />
| -V, --version<br />
| Show version information<br />
<br />
|}<br />
<br />
'''Sub-commands'''<br />
{| class=lltable border=1<br />
|--<br />
! Sub-command<br />
! Description<br />
|--<br />
| [[autobuild build|build]]<br />
| Build platform targets.<br />
|--<br />
| [[autobuild configure|configure]]<br />
| Configure platform targets.<br />
|--<br />
| [[autobuild edit|edit]]<br />
| Manage build and package configuration.<br />
|--<br />
| [[autobuild install|install]]<br />
| Fetch and install package archives.<br />
|--<br />
| [[autobuild installables|installables]]<br />
| Manipulate installable package entries in the autobuild configuration.<br />
|--<br />
| [[autobuild manifest|manifest]]<br />
| Manipulate manifest entries to the autobuild configuration.<br />
|--<br />
| [[autobuild package|package]]<br />
| Create an archive of build output.<br />
|--<br />
| [[autobuild print|print]]<br />
| Print configuration.<br />
|--<br />
| [[autobuild source_environment|source_environment]]<br />
| Print the shell environment Autobuild-based build scripts to use (by calling 'eval').<br />
|--<br />
| [[autobuild uninstall|uninstall]]<br />
| Uninstall package archives.<br />
|--<br />
| [[autobuild upload|upload]]<br />
| Upload tool for autobuild <br />
|}<br />
<br />
===Background and Tutorials===<br />
<br />
; [[Autobuild How To]]<br />
: A tutorial introduction to using autobuild<br />
; [[Autobuild Lexicon]]<br />
: A list of terms and how they are used in the context of autobuild<br />
; [[Autobuild Package Layout]]<br />
: Describes the standard directory tree for packages managed with autobuild<br />
; [[Autobuild Quick Start]]<br />
: A basic walkthrough of how to add autobuild management to an existing software project<br />
; [[Autobuild Class Model]]<br />
: Describes the fundamental objects in the autobuild design and the relationships between them.<br />
; [[Autobuild Package Examples|Autobuild Examples]]<br />
: Links to packages built with autobuild.<br />
; [[Build Script Anatomy]]<br />
: An annotated build script typical of those used to build third party libraries.<br />
; [[Autobuild Shell Functions]]<br />
: A description of all shell functions provided by Autobuild for use in build scripts.<br />
<br />
== Contributing to Autobuild ==<br />
<br />
Autobuild is open source. Improvements are most welcome. <br />
<br />
* Discussion of and help with Autobuild are available on the [https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev opensource-dev mailing list] and the [irc://irc.freenode.org/%23opensl #opensl channel on the freenode.org IRC network].<br />
* Bug reports and feature suggestions are tracked in the [https://jira.secondlife.com/browse/OPEN Open Development project on jira.secondlife.com].<br />
** Suggested patches for issues from the jira are reviewed on our [https://codereview.secondlife.com code review system] (see [[Code Review Tool|the documentation on how to use it]]).<br />
** Testing procedures for patch submissions are documented here: [[Autobuild/Integration]]<br />
<br />
[[Category:Autobuild]] [[Category:Open Source Portal]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Viewer_2_Microsoft_Windows_Builds&diff=1151580Viewer 2 Microsoft Windows Builds2011-08-17T18:26:50Z<p>Jenn Linden: indicate full default path for cygwin bin directory</p>
<hr />
<div>{{multi-lang}}<br />
{{CompileNav}} <br />
<br />
Philosophy: to keep it brief, this page should only include steps we KNOW ARE NEEDED, not random hints. Extra details or open issues can go on the talk page.<br />
<br />
{{KBnote|Following this recipe will probably take 6 to 12 hours of wall-clock time, and 2 to 6 hours of your time, if you're starting from a fresh Windows XP/Vista/7 system.}}<br />
<br />
== Establish your programming environment ==<br />
<br />
This is needed for compiling any viewer based on the LL open source code and only needs to be done once.<br />
<br />
=== Install and update Visual Studio and SDKs ===<br />
<br />
# Install [http://www.microsoft.com/express/download/ Visual Studio 2010] (Express is okay)<br />
#* If you installed VS2010 Express also install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84&displaylang=en Microsoft Visual C++ 2010 Redistributable Package] or [http://www.microsoft.com/download/en/confirmation.aspx?id=14632 64-bit Windows] version.<br />
# Install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=35aeda01-421d-4ba5-b44b-543dc8c33a20 Windows SDK for Windows 7 and .NET Framework 4] (ISO) or [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6B6C21D2-2006-4AFA-9702-529FA782D63B Windows SDK for Windows 7 and .NET Framework 4] (Web Install)<br />
# Install [http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba DirectX SDK (June 2010)]<br />
# Run [http://www.update.microsoft.com/microsoftupdate/v6 Microsoft Update], and keep running it until no updates are needed. This may take 6~8 iterations on older versions of windows.<br />
#* For Windows Vista and Windows 7, you need to select "Get updates from other Microsoft products" to get the updates for Visual Studio. <br />
#* For Windows XP, use the provided link above. The Windows Update menu item on your computer is not the correct updater to use.<br />
#* During the update cycles make sure you have picked up Microsoft Visual Studio 2010 Service Pack 1 [http://go.microsoft.com/fwlink/?LinkId=210710 (ISO)] or [http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=75568aa6-8107-475d-948a-ef22627e57a5 (Web Install)]<br />
<br />
=== Install required development tools ===<br />
<br />
{{KBnote|The order of the following installations should not matter.}}<br />
{{KBnote|If the installer for a particular package does not update your PATH environment variable you will have to do this manually.}}<br />
<br />
# '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])<br />
#* This should be version 2.8.4 (or above in the 2.8.x series).<br />
#*Add the <code>\bin</code> directory to your path.<br />
# '''Python''' (either [http://www.python.org/download/ Standard Python] or [http://www.activestate.com/activepython/downloads ActivePython])<br />
#* Version 2.7.1 works with the build scripts.<br />
# '''Mercurial''' (either [http://tortoisehg.bitbucket.org/ TortoiseHg] or [http://mercurial.selenic.com/ Mercurial Hg])<br />
# '''Cygwin''' ([http://www.cygwin.com/ download Cygwin])<br />
#* When you run the cygwin setup utility make sure you have selected to install '''unzip''' (under "Archives"), '''bison''', '''flex''', '''patchutils''' (all located under "devel"), and '''curl''' (under "Web"), which are not part of the default install. Do not install Cygwin Python or Mercurial. You won't need to use the Cygwin shell for anything.<br />
#*Add the <code>cygwin\bin</code> directory to the '''very end''' of your path and make sure it stays that way.<br />
<br />
=== Install optional development tools ===<br />
<br />
# [http://code.google.com/p/unsis/downloads/list Unicode NSIS (Nullsoft Scriptable Install System)]<br />
#* This is the package installer used to build <code>Second_Life_<version-code>_LindenDeveloper_Setup.exe</code>. You only need this package if you are going to distribute the viewer you compile or if you want to install it locally.<br />
#: In the [[#Configuring_the_Viewer|Configure VS2010 step]] below you will need to add a line in the '''Executable Directories''' section:<br />
#:* 64 bit systems use <code>%ProgramFiles(x86)%\NSIS\Unicode</code><br />
#:* 32 bit systems use <code>%ProgramFiles%\NSIS\Unicode</code><br />
# [http://notepadplusplus.org/ Notepad++]<br />
#* You need to use an editor that conforms to the [[Coding Standard]]. In particular, you must not check in files with DOS line endings except in very limited circumstances; see [[How to avoid DOS line endings in Windows tools]].<br />
<br />
=== Install Autobuild ===<br />
* Open up a DOS Command window<br />
* CD to where you want to install autobuild. Do not have any spaces in the path to this directory.<br />
* Do:<br />
hg clone <nowiki>http://hg.secondlife.com/autobuild</nowiki><br />
* Modify your path statement to include the autobuild <code>\bin</code> directory<br />
* Add an environment variable, so that autobuild doesn't default to using (or trying) VC 2003.<br />
** Find a "My Computer" icon, there are several ways to do this, which vary depending on which version of Windows you are using. Usually you can find one through the '''Start''' menu button or on your desktop.<br />
** Right-click the icon and select '''Properties'''.<br />
** When the Properties dialog opens, click the '''Advanced''' tab followed by the '''Environmental Variables''' button. This will open a new window with a list of System and User variables.<br />
** In the User section, click '''New'''. Set '''Variable Name''' to AUTOBUILD_VSVER and set '''Variable Value''' to 100.<br />
** Click the OK/Close buttons to close all the windows.<br />
<br />
=== Configure VC2010 ===<br />
While you may choose to use autobuild for all your compiling you still need to establish certain settings internal to VC2010.<br />
<br />
*Start the IDE<br />
<br />
*Navigate to '''Tools''' > '''Options''' > '''Projects and Solutions''' > '''Build and Run''' and set '''maximum number of parallel projects builds''' to <code>1</code>.<br />
<br />
* (VC Express only) Enable '''Tools''' > '''Settings''' > '''Expert Settings''' to get the '''Build''' (and other) menus. If you already have a '''Build''' menu you do not need to perform this step.<br />
<br />
{{KBnote|The following steps require an open visual studio project. It does not matter which project you use, as you will only change some global settings used by all projects when they are opened. The open project itself won't be changed.}}<br />
<br />
You need to set a number of paths. <br />
* Open any existing project you may have or make a New Project.<br />
<br />
At the bottom on the Solution Explorer you will see three tabs.<br />
*Click the one on the right labeled '''Property Manager'''. (The name may be somewhat truncated.)<br />
<br />
[[File:VS2010_Property_Manager.PNG|100px]]<br />
[[:File:VS2010_Property_Manager.PNG|Example image]]<br />
<br />
*On the left side click to expand any project and then click again to expand the '''Release''' folder.<br />
<br />
[[File:VS2010_Project_Config.PNG|100px]]<br />
[[:File:VS2010_Project_Config.PNG|Example image]]<br />
<br />
*Right click on '''Microsoft.Cpp.Win32.user'''.<br />
<br />
*Pick '''Properties''' > '''VC++ Directories'''.<br />
<br />
This is where the build environment is pulled together into a functional VC2010 build system and also where much hand wringing, hair pulling, and fist pounding frustration takes place.<br />
<br />
*Set '''Executable Directories''' to:<br />
<br />
$(ExecutablePath)<br />
$(DXSDK_DIR)<br />
$(WindowsSdkDir)\Bin<br />
C:\cygwin\bin<br />
$(SystemRoot)<br />
<br />
[[File:32BitExecutableDirectories.png|100px]]<br />
[[:File:32BitExecutableDirectories.png|32 bit Executable Directories example image]]<br />
<br />
*Set '''Include Directories''' to:<br />
<br />
$(WindowsSdkDir)\Include<br />
$(WindowsSdkDir)\Include\gl<br />
$(DXSDK_DIR)\Include<br />
<br />
[[File:32BitIncludeDirectories.png|100px]]<br />
[[:File:32BitIncludeDirectories.png|32 bit Include Directories example image]]<br />
<br />
*Set '''Library Directories''' to:<br />
<br />
$(WindowsSdkDir)\Lib<br />
$(DXSDK_DIR)<br />
<br />
[[File:32BitLibraryDirectories.png|100px]]<br />
[[:File:32BitLibraryDirectories.png|32 bit Library Directories example image]]<br />
<br />
== Set up your source code tree ==<br />
<br />
Plan your directory structure ahead of time. If you are going to be producing changes or patches you will be cloning a copy of an unaltered source code tree for every change or patch you make, so you might want to have all this work stored in it's own directory.<br />
<br />
To get a copy of the source code tree:<br />
* Open up a DOS Command window<br />
* CD to where you want to install viewer-development. Do not have any spaces in this path.<br />
* Do:<br />
hg clone <nowiki>http://hg.secondlife.com/viewer-development</nowiki><br />
<br />
Let's say some time has gone by since you have performed the previous steps and now you want to develop a change or work on a jira. You will update your clean local repository with all the changes committed to viewer-development since you last synchronized your files:<br />
* CD into <code>viewer-development</code><br />
* Do:<br />
hg pull -u<br />
<br />
* Move up one level from <code>viewer-development</code><br />
* Do:<br />
hg clone viewer-development VWR-nnnnn<br />
Note: <code>nnnnn</code> is the jira number. You can also clone to a name of your choosing if you are making changes not associated with the LL jira system.<br />
<br />
== Prepare third party libraries ==<br />
Most third party libraries needed to build the viewer will be automatically downloaded for you and installed into the build directory within your source tree during the [[#Configuring_the_Viewer|configuration step]] below. Some few need to be manually set up, though, when using an open source developer configuration (<code>Release'''OS'''</code>, <code>RelWithDebInfo'''OS'''</code> or <code>Debug'''OS'''</code>)<br />
<br />
=== Fmod method 1 (using autobuild) ===<br />
<br />
CD to where you want to install the 3p-fmod repository and do:<br />
hg clone <nowiki>https://bitbucket.org/lindenlab/3p-fmod</nowiki><br />
<br />
CD into the <code>3p-fmod</code> directory you created and build it:<br />
autobuild build --all<br />
<br />
Package the results:<br />
autobuild package <br />
<br />
Update autobuild with the filename and hash just displayed. CD to the directory where you cloned viewer-development and do:<br />
<br />
copy autobuild.xml my_autobuild.xml<br />
set AUTOBUILD_CONFIG_FILE=my_autobuild.xml<br />
autobuild installables edit fmod platform=windows hash=<hash> url=file:///<fmod-filespec><br />
<br />
Example:<br />
<br />
copy autobuild.xml my_autobuild.xml<br />
autobuild installables edit fmod platform=windows hash=0f196f00e7dff49f22252efb68525658 url=file:///C:/3p-fmod/fmod-3.75-windows-20110531.tar.bz2<br />
<br />
{{KBnote|Having to copy <code>autobuild.xml</code> and modify the copy from within a cloned repository is a lot of work for every repository you make, but this is the only way to guarantee you pick up upstream changes to <code>autobuild.xml</code> and do not send up a modified <code>autobuild.xml</code> when you do an hg push.}}<br />
<br />
=== Fmod method 2 (using switches) ===<br />
[To be written up]<br />
<br />
== Configuring the Viewer ==<br />
<br />
Fmod is the audio library the viewer uses. If you are compiling with Fmod you will need to do:<br />
set AUTOBUILD_CONFIG_FILE=my_autobuild.xml<br />
<br />
At the command line in the source tree's root directory (presumably a directory you have cloned from viewer-development, as it is not a good idea to work in viewer-development, unless you are only compiling for youself) e.g. <code>C:\linden\VWR-12345\</code>) run:<br />
autobuild configure -c [CONFIGURATION]<br />
where <code>[CONFIGURATION]</code> is one of those listed at [[Building the Viewer with Autobuild#Build a desired configuration]] (<code>ReleaseOS</code>, <code>RelWithDebInfoOS</code>, <code>DebugOS</code>)<br />
<br />
=== Configuration Switches ===<br />
There are a number of switches you can use to modify the configuration process. The name of each switch is followed by its type and then by the value you want to set.<br />
<br />
* '''FMOD''' (bool) controls if the Fmod package is incorporated into the viewer. You must have performed the Fmod installation steps in [[Viewer_2_Microsoft_Windows_Builds#Fmod_method_1_.28using_autobuild.29]] for this to work.<br />
* '''LL_TESTS''' (bool) controls if the tests are compiled and run. There are quite a lot of them so excluding them is recommended unless you have some reason to need one or more of them.<br />
* '''PACKAGE''' (bool) controls if the package step is run. You must have installed NSIS described in [[Viewer_2_Microsoft_Windows_Builds#Install_optional_development_tools]] for this to work.<br />
<br />
{{KBnote|'''OFF''' and '''NO''' are the same as '''FALSE'''; anything else is considered to be '''TRUE'''.}}<br />
<br />
Example: <br />
autobuild configure -c ReleaseOS -- -DLL_TESTS:BOOL=FALSE -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE<br />
<br />
== Compiling the Viewer ==<br />
=== Compiling the viewer with autobuild ===<br />
You can compile the viewer with either autobuild (the encouraged/supported method) or with the VS IDE.<br />
<br />
When compiling with autobuild you will have the best chance of success if you work from within a preconfigured Command Prompt window. Depending on how your computer has been set up there are two possible ways to open this window and you need to find which works in your particular case:<br />
*Method 1<br />
**From '''All Programs''' Navigate into the '''Microsoft Windows SDK V7.1''' program menu<br />
**Click on '''Windows SDK 7.1 Command Prompt'''<br />
*Method 2<br />
**From '''All Programs''' Navigate into the '''Microsoft Visual Studio 2010''' program menu<br />
**Click on '''Microsoft Visual Studio Command Prompt (2010)''' <br />
<br />
{{KBcaution|If you are building with Fmod and have followed the previous Fmod setup instructions AND you are now using a new command window you will need to redo the <code>set AUTOBUILD_CONFIG_FILE{{=}}my_autobuild.xml</code>.}}<br />
<br />
*Run:<br />
autobuild build -c [CONFIGURATION] --no-configure<br />
<br />
There are some useful switches to know about, so your commands may look like this:<br />
autobuild configure -c ReleaseOS -- -DLL_TESTS:BOOL=FALSE -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE<br />
autobuild build -c ReleaseOS --no-configure<br />
<br />
{{KBnote|It is possible to use autobuild to do both the configure step (only needed once) and the build step with one command. I find it is clearer and saves a bit of time if these steps are done separately.}}<br />
<br />
{{KBnote|Do not be alarmed if you see groups of messages with '''warning LNK4099: PDB''' in them.}}<br />
<br />
=== Compiling the viewer with the IDE ===<br />
<br />
The autobuild configure step created the <code>\build-vc100</code> directory at the root of the source tree. In here is the <code>SecondLife.sln</code> solution file.<br />
<br />
Start the IDE and open this solution.<br />
<br />
You might want to change the build type in the drop-down located in the toolbar from '''Debug''' to '''Release''' or '''RelWithDebInfo'''.<br />
<br />
[[File:VS2010BuildType.png|100px]]<br />
[[:File:VS2010BuildType.png|Changing build type example image]]<br />
<br />
You need to adjust the Platform Toolset setting.<br />
* Select all the projects in the Solution Explorer list on the left of the screen.<br />
** Click on the first project and scroll to the bottom of this list and {{K|shift}}-click on the last project.<br />
* Right click on the selected list<br />
* Navigate to '''Properties''' > '''Configuration Properties''' > '''General''' > '''Platform Toolset'''<br />
* Change this value to <code>Windows7.1SDK</code><br />
<br />
* Push {{K|F7}} to start the compiler.<br />
<br />
== Running your newly built viewer ==<br />
=== Running from a desktop shortcut ===<br />
* Make a desktop shortcut for <code>Drive:\your-path\build-vc100\newview\Release\secondlife-bin.exe</code><br />
<br />
* Right-click the shortcut<br />
* Select '''Properties'''<br />
* Set '''Start in:''' to <code>Drive:\your-path\indra\newview</code><br />
<br />
=== Running from within the IDE ===<br />
* In the Solution Explorer pane right click on '''secondlife-bin'''<br />
** Click '''Set as StartUp Project'''<br />
** Pick '''Properties''' > '''Configuration Properties''' > '''Debugging'''<br />
*** Set '''Command''' to <code>Drive:\your-path\build-vc100\newview\Release\secondlife-bin.exe</code><br />
*** Set '''Working Directory''' to <code>..\..\indra\newview</code><br />
<br />
== Handling Problems ==<br />
<br />
If you encounter errors or run into problems following the instructions above, please first check whether someone else already had the same issue. A solution might be known already. See the [[#Common_Issues.2FBugs.2FGlitches_And_Solutions|issue list below]], check [[{{TALKPAGENAME}}|the talk page]] (and report useful experiences there) and search our [[issue tracker]]. Even when no description of your problem has been written down yet, someone might know about it, so get in touch with the community to [[#Getting_help|get help]].<br />
<br />
=== Getting help ===<br />
* Subscribe to [[OpenSource-Dev|OpenSource-Dev Mailing List]] ([https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev subscribe]) and post your question there.<br />
* For faster response, join the general open source viewer discussion and development [[IRC]] channel [irc://irc.freenode.org/opensl #opensl on freenode]. Hopefully a helpful person is online when you ask your question.<br />
<br />
=== Common Issues/Bugs/Glitches And Solutions ===<br />
<br />
==== Not being able to find objidl.h in the Microsoft Windows SDK, when compiling llwindow ====<br />
https://lists.secondlife.com/pipermail/opensource-dev/2011-April/006562.html<br />
* Can be caused by path problems or some installation conflicts with the DirectX SDK.<br />
<br />
==== stdint.h typedef conflicts between Quicktime and VS2010 ====<br />
https://lists.secondlife.com/pipermail/opensource-dev/2011-April/006565.html<br />
*: Can be solved by some small edits to header files to make sure the two don't bash on each other.<br />
<br />
==== Eliminate depreciated switches messages and use memory more efficiently ====<br />
<br />
The VS2010 compiler uses a lot of memory while compiling the viewer. If you run out of memory you will start to page heavily and your compile time will become much longer. The /Zm1000 switch affects compiler memory usage.<br />
<br />
You may see this message while compiling:<br />
use 'EHsc' instead of 'GX'<br />
<br />
Here is how to free up some memory the compiler allocates and to eliminate these messages:<br />
<br />
*Edit <code>\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-cl.cmake</code><br />
<br />
*Replace line 156 with:<br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR")<br />
ENDIF(MSVC10)<br />
<br />
*Replace line 172 with: <br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")<br />
ENDIF(MSVC10)<br />
<br />
*Replace line 184 with:<br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")<br />
ENDIF(MSVC10)<br />
<br />
== References ==<br />
<br />
Tip of the hat to Nicky_Perian for [[User:Nicky_Perian/Visual_Studio_10_Autobuild]]<br />
<br />
[[Category:Compiling viewer]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Viewer_2_Microsoft_Windows_Builds&diff=1149550Viewer 2 Microsoft Windows Builds2011-07-25T22:03:08Z<p>Jenn Linden: /* Install required development tools */</p>
<hr />
<div>{{multi-lang}}<br />
{{CompileNav}} <br />
<br />
Philosophy: to keep it brief, this page should only include steps we KNOW ARE NEEDED, not random hints. Extra details or open issues can go on the talk page.<br />
<br />
{{KBnote|Following this recipe will probably take 6 to 12 hours of wall-clock time, and 2 to 6 hours of your time, if you're starting from a fresh Windows XP/Vista/7 system.}}<br />
<br />
== Establish your programming environment ==<br />
<br />
This is needed for compiling any viewer based on the LL open source code and only needs to be done once.<br />
<br />
=== Install and update Visual Studio and SDKs ===<br />
<br />
# Install [http://www.microsoft.com/express/download/ Visual Studio 2010] (Express is okay)<br />
#* If you installed VS2010 Express also install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84&displaylang=en Microsoft Visual C++ 2010 Redistributable Package] or [http://www.microsoft.com/download/en/confirmation.aspx?id=14632 64-bit Windows] version.<br />
# Install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=35aeda01-421d-4ba5-b44b-543dc8c33a20 Windows SDK for Windows 7 and .NET Framework 4] (ISO) or [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6B6C21D2-2006-4AFA-9702-529FA782D63B Windows SDK for Windows 7 and .NET Framework 4] (Web Install)<br />
# Install [http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba DirectX SDK (June 2010)]<br />
# Run [http://www.update.microsoft.com/microsoftupdate/v6 Microsoft Update], and keep running it until no updates are needed. This may take 6~8 iterations on older versions of windows.<br />
#* '''Note''': ''For Windows Vista and Windows 7'', you need to select "Get updates from other Microsoft products" to get the updates for Visual Studio. <br />
#* For Windows XP, use the provided link above. The Windows Update menu item on your computer is not the correct updater to use.<br />
#* During the update cycles make sure you have picked up Microsoft Visual Studio 2010 Service Pack 1 [http://go.microsoft.com/fwlink/?LinkId=210710 (ISO)] or [http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=75568aa6-8107-475d-948a-ef22627e57a5 (Web Install)]<br />
<br />
=== Install required development tools ===<br />
<br />
{{KBnote|The order of the following installations should not matter.}}<br />
{{KBnote|If the installer for a particular package does not update your PATH environment variable you will have to do this manually.}}<br />
<br />
# '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])<br />
#* This should be version 2.8.4 (or above in the 2.8.x series).<br />
#*Add the <code>\bin</code> directory to your path.<br />
# '''Python''' (either [http://www.python.org/download/ Standard Python] or [http://www.activestate.com/activepython/downloads ActivePython])<br />
#* Version 2.5.X<br />
#* Later versions may work, but are not officially supported. Version 2.7.1 has been reported to work with the build scripts.<br />
# '''Mercuria'''l (either [http://tortoisehg.bitbucket.org/ TortoiseHg] or [http://mercurial.selenic.com/ Mercurial Hg])<br />
# '''Cygwin''' ([http://www.cygwin.com/ download Cygwin])<br />
#* When you run the cygwin setup utility make sure you have selected to install '''unzip''' (under "Archives"), '''bison''', '''flex''', '''patchutils''' (all located under "devel"), and '''curl''' (under "Web"), which are not part of the default install. Do not install Cygwin Python or Mercurial. You won't need to use the Cygwin shell for anything.<br />
#* '''NOTE:''' '''DO NOT''' use the Cygwin version of CMake, Python, or Mercurial (hg). The Build will fail. (CMake specifically excludes the Cygwin version of Python, in the <code>Python.cmake</code> file)<br />
#*Add the <code>\bin</code> directory to the '''very end''' of your path and make sure it stays that way.<br />
<br />
=== Install optional development tools ===<br />
<br />
# [http://code.google.com/p/unsis/downloads/list Unicode NSIS (Nullsoft Scriptable Install System)]<br />
#* This is the package installer used to build <code>Second_Life_<version-code>_LindenDeveloper_Setup.exe</code>. You only need this package if you are going to distribute the viewer you compile or if you want to install it locally.<br />
#: In the [[#Configuring_the_Viewer|Configure VS2010 step]] below you will need to add a line in the '''Executable Directories''' section:<br />
#:* 64 bit systems use <code>%ProgramFiles(x86)%\NSIS\Unicode</code><br />
#:* 32 bit systems use <code>%ProgramFiles%\NSIS\Unicode</code><br />
# [http://notepadplusplus.org/ Notepad++]<br />
#* You need to use an editor that conforms to the [[Coding Standard]]. In particular, you must not check in files with DOS line endings except in very limited circumstances; see [[How to avoid DOS line endings in Windows tools]].<br />
<br />
=== Install Autobuild ===<br />
* Open up a DOS Command window<br />
* CD to where you want to install autobuild. Do not have any spaces in the path to this directory.<br />
* Do:<br />
hg clone <nowiki>http://hg.secondlife.com/autobuild</nowiki><br />
* Modify your path statement to include the autobuild <code>\bin</code> directory<br />
* Add an environment variable, so that autobuild doesn't default to using (or trying) VC 2003.<br />
** Find a "My Computer" icon, there are several ways to do this, which vary depending on which version of Windows you are using. Usually you can find one through the "Start" menu button or on your desktop.<br />
** Right-click the icon and select "Properties".<br />
** When the Properties dialogue opens, click the "Advanced" tab followed by the "Environmental Variables" button. This will open a new window with a list of System and User variables.<br />
** In the User section, click "New". Your "Variable Name" should be AUTOBUILD_VSVER and the "Variable Value" is 100.<br />
** Click the OK/Close buttons to close all the windows.<br />
<br />
=== Configure VC2010 ===<br />
While you may choose to use autobuild for all your compiling you still need to establish certain settings internal to VC2010.<br />
<br />
*Start the IDE<br />
<br />
*Navigate to '''Tools''' > '''Options''' > '''Projects and Solutions''' > '''Build and Run''' and set '''maximum number of parallel projects builds''' to <code>1</code>.<br />
<br />
* (VC Express only) Enable '''Tools''' > '''Settings''' > '''Expert Settings''' to get the '''Build''' (and other) menus. If you already have a '''Build''' menu you do not need to perform this step.<br />
<br />
{{KBnote|The following steps require an open visual studio project. It does not matter which project you use, as you will only change some global settings used by all projects when they are opened. The open project itself won't be changed.}}<br />
<br />
You need to set a number of paths. <br />
* Open any existing project you may have or make a New Project.<br />
<br />
At the bottom on the Solution Explorer you will see three tabs.<br />
*Click the one on the right labeled '''Property Manager'''. (The name may be somewhat truncated.)<br />
<br />
[[File:VS2010_Property_Manager.PNG|100px]]<br />
[[:File:VS2010_Property_Manager.PNG|Example image]]<br />
<br />
*On the left side click to expand any project and then click again to expand the '''Release''' folder.<br />
<br />
[[File:VS2010_Project_Config.PNG|100px]]<br />
[[:File:VS2010_Project_Config.PNG|Example image]]<br />
<br />
*Right click on '''Microsoft.Cpp.Win32.user'''.<br />
<br />
*Pick '''Properties''' > '''VC++ Directories'''.<br />
<br />
This is where the build environment is pulled together into a functional VC2010 build system and also where much hand wringing, hair pulling, and fist pounding frustration takes place.<br />
<br />
*Set '''Executable Directories''' to:<br />
<br />
$(ExecutablePath)<br />
$(DXSDK_DIR)<br />
$(WindowsSdkDir)\Bin<br />
C:\cygwin\bin<br />
$(SystemRoot)<br />
<br />
[[File:32BitExecutableDirectories.png|100px]]<br />
[[:File:32BitExecutableDirectories.png|32 bit Executable Directories example image]]<br />
<br />
*Set '''Include Directories''' to:<br />
<br />
$(WindowsSdkDir)\Include<br />
$(WindowsSdkDir)\Include\gl<br />
$(DXSDK_DIR)\Include<br />
<br />
[[File:32BitIncludeDirectories.png|100px]]<br />
[[:File:32BitIncludeDirectories.png|32 bit Include Directories example image]]<br />
<br />
*Set '''Library Directories''' to:<br />
<br />
$(WindowsSdkDir)\Lib<br />
$(DXSDK_DIR)<br />
<br />
[[File:32BitLibraryDirectories.png|100px]]<br />
[[:File:32BitLibraryDirectories.png|32 bit Library Directories example image]]<br />
<br />
== Set up your source code tree ==<br />
<br />
Plan your directory structure ahead of time. If you are going to be producing changes or patches you will be cloning a copy of an unaltered source code tree for every change or patch you make, so you might want to have all this work stored in it's own directory.<br />
<br />
To get a copy of the source code tree:<br />
* Open up a DOS Command window<br />
* CD to where you want to install viewer-development. Do not have any spaces in this path.<br />
* Do:<br />
hg clone <nowiki>http://hg.secondlife.com/viewer-development</nowiki><br />
<br />
Let's say some time has gone by since you have performed the previous steps and now you want to develop a change or work on a jira. You will update your clean local repository with all the changes committed to viewer-development since you last synchronized your files:<br />
* CD into <code>viewer-development</code><br />
* Do:<br />
hg pull -u<br />
<br />
* Move up one level from <code>viewer-development</code><br />
* Do:<br />
hg clone viewer-development VWR-nnnnn<br />
Note: <code>nnnnn</code> is the jira number. You can also clone to a name of your choosing if you are making changes not associated with the LL jira system.<br />
<br />
== Prepare third party libraries ==<br />
Most third party libraries needed to build the viewer will be automatically downloaded for you and installed into the build directory within your source tree during the [[#Configuring_the_Viewer|configuration step]] below. Some few need to be manually set up, though, when using an open source developer configuration (<code>Release'''OS'''</code>, <code>RelWithDebInfo'''OS'''</code> or <code>Debug'''OS'''</code>)<br />
<br />
=== Fmod method 1 (using autobuild) ===<br />
<br />
CD to where you want to install the 3p-fmod repository and do:<br />
hg clone <nowiki>https://bitbucket.org/lindenlab/3p-fmod</nowiki><br />
<br />
CD into the <code>3p-fmod</code> directory you created and build it:<br />
autobuild build --all<br />
<br />
Package the results:<br />
autobuild package <br />
<br />
Update autobuild with the filename and hash just displayed. CD to the directory where you cloned viewer-development and do:<br />
<br />
copy autobuild.xml my_autobuild.xml<br />
set AUTOBUILD_CONFIG_FILE=my_autobuild.xml<br />
autobuild installables edit fmod platform=windows hash=<hash> url=file:///<fmod-filespec><br />
<br />
Example:<br />
<br />
copy autobuild.xml my_autobuild.xml<br />
autobuild installables edit fmod platform=windows hash=0f196f00e7dff49f22252efb68525658 url=file:///C:/3p-fmod/fmod-3.75-windows-20110531.tar.bz2<br />
<br />
{{KBnote|Having to copy <code>autobuild.xml</code> and modify the copy from within a cloned repository is a lot of work for every repository you make, but this is the only way to guarantee you pick up upstream changes to <code>autobuild.xml</code> and do not send up a modified <code>autobuild.xml</code> when you do an hg push.}}<br />
<br />
=== Fmod method 2 (using switches) ===<br />
[To be written up]<br />
<br />
== Configuring the Viewer ==<br />
<br />
Fmod is the audio library the viewer uses. If you are compiling with Fmod you will need to do:<br />
set AUTOBUILD_CONFIG_FILE=my_autobuild.xml<br />
<br />
At the command line in the source tree's root directory (presumably a directory you have cloned from viewer-development, as it is not a good idea to work in viewer-development, unless you are only compiling for youself) e.g. <code>C:\linden\VWR-12345\</code>) run:<br />
autobuild configure -c [CONFIGURATION]<br />
where <code>[CONFIGURATION]</code> is one of those listed at [[Building the Viewer with Autobuild#Build a desired configuration]] (<code>ReleaseOS</code>, <code>RelWithDebInfoOS</code>, <code>DebugOS</code>)<br />
<br />
=== Configuration Switches ===<br />
There are a number of switches you can use to modify the configuration process. The name of each switch is followed by its type and then by the value you want to set.<br />
<br />
* '''FMOD''' (bool) controls if the Fmod package is incorporated into the viewer. You must have performed the Fmod installation steps in [[Viewer_2_Microsoft_Windows_Builds#Fmod_method_1_.28using_autobuild.29]] for this to work.<br />
* '''LL_TESTS''' (bool) controls if the tests are compiled and run. There are quite a lot of them so excluding them is recommended unless you have some reason to need one or more of them.<br />
* '''PACKAGE''' (bool) controls if the package step is run. You must have installed NSIS described in [[Viewer_2_Microsoft_Windows_Builds#Install_optional_development_tools]] for this to work.<br />
<br />
{{KBnote|'''OFF''' and '''NO''' are the same as '''FALSE'''; anything else is considered to be '''TRUE'''.}}<br />
<br />
Example: <br />
autobuild configure -c ReleaseOS -- -DLL_TESTS:BOOL=FALSE -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE<br />
<br />
== Compiling the Viewer ==<br />
=== Compiling the viewer with autobuild ===<br />
You can compile the viewer with either autobuild (the encouraged/supported method) or with the VS IDE.<br />
<br />
When compiling with autobuild you will have the best chance of success if you:<br />
*From '''All Programs''' Navigate into the VS2010 program menu<br />
*Click on '''Visual Studio Command Prompt (2010)'''<br />
<br />
{{KBcaution|If you are building with Fmod and have followed the previous Fmod setup instructions AND you are now using a new command window you will need to redo the <code>set AUTOBUILD_CONFIG_FILE{{=}}my_autobuild.xml</code>.}}<br />
<br />
*Run:<br />
autobuild build -c [CONFIGURATION] --no-configure<br />
<br />
There are some useful switches to know about, so your commands may look like this:<br />
autobuild configure -c ReleaseOS -- -DLL_TESTS:BOOL=FALSE -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE<br />
autobuild build -c ReleaseOS --no-configure<br />
<br />
{{KBnote|It is possible to use autobuild to do both the configure step (only needed once) and the build step with one command. I find it is clearer and saves a bit of time if these steps are done separately.}}<br />
<br />
{{KBnote|Do not be alarmed if you see groups of messages with '''warning LNK4099: PDB''' in them.}}<br />
<br />
=== Compiling the viewer with the IDE ===<br />
<br />
The autobuild configure step created the <code>\build-vc100</code> directory at the root of the source tree. In here is the <code>SecondLife.sln</code> solution file.<br />
<br />
Start the IDE and open this solution.<br />
<br />
You might want to change the build type in the drop-down located in the toolbar from '''Debug''' to '''Release''' or '''RelWithDebInfo'''.<br />
<br />
[[File:VS2010BuildType.png|100px]]<br />
[[:File:VS2010BuildType.png|Changing build type example image]]<br />
<br />
You need to adjust the Platform Toolset setting.<br />
* Select all the projects in the Solution Explorer list on the left of the screen.<br />
** Click on the first project and scroll to the bottom of this list and {{K|shift}}-click on the last project.<br />
* Right click on the selected list<br />
* Navigate to '''Properties''' > '''Configuration Properties''' > '''General''' > '''Platform Toolset'''<br />
* Change this value to <code>Windows7.1SDK</code><br />
<br />
* Push {{K|F7}} to start the compiler.<br />
<br />
== Running your newly built viewer ==<br />
=== Running from a desktop shortcut ===<br />
* Make a desktop shortcut for <code>Drive:\your-path\build-vc100\newview\Release\secondlife-bin.exe</code><br />
<br />
* Right-click the shortcut<br />
* Select '''Properties'''<br />
* Set '''Start in:''' to <code>Drive:\your-path\indra\newview</code><br />
<br />
=== Running from within the IDE ===<br />
* In the Solution Explorer pane right click on '''secondlife-bin'''<br />
** Click '''Set as StartUp Project'''<br />
** Pick '''Properties''' > '''Configuration Properties''' > '''Debugging'''<br />
*** Set '''Command''' to <code>Drive:\your-path\build-vc100\newview\Release\secondlife-bin.exe</code><br />
*** Set '''Working Directory''' to <code>..\..\indra\newview</code><br />
<br />
== Handling Problems ==<br />
<br />
If you encounter errors or run into problems following the instructions above, please first check whether someone else already had the same issue. A solution might be known already. See the [[#Common_Issues.2FBugs.2FGlitches_And_Solutions|issue list below]], check [[{{TALKPAGENAME}}|the talk page]] (and report useful experiences there) and search our [[issue tracker]]. Even when no description of your problem has been written down yet, someone might know about it, so get in touch with the community to [[#Getting_help|get help]].<br />
<br />
=== Getting help ===<br />
* Subscribe to [[OpenSource-Dev|OpenSource-Dev Mailing List]] ([https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev subscribe]) and post your question there.<br />
* For faster response, join the general open source viewer discussion and development [[IRC]] channel [irc://irc.freenode.org/opensl #opensl on freenode]. Hopefully a helpful person is online when you ask your question.<br />
<br />
=== Common Issues/Bugs/Glitches And Solutions ===<br />
<br />
==== Not being able to find objidl.h in the Microsoft Windows SDK, when compiling llwindow ====<br />
https://lists.secondlife.com/pipermail/opensource-dev/2011-April/006562.html<br />
* Can be caused by path problems or some installation conflicts with the DirectX SDK.<br />
<br />
==== stdint.h typedef conflicts between Quicktime and VS2010 ====<br />
https://lists.secondlife.com/pipermail/opensource-dev/2011-April/006565.html<br />
*: Can be solved by some small edits to header files to make sure the two don't bash on each other.<br />
<br />
==== Eliminate depreciated switches messages and use memory more efficiently ====<br />
<br />
The VS2010 compiler uses a lot of memory while compiling the viewer. If you run out of memory you will start to page heavily and your compile time will become much longer. The /Zm1000 switch affects compiler memory usage.<br />
<br />
You may see this message while compiling:<br />
use 'EHsc' instead of 'GX'<br />
<br />
Here is how to free up some memory the compiler allocates and to eliminate these messages:<br />
<br />
*Edit <code>\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-cl.cmake</code><br />
<br />
*Replace line 156 with:<br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR")<br />
ENDIF(MSVC10)<br />
<br />
*Replace line 172 with: <br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")<br />
ENDIF(MSVC10)<br />
<br />
*Replace line 184 with:<br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")<br />
ENDIF(MSVC10)<br />
<br />
== References ==<br />
<br />
Tip of the hat to Nicky_Perian for [[User:Nicky_Perian/Visual_Studio_10_Autobuild]]<br />
<br />
[[Category:Compiling viewer]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Viewer_2_Microsoft_Windows_Builds&diff=1149549Viewer 2 Microsoft Windows Builds2011-07-25T22:00:14Z<p>Jenn Linden: /* Establish your programming environment */</p>
<hr />
<div>{{multi-lang}}<br />
{{CompileNav}} <br />
<br />
Philosophy: to keep it brief, this page should only include steps we KNOW ARE NEEDED, not random hints. Extra details or open issues can go on the talk page.<br />
<br />
{{KBnote|Following this recipe will probably take 6 to 12 hours of wall-clock time, and 2 to 6 hours of your time, if you're starting from a fresh Windows XP/Vista/7 system.}}<br />
<br />
== Establish your programming environment ==<br />
<br />
This is needed for compiling any viewer based on the LL open source code and only needs to be done once.<br />
<br />
=== Install and update Visual Studio and SDKs ===<br />
<br />
# Install [http://www.microsoft.com/express/download/ Visual Studio 2010] (Express is okay)<br />
#* If you installed VS2010 Express also install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84&displaylang=en Microsoft Visual C++ 2010 Redistributable Package] or [http://www.microsoft.com/download/en/confirmation.aspx?id=14632 64-bit Windows] version.<br />
# Install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=35aeda01-421d-4ba5-b44b-543dc8c33a20 Windows SDK for Windows 7 and .NET Framework 4] (ISO) or [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6B6C21D2-2006-4AFA-9702-529FA782D63B Windows SDK for Windows 7 and .NET Framework 4] (Web Install)<br />
# Install [http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba DirectX SDK (June 2010)]<br />
# Run [http://www.update.microsoft.com/microsoftupdate/v6 Microsoft Update], and keep running it until no updates are needed. This may take 6~8 iterations on older versions of windows.<br />
#* '''Note''': ''For Windows Vista and Windows 7'', you need to select "Get updates from other Microsoft products" to get the updates for Visual Studio. <br />
#* For Windows XP, use the provided link above. The Windows Update menu item on your computer is not the correct updater to use.<br />
#* During the update cycles make sure you have picked up Microsoft Visual Studio 2010 Service Pack 1 [http://go.microsoft.com/fwlink/?LinkId=210710 (ISO)] or [http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=75568aa6-8107-475d-948a-ef22627e57a5 (Web Install)]<br />
<br />
=== Install required development tools ===<br />
<br />
{{KBnote|The order of the following installations should not matter.}}<br />
{{KBnote|If the installer for a particular package does not update your PATH environment variable you will have to do this manually.}}<br />
<br />
# '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])<br />
#* This should be version 2.8.4 (or above in the 2.8.x series).<br />
#*Add the <code>\bin</code> directory to your path.<br />
# Python (either [http://www.python.org/download/ Standard Python] or [http://www.activestate.com/activepython/downloads ActivePython])<br />
#* Version 2.5.X<br />
#* Later versions may work, but are not officially supported. Version 2.7.1 has been reported to work with the build scripts.<br />
# Mercurial (either [http://tortoisehg.bitbucket.org/ TortoiseHg] or [http://mercurial.selenic.com/ Mercurial Hg])<br />
# [http://www.cygwin.com/ Cygwin]<br />
#* When you run the cygwin setup utility make sure you have selected to install '''unzip''' (under "Archives"), '''bison''', '''flex''', '''patchutils''' (all located under "devel"), and '''curl''' (under "Web"), which are not part of the default install. Do not install Cygwin Python or Mercurial. You won't need to use the Cygwin shell for anything.<br />
#* '''NOTE:''' '''DO NOT''' use the Cygwin version of CMake, Python, or Mercurial (hg). The Build will fail. (CMake specifically excludes the Cygwin version of Python, in the <code>Python.cmake</code> file)<br />
#*Add the <code>\bin</code> directory to the '''very end''' of your path and make sure it stays that way.<br />
<br />
=== Install optional development tools ===<br />
<br />
# [http://code.google.com/p/unsis/downloads/list Unicode NSIS (Nullsoft Scriptable Install System)]<br />
#* This is the package installer used to build <code>Second_Life_<version-code>_LindenDeveloper_Setup.exe</code>. You only need this package if you are going to distribute the viewer you compile or if you want to install it locally.<br />
#: In the [[#Configuring_the_Viewer|Configure VS2010 step]] below you will need to add a line in the '''Executable Directories''' section:<br />
#:* 64 bit systems use <code>%ProgramFiles(x86)%\NSIS\Unicode</code><br />
#:* 32 bit systems use <code>%ProgramFiles%\NSIS\Unicode</code><br />
# [http://notepadplusplus.org/ Notepad++]<br />
#* You need to use an editor that conforms to the [[Coding Standard]]. In particular, you must not check in files with DOS line endings except in very limited circumstances; see [[How to avoid DOS line endings in Windows tools]].<br />
<br />
=== Install Autobuild ===<br />
* Open up a DOS Command window<br />
* CD to where you want to install autobuild. Do not have any spaces in the path to this directory.<br />
* Do:<br />
hg clone <nowiki>http://hg.secondlife.com/autobuild</nowiki><br />
* Modify your path statement to include the autobuild <code>\bin</code> directory<br />
* Add an environment variable, so that autobuild doesn't default to using (or trying) VC 2003.<br />
** Find a "My Computer" icon, there are several ways to do this, which vary depending on which version of Windows you are using. Usually you can find one through the "Start" menu button or on your desktop.<br />
** Right-click the icon and select "Properties".<br />
** When the Properties dialogue opens, click the "Advanced" tab followed by the "Environmental Variables" button. This will open a new window with a list of System and User variables.<br />
** In the User section, click "New". Your "Variable Name" should be AUTOBUILD_VSVER and the "Variable Value" is 100.<br />
** Click the OK/Close buttons to close all the windows.<br />
<br />
=== Configure VC2010 ===<br />
While you may choose to use autobuild for all your compiling you still need to establish certain settings internal to VC2010.<br />
<br />
*Start the IDE<br />
<br />
*Navigate to '''Tools''' > '''Options''' > '''Projects and Solutions''' > '''Build and Run''' and set '''maximum number of parallel projects builds''' to <code>1</code>.<br />
<br />
* (VC Express only) Enable '''Tools''' > '''Settings''' > '''Expert Settings''' to get the '''Build''' (and other) menus. If you already have a '''Build''' menu you do not need to perform this step.<br />
<br />
{{KBnote|The following steps require an open visual studio project. It does not matter which project you use, as you will only change some global settings used by all projects when they are opened. The open project itself won't be changed.}}<br />
<br />
You need to set a number of paths. <br />
* Open any existing project you may have or make a New Project.<br />
<br />
At the bottom on the Solution Explorer you will see three tabs.<br />
*Click the one on the right labeled '''Property Manager'''. (The name may be somewhat truncated.)<br />
<br />
[[File:VS2010_Property_Manager.PNG|100px]]<br />
[[:File:VS2010_Property_Manager.PNG|Example image]]<br />
<br />
*On the left side click to expand any project and then click again to expand the '''Release''' folder.<br />
<br />
[[File:VS2010_Project_Config.PNG|100px]]<br />
[[:File:VS2010_Project_Config.PNG|Example image]]<br />
<br />
*Right click on '''Microsoft.Cpp.Win32.user'''.<br />
<br />
*Pick '''Properties''' > '''VC++ Directories'''.<br />
<br />
This is where the build environment is pulled together into a functional VC2010 build system and also where much hand wringing, hair pulling, and fist pounding frustration takes place.<br />
<br />
*Set '''Executable Directories''' to:<br />
<br />
$(ExecutablePath)<br />
$(DXSDK_DIR)<br />
$(WindowsSdkDir)\Bin<br />
C:\cygwin\bin<br />
$(SystemRoot)<br />
<br />
[[File:32BitExecutableDirectories.png|100px]]<br />
[[:File:32BitExecutableDirectories.png|32 bit Executable Directories example image]]<br />
<br />
*Set '''Include Directories''' to:<br />
<br />
$(WindowsSdkDir)\Include<br />
$(WindowsSdkDir)\Include\gl<br />
$(DXSDK_DIR)\Include<br />
<br />
[[File:32BitIncludeDirectories.png|100px]]<br />
[[:File:32BitIncludeDirectories.png|32 bit Include Directories example image]]<br />
<br />
*Set '''Library Directories''' to:<br />
<br />
$(WindowsSdkDir)\Lib<br />
$(DXSDK_DIR)<br />
<br />
[[File:32BitLibraryDirectories.png|100px]]<br />
[[:File:32BitLibraryDirectories.png|32 bit Library Directories example image]]<br />
<br />
== Set up your source code tree ==<br />
<br />
Plan your directory structure ahead of time. If you are going to be producing changes or patches you will be cloning a copy of an unaltered source code tree for every change or patch you make, so you might want to have all this work stored in it's own directory.<br />
<br />
To get a copy of the source code tree:<br />
* Open up a DOS Command window<br />
* CD to where you want to install viewer-development. Do not have any spaces in this path.<br />
* Do:<br />
hg clone <nowiki>http://hg.secondlife.com/viewer-development</nowiki><br />
<br />
Let's say some time has gone by since you have performed the previous steps and now you want to develop a change or work on a jira. You will update your clean local repository with all the changes committed to viewer-development since you last synchronized your files:<br />
* CD into <code>viewer-development</code><br />
* Do:<br />
hg pull -u<br />
<br />
* Move up one level from <code>viewer-development</code><br />
* Do:<br />
hg clone viewer-development VWR-nnnnn<br />
Note: <code>nnnnn</code> is the jira number. You can also clone to a name of your choosing if you are making changes not associated with the LL jira system.<br />
<br />
== Prepare third party libraries ==<br />
Most third party libraries needed to build the viewer will be automatically downloaded for you and installed into the build directory within your source tree during the [[#Configuring_the_Viewer|configuration step]] below. Some few need to be manually set up, though, when using an open source developer configuration (<code>Release'''OS'''</code>, <code>RelWithDebInfo'''OS'''</code> or <code>Debug'''OS'''</code>)<br />
<br />
=== Fmod method 1 (using autobuild) ===<br />
<br />
CD to where you want to install the 3p-fmod repository and do:<br />
hg clone <nowiki>https://bitbucket.org/lindenlab/3p-fmod</nowiki><br />
<br />
CD into the <code>3p-fmod</code> directory you created and build it:<br />
autobuild build --all<br />
<br />
Package the results:<br />
autobuild package <br />
<br />
Update autobuild with the filename and hash just displayed. CD to the directory where you cloned viewer-development and do:<br />
<br />
copy autobuild.xml my_autobuild.xml<br />
set AUTOBUILD_CONFIG_FILE=my_autobuild.xml<br />
autobuild installables edit fmod platform=windows hash=<hash> url=file:///<fmod-filespec><br />
<br />
Example:<br />
<br />
copy autobuild.xml my_autobuild.xml<br />
autobuild installables edit fmod platform=windows hash=0f196f00e7dff49f22252efb68525658 url=file:///C:/3p-fmod/fmod-3.75-windows-20110531.tar.bz2<br />
<br />
{{KBnote|Having to copy <code>autobuild.xml</code> and modify the copy from within a cloned repository is a lot of work for every repository you make, but this is the only way to guarantee you pick up upstream changes to <code>autobuild.xml</code> and do not send up a modified <code>autobuild.xml</code> when you do an hg push.}}<br />
<br />
=== Fmod method 2 (using switches) ===<br />
[To be written up]<br />
<br />
== Configuring the Viewer ==<br />
<br />
Fmod is the audio library the viewer uses. If you are compiling with Fmod you will need to do:<br />
set AUTOBUILD_CONFIG_FILE=my_autobuild.xml<br />
<br />
At the command line in the source tree's root directory (presumably a directory you have cloned from viewer-development, as it is not a good idea to work in viewer-development, unless you are only compiling for youself) e.g. <code>C:\linden\VWR-12345\</code>) run:<br />
autobuild configure -c [CONFIGURATION]<br />
where <code>[CONFIGURATION]</code> is one of those listed at [[Building the Viewer with Autobuild#Build a desired configuration]] (<code>ReleaseOS</code>, <code>RelWithDebInfoOS</code>, <code>DebugOS</code>)<br />
<br />
=== Configuration Switches ===<br />
There are a number of switches you can use to modify the configuration process. The name of each switch is followed by its type and then by the value you want to set.<br />
<br />
* '''FMOD''' (bool) controls if the Fmod package is incorporated into the viewer. You must have performed the Fmod installation steps in [[Viewer_2_Microsoft_Windows_Builds#Fmod_method_1_.28using_autobuild.29]] for this to work.<br />
* '''LL_TESTS''' (bool) controls if the tests are compiled and run. There are quite a lot of them so excluding them is recommended unless you have some reason to need one or more of them.<br />
* '''PACKAGE''' (bool) controls if the package step is run. You must have installed NSIS described in [[Viewer_2_Microsoft_Windows_Builds#Install_optional_development_tools]] for this to work.<br />
<br />
{{KBnote|'''OFF''' and '''NO''' are the same as '''FALSE'''; anything else is considered to be '''TRUE'''.}}<br />
<br />
Example: <br />
autobuild configure -c ReleaseOS -- -DLL_TESTS:BOOL=FALSE -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE<br />
<br />
== Compiling the Viewer ==<br />
=== Compiling the viewer with autobuild ===<br />
You can compile the viewer with either autobuild (the encouraged/supported method) or with the VS IDE.<br />
<br />
When compiling with autobuild you will have the best chance of success if you:<br />
*From '''All Programs''' Navigate into the VS2010 program menu<br />
*Click on '''Visual Studio Command Prompt (2010)'''<br />
<br />
{{KBcaution|If you are building with Fmod and have followed the previous Fmod setup instructions AND you are now using a new command window you will need to redo the <code>set AUTOBUILD_CONFIG_FILE{{=}}my_autobuild.xml</code>.}}<br />
<br />
*Run:<br />
autobuild build -c [CONFIGURATION] --no-configure<br />
<br />
There are some useful switches to know about, so your commands may look like this:<br />
autobuild configure -c ReleaseOS -- -DLL_TESTS:BOOL=FALSE -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE<br />
autobuild build -c ReleaseOS --no-configure<br />
<br />
{{KBnote|It is possible to use autobuild to do both the configure step (only needed once) and the build step with one command. I find it is clearer and saves a bit of time if these steps are done separately.}}<br />
<br />
{{KBnote|Do not be alarmed if you see groups of messages with '''warning LNK4099: PDB''' in them.}}<br />
<br />
=== Compiling the viewer with the IDE ===<br />
<br />
The autobuild configure step created the <code>\build-vc100</code> directory at the root of the source tree. In here is the <code>SecondLife.sln</code> solution file.<br />
<br />
Start the IDE and open this solution.<br />
<br />
You might want to change the build type in the drop-down located in the toolbar from '''Debug''' to '''Release''' or '''RelWithDebInfo'''.<br />
<br />
[[File:VS2010BuildType.png|100px]]<br />
[[:File:VS2010BuildType.png|Changing build type example image]]<br />
<br />
You need to adjust the Platform Toolset setting.<br />
* Select all the projects in the Solution Explorer list on the left of the screen.<br />
** Click on the first project and scroll to the bottom of this list and {{K|shift}}-click on the last project.<br />
* Right click on the selected list<br />
* Navigate to '''Properties''' > '''Configuration Properties''' > '''General''' > '''Platform Toolset'''<br />
* Change this value to <code>Windows7.1SDK</code><br />
<br />
* Push {{K|F7}} to start the compiler.<br />
<br />
== Running your newly built viewer ==<br />
=== Running from a desktop shortcut ===<br />
* Make a desktop shortcut for <code>Drive:\your-path\build-vc100\newview\Release\secondlife-bin.exe</code><br />
<br />
* Right-click the shortcut<br />
* Select '''Properties'''<br />
* Set '''Start in:''' to <code>Drive:\your-path\indra\newview</code><br />
<br />
=== Running from within the IDE ===<br />
* In the Solution Explorer pane right click on '''secondlife-bin'''<br />
** Click '''Set as StartUp Project'''<br />
** Pick '''Properties''' > '''Configuration Properties''' > '''Debugging'''<br />
*** Set '''Command''' to <code>Drive:\your-path\build-vc100\newview\Release\secondlife-bin.exe</code><br />
*** Set '''Working Directory''' to <code>..\..\indra\newview</code><br />
<br />
== Handling Problems ==<br />
<br />
If you encounter errors or run into problems following the instructions above, please first check whether someone else already had the same issue. A solution might be known already. See the [[#Common_Issues.2FBugs.2FGlitches_And_Solutions|issue list below]], check [[{{TALKPAGENAME}}|the talk page]] (and report useful experiences there) and search our [[issue tracker]]. Even when no description of your problem has been written down yet, someone might know about it, so get in touch with the community to [[#Getting_help|get help]].<br />
<br />
=== Getting help ===<br />
* Subscribe to [[OpenSource-Dev|OpenSource-Dev Mailing List]] ([https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev subscribe]) and post your question there.<br />
* For faster response, join the general open source viewer discussion and development [[IRC]] channel [irc://irc.freenode.org/opensl #opensl on freenode]. Hopefully a helpful person is online when you ask your question.<br />
<br />
=== Common Issues/Bugs/Glitches And Solutions ===<br />
<br />
==== Not being able to find objidl.h in the Microsoft Windows SDK, when compiling llwindow ====<br />
https://lists.secondlife.com/pipermail/opensource-dev/2011-April/006562.html<br />
* Can be caused by path problems or some installation conflicts with the DirectX SDK.<br />
<br />
==== stdint.h typedef conflicts between Quicktime and VS2010 ====<br />
https://lists.secondlife.com/pipermail/opensource-dev/2011-April/006565.html<br />
*: Can be solved by some small edits to header files to make sure the two don't bash on each other.<br />
<br />
==== Eliminate depreciated switches messages and use memory more efficiently ====<br />
<br />
The VS2010 compiler uses a lot of memory while compiling the viewer. If you run out of memory you will start to page heavily and your compile time will become much longer. The /Zm1000 switch affects compiler memory usage.<br />
<br />
You may see this message while compiling:<br />
use 'EHsc' instead of 'GX'<br />
<br />
Here is how to free up some memory the compiler allocates and to eliminate these messages:<br />
<br />
*Edit <code>\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-cl.cmake</code><br />
<br />
*Replace line 156 with:<br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR")<br />
ENDIF(MSVC10)<br />
<br />
*Replace line 172 with: <br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")<br />
ENDIF(MSVC10)<br />
<br />
*Replace line 184 with:<br />
IF(MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /EHsc /GR")<br />
ELSEIF(NOT MSVC10)<br />
SET(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")<br />
ENDIF(MSVC10)<br />
<br />
== References ==<br />
<br />
Tip of the hat to Nicky_Perian for [[User:Nicky_Perian/Visual_Studio_10_Autobuild]]<br />
<br />
[[Category:Compiling viewer]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Microsoft_Windows_Builds&diff=1149495Microsoft Windows Builds2011-07-25T17:14:51Z<p>Jenn Linden: /* Getting other development tools */</p>
<hr />
<div>{{multi-lang}}<br />
{{CompileNav}}<br />
<br />
<br />
On Windows, there are several options on build (compile) environment of the Second Life.<br />
<br />
This page explains how you can compile the Viewer on Microsoft Windows.<br />
<br />
Currently, only 32 bit binary is tested. There seems to be several trials to produce 64 bit Windows <code>.exe</code> of the Viewer. If you did, please write your experience on [[Talk:Microsoft Windows Builds|the discussion page]] (regardless it was successful or not!)<br />
<br />
== Choosing and preparing a compiler ==<br />
<br />
=== Linden-supported compilers ===<br />
<br />
Supported compiler: '''Visual Studio .NET 2005 Professional'''<br />
<br />
You need to setup the compiler and Microsoft Development tools as follows:<br />
* Setup [[Microsoft Visual Studio]]<br />
<br />
=== Community experimental compilers ===<br />
<br />
If you don't have Visual Studio .NET 2005 Professional, you may wish to try one of the following alternatives.<br />
<br />
* Visual C++ 2005 Express ([[Microsoft Visual Studio|instructions]], but the screenshots for [[Compiling the Viewer (MSVS2008)|VS2008]] are worth a glance too)<br />
* Visual Studio 2008 ([[Compiling the Viewer (MSVS2008)|instructions]])<br />
* Visual C++ 2008 Express ([[Compiling the Viewer (MSVS2008)|instructions]])<br />
<br />
{{KBwarning|Boost support with Visual Studio 2008 is problematic as of this writing. Check {{jira|VWR-9541}} before continuing on this path.}}<br />
<br />
{{KBcaution|Make sure you install to paths without spaces in it.}}<br />
<br />
== Getting other development tools ==<br />
<br />
You will need to install the following tools to compile the Viewer:<br />
* '''UniCode NSIS''' ([http://code.google.com/p/unsis/downloads/list download Unicode NSIS])<br />
** This is the package installer used to build <code>Setup.exe</code>. ''<b>Note:</b> NSIS is now hosted by Google Code (linked above). Previously at: http://www.scratchpaper.com/home/downloads.'' --[[User:Jenn Linden|Jenn Linden]] 21:56, 25 October 2010 (UTC)<br />
** NSIS must be installed to the default location for your windows install, i.e. "Program Files"<br />
* '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])<br />
** Use the latest point version for Cmake 2.6. As of this writing, the latest version is 2.6.4. <b>Note</b>: There are many known issues with CMake 2.6.0 and 2.6.1 in conjunction with building the Second Life Viewer. CMake 2.4.8 is supported for compiling the 1.21 version of the Second Life Viewer, but 2.6.2 is likely to become the new minimum requirement in the near future.<br />
* '''Cygwin''' ([http://www.cygwin.com/ download Cygwin])<br />
** When you run the cygwin setup utility make sure you have selected to install '''patchutils''', '''flex''', '''bison''', and '''zlib-devel'''(all located under "devel"), '''openssh''' (located under "Net"), which are not part of the default install. (If you missed one of these, the easiest thing to do is to re-run the entire installation.)<br />
** '''NOTE:''' '''DO NOT''' use the Cygwin version of CMake or Python. The Build will fail. (CMake specifically excludes the Cygwin version of Python, in the <code>Python.cmake</code> file)<br />
* '''Python''' (download either [http://www.python.org/download/ Python.org Standard Python] or [http://www.activestate.com/Products/ActivePython/?mp=1 ActivePython]<br />
** 2.4.3 is the minimum required version.<br />
** Use version v2.5 preferably. If you use a version newer than 2.5, you may need to change the <code>Python.cmake</code> file. See the [[Talk:CMake#CMake_and_Python_2.6|CMake discussion]] for details (this change was necessary as of 1.21-r99587 source branch). ) <br />
* '''The Windows Platform SDK'''<br />
** Get the latest version (as of 23 March 2010) here: [http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=c17ba869-9671-4330-a63e-1fd44e0e2505&displayLang=en Windows SDK for Windows Server 2008 and .NET Framework 3.5 SP1] (If you use the web installer, you can choose only the "Development Tools" and "Samples Win32", which is referenced by viewer-development source, to cut the download size significantly. Watch those version descriptions closely. v6.1 seems to work fine but v7.0, when combined with the components above, results in linking errors stating libraries are corrupted.) <br />
* '''DirectX SDK'''<br />
** Get the latest version (as of 7 June 2010) here: [http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba DirectX SDK (June 2010)]<br />
<br />
Verify that Cygwin, CMake, and Python are in the windows "PATH".<br />
<br />
== Downloading Source Code ==<br />
<br />
{{KBcaution|Make sure you install to paths without spaces in it.}}<br />
<br />
You can download the Viewer source code on the [[source downloads]] page. You can also use a [[version control repository]]. If you're just starting out, it's probably best to get the latest Release version, rather than a Release Candidate, because the Release Candidates get updated quite often. But if you would rather work with the latest code, go for the [[version control repository]] "trunk". Don't forget to also download the artwork and library bundles relevant to the repository branch you're using as explained in [[Version_control_repository#Artwork_and_Library_Bundles|Artwork and Library Bundles]].<br />
<br />
If you're downloading from the [[source downloads]] page, there are three packages to get: the source package, the artwork package, and the library package. In versions 1.20 and earlier, Linden packaged the library binaries in the Libs package. For 1.21 and beyond, the CMake <code>develop.py</code> script now downloads '''most''' of the libraries that were previously in the libs zip file. This saves developers who are tracking trunk from constantly downloading them every update and only downloads updated libraries. As of this writing, there are some pieces packages that still require downloading, so be sure to grab the library and artwork bundles from the [[source downloads]] page.<br />
<br />
'''WARNING:'''<br />
* If the directory path you keep the SL source in has a space in it, the batch file that copies <code>message_template.msg</code> will fail. So, if you unzip or checkout the source tree into, e.g., <code>C:\Projects\Dir with space in name\Etc\linden</code>, it won't work!<br />
* You should also avoid using non-ASCII (national) characters in the paths, although some localized versions of the tool puts some as a default...<br />
* Unzip or checkout your source tree into a directory that has as short full pathname as possible, since long paths cause some unexpected trouble during the build.<br />
<br />
In other words, the easiest way to get this working is to get '''source''', '''artwork''', and '''libs''' from the [[source downloads]] page and unpack them all into the same directory/folder, which ideally would be a folder in (or near) the root directory with a short name like <code>sl_1_21_6</code>.<br />
<br />
== Installing libraries ==<br />
<br />
SL Viewer depends on some third party libraries. Some of them are open source, some others are not.<br />
<br />
=== Open source libraries ===<br />
<br />
As of Viewer version 1.21, all open source libraries are automatically downloaded as part of the build script invoked by <code>develop.py</code>, unless you choose to configure a standalone build.<br />
<br />
=== Proprietary libraries ===<br />
<br />
Linden Lab does not provide proprietary libraries. You will need to follow the instructions here under to acquire and copy them to your source tree.<br />
<br />
It's probably a good idea to build an empty directory tree for those files, copy the relevant proprietary files there and, once done, copy the whole to your source tree (like <code>XCOPY OLIB SL_1_16_0_5 /S</code>). The reason is that these steps are cumbersome and will have to be repeated for each new release (at least if you keep the source for each release in its own folder). If you do not want to do this, you can just as well copy the files directly into the linden source paths.<br />
<br />
rem OLIBS.CMD to build a folder tree for 3rd party libraries and includes<br />
md olibs<br />
md olibs\linden\<br />
md olibs\linden\libraries<br />
md olibs\linden\libraries\include<br />
md olibs\linden\libraries\i686-win32<br />
md olibs\linden\libraries\i686-win32\lib_release<br />
md olibs\linden\libraries\i686-win32\lib_debug<br />
md olibs\linden\libraries\i686-win32\include<br />
md olibs\linden\libraries\i686-win32\include\GL<br />
md olibs\linden\libraries\i686-win32\include\quicktime<br />
md olibs\linden\indra<br />
md olibs\linden\indra\newview<br />
<br />
<br />
==== Fmod ==== <br />
* Download & extract [http://www.fmod.org/files/fmod3/fmodapi375win.zip FMOD3.75 API for Windows]. (later versions, like FMOD Ex, are incompatible).<br />
* Copy <code>fmodapi375win\api\inc\fmod.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\inc\fmod_errors.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\inc\fmoddyn.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\lib\fmodvc.lib</code> to <code>linden\libraries\i686-win32\lib_release</code> and to <code>linden\libraries\i686-win32\lib_debug</code><br />
(If using cmake, copy <code>fmodapi375win\api\lib\fmodvc.lib</code> to <code>linden\libraries\i686-win32\lib\release</code> and to <code>linden\libraries\i686-win32\lib\debug</code>)<br />
* Copy <code>fmodapi375win\api\fmod.dll</code> to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
<br />
Note to Snowstorm users: if you are building using the Mercurial repository [https://bitbucket.org/lindenlab/viewer-development lindenlab/viewer-development], these steps have been simplified and cleaned up. In particular, there's no need to drop anything under <code>linden\indra</code> anymore, all the files are under <code>linden\libraries</code> like for other 3rd party libraries. The <code>fmodvc.lib</code> however needs to be renamed <code>fmod.lib</code>. The new instructions are:<br />
* Download & extract [http://www.fmod.org/files/fmod3/fmodapi375win.zip FMOD3.75 API for Windows]<br />
* From <code>fmodapi375win\api\inc\</code>, copy <code>fmod.h</code> and <code>fmod_errors.h</code> to <code>linden\libraries\include</code><br />
* From <code>fmodapi375win\api\lib</code>, choose the relevant <code>.lib</code> that correspond to your environment (e.g. <code>fmodvc.lib</code> for Visual Studio), rename it <code>fmod.lib</code> and copy it to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
* From <code>fmodapi375win\api</code> copy <code>fmod.dll</code> to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
<br />
==== Quicktime ====<br />
<br />
Currently - as of version 1.21 - CMake requires Quicktime to be installed.<br />
<br />
'''Note:''' This download requires a registration at the Apple Quicktime website and take a bit of time. You can avoid using QuickTime if you want, see [[Compiling_older_Viewers_(1.20_and_earlier_with_MSVS)#QuickTime_removal|this]] for details. Remember that your Viewer '''can't play in-world movies''' if you do so.<br />
* Download & install the [http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wo/11.1.17.2.1.3.3.1.0.1.1.0.3.11.3.3.1#main Quicktime SDK for Windows]<br />
* Copy <code>QuicktimeSDK\Libraries\QTMLClient.lib</code> to <code>linden\libraries\i686-win32\lib_release</code> and to <code>linden\libraries\i686-win32\lib_debug</code>.<br />
<br />
(If using CMake, copy <code>QuicktimeSDK\Libraries\QTMLClient.lib</code> to <code>linden\libraries\i686-win32\lib\release</code> and to <code>linden\libraries\i686-win32\lib\debug</code> instead)<br />
<br />
* Copy the contents of <code>QuicktimeSDK\CIncludes</code> into <code>linden\libraries\i686-win32\include\quicktime</code>.<br />
<br />
== Building the Viewer ==<br />
<br />
At this point, you should be ready to use [[CMake]] to build the Visual Studio solution for the project. <br />
<br />
'''NOTE''': CMake is only supported for Viewer versions 1.21 and beyond. <br />
<br />
Before you first run a build, you'll need to configure things. It is recommended that you use the <code>develop.py</code> script that will create a default configuration for you.<br />
<br />
You must make sure that cmake is registered in the Windows environment or you will get strange errors from <code>develop.py</code>. To ensure everything is correct, right click My Computer -> Properties -> Advanced -> Environment Variables -> Inside System Variables, choose PATH (case insensitive) and click Edit. Now in the value field, go to the end of the value and add a semicolon (<code>;</code>), and then the folder containing the CMake binaries (example: <code>C:\Program Files\CMake 2.8\bin</code>). This might already have been set by the CMake installer.<br />
<br />
From the command line, navigate to the <code>indra</code> folder of your source tree and run:<br />
<br />
python develop.py<br />
<br />
CMake will pick the most recent version of Visual Studio we support. If you want to specify the version of Visual Studio to use.<br />
<br />
* VisualStudio 2005:<br />
<br />
python develop.py -G VC80<br />
<br />
* VisualStudio 2008:<br />
<br />
python develop.py -G VC90<br />
<br />
'''NOTE:''' The above commands will configure a "non-standalone" version of the source code tree. This means that the required third party library packages (as built by Linden Lab) will be downloaded during the CMake process.<br />
<br />
=== Finding your build directory ===<br />
<br />
In the CMake world, we keep source and object files separate. The <code>develop.py</code> script did create and populate a build directory for you. It is in one of the following locations:<br />
* VS 2005: <code>indra/build-vc80</code><br />
* VS 2008: <code>indra/build-vc90</code> <br />
<br />
=== Compiling ===<br />
<br />
To start a build, do one of the following:<br />
* Run <code>python develop.py build</code> from the <code>indra</code> directory.<br />
** '''NOTE FOR VS 2008 USERS:''' This command will not work, since it will only look for VS 2005. Instead, run the command <code>python develop.py -G VC90 build</code><br />
* Load the Visual Studio solution into your IDE. For MSVS VC++:<br />
** Use "File -> Open -> Project/Solution", and open the <code>linden/indra/build-VC80/SecondLife.sln</code> solution file<br />
*** '''NOTE FOR VS 2008 USERS:''' Even though a build-VC90 was created in the above steps, <code>developer.py</code> places the VS 2008 solution/project files in the <code>indra</code> directory. Don't move them to <code>build-VC90</code> - the paths in the project files are relative to the <code>indra</code> directory.<br />
** In the MSVS toolbar, just to the right of the triangular "Start Debugging" arrow, is a text box whose tooltip is "Solution Configurations". Select RelWithDebugInfo.<br />
** If ALL_BUILD is not set as your StartUp Project (the StartUp Project is displayed in bold font), right-click on ALL_BUILD and choose "Set as StartUp Project".<br />
** Right-click on ALL_BUILD and choose "Properties". In "Configuration Properties -> Debugging", find "Working Directory" and navigate to <code>linden\indra\newview</code>.<br />
** (For Snowglobe 1.x) In the Solution Explorer pane, right-click on the project named "prepare" and select Project Only -> Build Only prepare. This downloads and installs precompiled libraries and only needs to be done when the source tree is clean or if libraries in the list included in the source tree get updated. Running this when not required is brief and causes no harm.<br />
** Build -> Build Solution (F7)<br />
** Debug -> "Start Debugging" or "Start without debugging".<br />
** MSVC might not be able to find the executable. If not, point it to <code>linden\indra\build-VC80\newview\relwithdebinfo\secondlife-bin.exe</code>, and try again.<br />
** You may see an error due to not being able to find <code>fmod.dll</code>. If so, find a copy (remember, you copied this in a step above) and copy it into <code>indra\build-VC80\newview\relwithdebinfo</code>. Try again.<br />
** You may see an error due to not finding <code>llkdu.dll</code>. If so, find it in the normal installed version (make sure it's the same version as your source) and copy it into <code>indra\build-VC80\newview\relwithdebinfo</code>. Try again.<br />
** Good luck!<br />
<br />
=== Where's the built Viewer? ===<br />
<br />
On Windows, the built Viewer ought to run from VS2005.<br />
<br />
To run outside MS VS, see Discussion tab:<br />
[[Talk:Microsoft_Windows_Builds#Running_viewer_outside_of_MS_VS]]<br />
<br />
=== Build instructions for 1.20 and earlier ===<br />
<br />
See [[Compiling older Viewers (1.20 and earlier with MSVS)]] if you'd like to compile a version of the Viewer older than 1.20.<br />
<br />
== What to do if it doesn't work for you ==<br />
<br />
* Ask for help on [[IRC]] ([irc://irc.freenode.net/opensl #opensl on freenode])<br />
* Find someone on the [[OpenSource-Dev|OpenSource-Dev mailing list]]<br />
* Fix it: [[Modifying CMake Files]] (and please, submit a patch!)<br />
<br />
Please also see the (user contributed) instructions at [[User:Michelle2_Zenovka/cmake]]<br />
<br />
[[Category:Compiling viewer]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Microsoft_Windows_Builds&diff=1149493Microsoft Windows Builds2011-07-25T16:56:35Z<p>Jenn Linden: /* Getting other development tools */</p>
<hr />
<div>{{multi-lang}}<br />
{{CompileNav}}<br />
<br />
<br />
On Windows, there are several options on build (compile) environment of the Second Life.<br />
<br />
This page explains how you can compile the Viewer on Microsoft Windows.<br />
<br />
Currently, only 32 bit binary is tested. There seems to be several trials to produce 64 bit Windows <code>.exe</code> of the Viewer. If you did, please write your experience on [[Talk:Microsoft Windows Builds|the discussion page]] (regardless it was successful or not!)<br />
<br />
== Choosing and preparing a compiler ==<br />
<br />
=== Linden-supported compilers ===<br />
<br />
Supported compiler: '''Visual Studio .NET 2005 Professional'''<br />
<br />
You need to setup the compiler and Microsoft Development tools as follows:<br />
* Setup [[Microsoft Visual Studio]]<br />
<br />
=== Community experimental compilers ===<br />
<br />
If you don't have Visual Studio .NET 2005 Professional, you may wish to try one of the following alternatives.<br />
<br />
* Visual C++ 2005 Express ([[Microsoft Visual Studio|instructions]], but the screenshots for [[Compiling the Viewer (MSVS2008)|VS2008]] are worth a glance too)<br />
* Visual Studio 2008 ([[Compiling the Viewer (MSVS2008)|instructions]])<br />
* Visual C++ 2008 Express ([[Compiling the Viewer (MSVS2008)|instructions]])<br />
<br />
{{KBwarning|Boost support with Visual Studio 2008 is problematic as of this writing. Check {{jira|VWR-9541}} before continuing on this path.}}<br />
<br />
{{KBcaution|Make sure you install to paths without spaces in it.}}<br />
<br />
== Getting other development tools ==<br />
<br />
You will need to install the following tools to compile the Viewer:<br />
* '''UniCode NSIS''' ([http://code.google.com/p/unsis/downloads/list download Unicode NSIS])<br />
** This is the package installer used to build <code>Setup.exe</code>. ''<b>Note:</b> NSIS is now hosted by Google Code (linked above). Previously at: http://www.scratchpaper.com/home/downloads.'' --[[User:Jenn Linden|Jenn Linden]] 21:56, 25 October 2010 (UTC)<br />
** NSIS must be installed to the default location for your windows install, i.e. "Program Files"<br />
* '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])<br />
** Use the latest point version for Cmake 2.6. As of this writing, the latest version is 2.6.4. <b>Note</b>: There are many known issues with CMake 2.6.0 and 2.6.1 in conjunction with building the Second Life Viewer. CMake 2.4.8 is supported for compiling the 1.21 version of the Second Life Viewer, but 2.6.2 is likely to become the new minimum requirement in the near future.<br />
* '''Cygwin''' ([http://www.cygwin.com/ download Cygwin])<br />
** When you run the cygwin setup utility make sure you have selected to install '''patchutils''', '''flex''', '''bison''', and '''zlib-devel'''(all located under "devel"), '''openssh''' (located under "Net"), which are not part of the default install. (If you missed one of these, the easiest thing to do is to re-run the entire installation.)<br />
* '''Python''' (download either [http://www.python.org/download/ Python.org Standard Python] or [http://www.activestate.com/Products/ActivePython/?mp=1 ActivePython]<br />
** 2.4.3 is the minimum required version.<br />
** Use version v2.5 preferably. If you use a version newer than 2.5, you may need to change the <code>Python.cmake</code> file. See the [[Talk:CMake#CMake_and_Python_2.6|CMake discussion]] for details (this change was necessary as of 1.21-r99587 source branch). ) <br />
* '''The Windows Platform SDK'''<br />
** Get the latest version (as of 23 March 2010) here: [http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=c17ba869-9671-4330-a63e-1fd44e0e2505&displayLang=en Windows SDK for Windows Server 2008 and .NET Framework 3.5 SP1] (If you use the web installer, you can choose only the "Development Tools" and "Samples Win32", which is referenced by viewer-development source, to cut the download size significantly. Watch those version descriptions closely. v6.1 seems to work fine but v7.0, when combined with the components above, results in linking errors stating libraries are corrupted.) <br />
* '''DirectX SDK'''<br />
** Get the latest version (as of 7 June 2010) here: [http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba DirectX SDK (June 2010)]<br />
<br />
Verify that Cygwin, CMake, and Python are in the windows "PATH".<br />
<br />
'''NOTE:''' '''DO NOT''' use the Cygwin version of CMake or Python. The Build will fail. (CMake specifically excludes the Cygwin version of Python, in the <code>Python.cmake</code> file)<br />
<br />
== Downloading Source Code ==<br />
<br />
{{KBcaution|Make sure you install to paths without spaces in it.}}<br />
<br />
You can download the Viewer source code on the [[source downloads]] page. You can also use a [[version control repository]]. If you're just starting out, it's probably best to get the latest Release version, rather than a Release Candidate, because the Release Candidates get updated quite often. But if you would rather work with the latest code, go for the [[version control repository]] "trunk". Don't forget to also download the artwork and library bundles relevant to the repository branch you're using as explained in [[Version_control_repository#Artwork_and_Library_Bundles|Artwork and Library Bundles]].<br />
<br />
If you're downloading from the [[source downloads]] page, there are three packages to get: the source package, the artwork package, and the library package. In versions 1.20 and earlier, Linden packaged the library binaries in the Libs package. For 1.21 and beyond, the CMake <code>develop.py</code> script now downloads '''most''' of the libraries that were previously in the libs zip file. This saves developers who are tracking trunk from constantly downloading them every update and only downloads updated libraries. As of this writing, there are some pieces packages that still require downloading, so be sure to grab the library and artwork bundles from the [[source downloads]] page.<br />
<br />
'''WARNING:'''<br />
* If the directory path you keep the SL source in has a space in it, the batch file that copies <code>message_template.msg</code> will fail. So, if you unzip or checkout the source tree into, e.g., <code>C:\Projects\Dir with space in name\Etc\linden</code>, it won't work!<br />
* You should also avoid using non-ASCII (national) characters in the paths, although some localized versions of the tool puts some as a default...<br />
* Unzip or checkout your source tree into a directory that has as short full pathname as possible, since long paths cause some unexpected trouble during the build.<br />
<br />
In other words, the easiest way to get this working is to get '''source''', '''artwork''', and '''libs''' from the [[source downloads]] page and unpack them all into the same directory/folder, which ideally would be a folder in (or near) the root directory with a short name like <code>sl_1_21_6</code>.<br />
<br />
== Installing libraries ==<br />
<br />
SL Viewer depends on some third party libraries. Some of them are open source, some others are not.<br />
<br />
=== Open source libraries ===<br />
<br />
As of Viewer version 1.21, all open source libraries are automatically downloaded as part of the build script invoked by <code>develop.py</code>, unless you choose to configure a standalone build.<br />
<br />
=== Proprietary libraries ===<br />
<br />
Linden Lab does not provide proprietary libraries. You will need to follow the instructions here under to acquire and copy them to your source tree.<br />
<br />
It's probably a good idea to build an empty directory tree for those files, copy the relevant proprietary files there and, once done, copy the whole to your source tree (like <code>XCOPY OLIB SL_1_16_0_5 /S</code>). The reason is that these steps are cumbersome and will have to be repeated for each new release (at least if you keep the source for each release in its own folder). If you do not want to do this, you can just as well copy the files directly into the linden source paths.<br />
<br />
rem OLIBS.CMD to build a folder tree for 3rd party libraries and includes<br />
md olibs<br />
md olibs\linden\<br />
md olibs\linden\libraries<br />
md olibs\linden\libraries\include<br />
md olibs\linden\libraries\i686-win32<br />
md olibs\linden\libraries\i686-win32\lib_release<br />
md olibs\linden\libraries\i686-win32\lib_debug<br />
md olibs\linden\libraries\i686-win32\include<br />
md olibs\linden\libraries\i686-win32\include\GL<br />
md olibs\linden\libraries\i686-win32\include\quicktime<br />
md olibs\linden\indra<br />
md olibs\linden\indra\newview<br />
<br />
<br />
==== Fmod ==== <br />
* Download & extract [http://www.fmod.org/files/fmod3/fmodapi375win.zip FMOD3.75 API for Windows]. (later versions, like FMOD Ex, are incompatible).<br />
* Copy <code>fmodapi375win\api\inc\fmod.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\inc\fmod_errors.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\inc\fmoddyn.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\lib\fmodvc.lib</code> to <code>linden\libraries\i686-win32\lib_release</code> and to <code>linden\libraries\i686-win32\lib_debug</code><br />
(If using cmake, copy <code>fmodapi375win\api\lib\fmodvc.lib</code> to <code>linden\libraries\i686-win32\lib\release</code> and to <code>linden\libraries\i686-win32\lib\debug</code>)<br />
* Copy <code>fmodapi375win\api\fmod.dll</code> to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
<br />
Note to Snowstorm users: if you are building using the Mercurial repository [https://bitbucket.org/lindenlab/viewer-development lindenlab/viewer-development], these steps have been simplified and cleaned up. In particular, there's no need to drop anything under <code>linden\indra</code> anymore, all the files are under <code>linden\libraries</code> like for other 3rd party libraries. The <code>fmodvc.lib</code> however needs to be renamed <code>fmod.lib</code>. The new instructions are:<br />
* Download & extract [http://www.fmod.org/files/fmod3/fmodapi375win.zip FMOD3.75 API for Windows]<br />
* From <code>fmodapi375win\api\inc\</code>, copy <code>fmod.h</code> and <code>fmod_errors.h</code> to <code>linden\libraries\include</code><br />
* From <code>fmodapi375win\api\lib</code>, choose the relevant <code>.lib</code> that correspond to your environment (e.g. <code>fmodvc.lib</code> for Visual Studio), rename it <code>fmod.lib</code> and copy it to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
* From <code>fmodapi375win\api</code> copy <code>fmod.dll</code> to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
<br />
==== Quicktime ====<br />
<br />
Currently - as of version 1.21 - CMake requires Quicktime to be installed.<br />
<br />
'''Note:''' This download requires a registration at the Apple Quicktime website and take a bit of time. You can avoid using QuickTime if you want, see [[Compiling_older_Viewers_(1.20_and_earlier_with_MSVS)#QuickTime_removal|this]] for details. Remember that your Viewer '''can't play in-world movies''' if you do so.<br />
* Download & install the [http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wo/11.1.17.2.1.3.3.1.0.1.1.0.3.11.3.3.1#main Quicktime SDK for Windows]<br />
* Copy <code>QuicktimeSDK\Libraries\QTMLClient.lib</code> to <code>linden\libraries\i686-win32\lib_release</code> and to <code>linden\libraries\i686-win32\lib_debug</code>.<br />
<br />
(If using CMake, copy <code>QuicktimeSDK\Libraries\QTMLClient.lib</code> to <code>linden\libraries\i686-win32\lib\release</code> and to <code>linden\libraries\i686-win32\lib\debug</code> instead)<br />
<br />
* Copy the contents of <code>QuicktimeSDK\CIncludes</code> into <code>linden\libraries\i686-win32\include\quicktime</code>.<br />
<br />
== Building the Viewer ==<br />
<br />
At this point, you should be ready to use [[CMake]] to build the Visual Studio solution for the project. <br />
<br />
'''NOTE''': CMake is only supported for Viewer versions 1.21 and beyond. <br />
<br />
Before you first run a build, you'll need to configure things. It is recommended that you use the <code>develop.py</code> script that will create a default configuration for you.<br />
<br />
You must make sure that cmake is registered in the Windows environment or you will get strange errors from <code>develop.py</code>. To ensure everything is correct, right click My Computer -> Properties -> Advanced -> Environment Variables -> Inside System Variables, choose PATH (case insensitive) and click Edit. Now in the value field, go to the end of the value and add a semicolon (<code>;</code>), and then the folder containing the CMake binaries (example: <code>C:\Program Files\CMake 2.8\bin</code>). This might already have been set by the CMake installer.<br />
<br />
From the command line, navigate to the <code>indra</code> folder of your source tree and run:<br />
<br />
python develop.py<br />
<br />
CMake will pick the most recent version of Visual Studio we support. If you want to specify the version of Visual Studio to use.<br />
<br />
* VisualStudio 2005:<br />
<br />
python develop.py -G VC80<br />
<br />
* VisualStudio 2008:<br />
<br />
python develop.py -G VC90<br />
<br />
'''NOTE:''' The above commands will configure a "non-standalone" version of the source code tree. This means that the required third party library packages (as built by Linden Lab) will be downloaded during the CMake process.<br />
<br />
=== Finding your build directory ===<br />
<br />
In the CMake world, we keep source and object files separate. The <code>develop.py</code> script did create and populate a build directory for you. It is in one of the following locations:<br />
* VS 2005: <code>indra/build-vc80</code><br />
* VS 2008: <code>indra/build-vc90</code> <br />
<br />
=== Compiling ===<br />
<br />
To start a build, do one of the following:<br />
* Run <code>python develop.py build</code> from the <code>indra</code> directory.<br />
** '''NOTE FOR VS 2008 USERS:''' This command will not work, since it will only look for VS 2005. Instead, run the command <code>python develop.py -G VC90 build</code><br />
* Load the Visual Studio solution into your IDE. For MSVS VC++:<br />
** Use "File -> Open -> Project/Solution", and open the <code>linden/indra/build-VC80/SecondLife.sln</code> solution file<br />
*** '''NOTE FOR VS 2008 USERS:''' Even though a build-VC90 was created in the above steps, <code>developer.py</code> places the VS 2008 solution/project files in the <code>indra</code> directory. Don't move them to <code>build-VC90</code> - the paths in the project files are relative to the <code>indra</code> directory.<br />
** In the MSVS toolbar, just to the right of the triangular "Start Debugging" arrow, is a text box whose tooltip is "Solution Configurations". Select RelWithDebugInfo.<br />
** If ALL_BUILD is not set as your StartUp Project (the StartUp Project is displayed in bold font), right-click on ALL_BUILD and choose "Set as StartUp Project".<br />
** Right-click on ALL_BUILD and choose "Properties". In "Configuration Properties -> Debugging", find "Working Directory" and navigate to <code>linden\indra\newview</code>.<br />
** (For Snowglobe 1.x) In the Solution Explorer pane, right-click on the project named "prepare" and select Project Only -> Build Only prepare. This downloads and installs precompiled libraries and only needs to be done when the source tree is clean or if libraries in the list included in the source tree get updated. Running this when not required is brief and causes no harm.<br />
** Build -> Build Solution (F7)<br />
** Debug -> "Start Debugging" or "Start without debugging".<br />
** MSVC might not be able to find the executable. If not, point it to <code>linden\indra\build-VC80\newview\relwithdebinfo\secondlife-bin.exe</code>, and try again.<br />
** You may see an error due to not being able to find <code>fmod.dll</code>. If so, find a copy (remember, you copied this in a step above) and copy it into <code>indra\build-VC80\newview\relwithdebinfo</code>. Try again.<br />
** You may see an error due to not finding <code>llkdu.dll</code>. If so, find it in the normal installed version (make sure it's the same version as your source) and copy it into <code>indra\build-VC80\newview\relwithdebinfo</code>. Try again.<br />
** Good luck!<br />
<br />
=== Where's the built Viewer? ===<br />
<br />
On Windows, the built Viewer ought to run from VS2005.<br />
<br />
To run outside MS VS, see Discussion tab:<br />
[[Talk:Microsoft_Windows_Builds#Running_viewer_outside_of_MS_VS]]<br />
<br />
=== Build instructions for 1.20 and earlier ===<br />
<br />
See [[Compiling older Viewers (1.20 and earlier with MSVS)]] if you'd like to compile a version of the Viewer older than 1.20.<br />
<br />
== What to do if it doesn't work for you ==<br />
<br />
* Ask for help on [[IRC]] ([irc://irc.freenode.net/opensl #opensl on freenode])<br />
* Find someone on the [[OpenSource-Dev|OpenSource-Dev mailing list]]<br />
* Fix it: [[Modifying CMake Files]] (and please, submit a patch!)<br />
<br />
Please also see the (user contributed) instructions at [[User:Michelle2_Zenovka/cmake]]<br />
<br />
[[Category:Compiling viewer]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Building_the_Viewer_with_Autobuild&diff=1139969Building the Viewer with Autobuild2011-04-11T19:03:47Z<p>Jenn Linden: </p>
<hr />
<div>{{Autobuild Nav}}<br />
=== Install autobuild ===<br />
If you haven't done so already, install ''autobuild''. Full instructions can be found on the [[Autobuild]] page, but most users may simply use<br />
[http://pypi.python.org/pypi/setuptools easy_install] autobuild<br />
or<br />
[http://pypi.python.org/pypi/pip pip] install autobuild<br />
to install.<br />
<br />
=== Build a desired configuration ===<br />
With a properly configured developer machine (see [[Get_source_and_compile#Compiling| compiling]]), building the viewer with ''autobuild'' is as simple as invoking<br />
autobuild build -c [CONFIGURATION]<br />
where '''CONFIGURATION''' stands for the build configuration you would like to build. The build configurations defined in the viewer's ''autobuild.xml'' file follow some simple conventions which we describe below. As a developer you should choose the appropriate build configuration for your needs. After a build has completed, the resulting product will be found in the build directory named ''build-*'' where the ''*'' is wildcard representing the platform dependent part of the name.<br />
<br />
Developers who wish to build a viewer with an IDE don't have to do a full command line build. Using<br />
autobuild configure -c [CONFIGURATION]<br />
Will install any dependencies (if the build configuration uses them) and construct an appropriate project or solution file (''.xcodeproj'' for mac and ''.sln'' for windows) inside the build directory.<br />
<br />
==== Base build configurations ====<br />
There are three basic types of build configurations which are used to vary the debugability of the resulting build versus optimization. These configurations are:<br />
* '''Debug''' &mdash; unoptimized with debugging information.<br />
* '''RelWithDebInfo''' &mdash; optimized but with debugging information.<br />
* '''Release''' &mdash; optimized with no debug information.<br />
'''Debug''' will result in a slow client but is the easiest to use with a debugger. '''RelWithDebInfo''' is significantly faster and is often easy to debug, but code optimizations may occasionally make tracking program flow in a debugger challenging. '''Release''' is used for building a shipping version of the viewer.<br />
<br />
==== Build variations for open source developers ====<br />
The unmodified build configurations defined in the previous section are configured for use by Linden developers and may require access to installables which are not publicly available. For open source developers two variations are provided to support development by third parties using the following prefixes:<br />
* '''OpenSource''' &mdash; build a viewer using only publicly distributed installables.<br />
* '''OpenSourceStandAlone''' &mdash; build a viewer without using any installable packages provided by Linden.<br />
*: Developers will need to install any 3<sup>rd</sup> party dependencies manually.<br />
To build an open source configuration choose a build configuration which is a concatenation of one of the two above prefixes with a base configuration name. For example to build a stand alone viewer with release optimization including debug information run<br />
autobuild build -c OpenSourceStandAloneRelWithDebInfo<br />
<br />
==== Custom builds ====<br />
If none of the predefined build configurations matches your needs, you have two options for building with exactly the options you need. If you just need to pass an extra configuration option, you should first run the ''configure'' command with the following syntax<br />
autobuild configure -c [build configuration] -- [Option, [Option...]]<br />
Options which appear after the '''--''' are passed through to the configuration command. Now you may build using<br />
autobuild configure -c [build configuration] --no-configure -- [Option, [Option]]<br />
passing any options that should be forwarded to the build command after the '''--'''. Using the ''--no-configure'' option prevents the configure step from being run again (potentially reverting any option you passed) during the build step.<br />
<br />
Alternatively you may add a new configuration to the ''autobuild.xml'' configuration file using<br />
autobuild edit configure<br />
and<br />
autobuild edit build<br />
to interactively create new configure and build configurations. More information on creating these configurations may be found in the [[Autobuild_How_To]] page.<br />
<br />
[[Category:Autobuild]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Building_the_Viewer_with_Autobuild&diff=1139968Building the Viewer with Autobuild2011-04-11T19:02:24Z<p>Jenn Linden: </p>
<hr />
<div>{{Autobuild Nav}}<br />
=== Install autobuild ===<br />
If you haven't done so already, install ''autobuild''. Full instructions can be found on the [[Autobuild]] page, but most users may simply use<br />
[http://pypi.python.org/pypi/setuptools easy_install] autobuild<br />
or<br />
[http://pypi.python.org/pypi/pip pip] install autobuild<br />
to install.<br />
<br />
{{KBnote|1=If you're building using cygwin (not recommended), you'll also need to do the following:<br />
Add the /cygdrive/c/Python26/Scripts (on some installations, /cygdrive/c/Python26/Tools/Scripts) directory to your cygwin path. <br/><br />
In your cygwin '''.bashrc''' file:<br />
<pre><br />
pattern=/cygdrive/c/Python26/Scripts<br />
if [ -d "${pattern}" ] ; then<br />
already_exists=`echo $PATH | grep -o $pattern`<br />
if [ -z $already_exists ]; then<br />
PATH=$pattern:${PATH}<br />
fi<br />
fi <br />
</pre>}}<br />
<br />
=== Build a desired configuration ===<br />
With a properly configured developer machine (see [[Get_source_and_compile#Compiling| compiling]]), building the viewer with ''autobuild'' is as simple as invoking<br />
autobuild build -c [CONFIGURATION]<br />
where '''CONFIGURATION''' stands for the build configuration you would like to build. The build configurations defined in the viewer's ''autobuild.xml'' file follow some simple conventions which we describe below. As a developer you should choose the appropriate build configuration for your needs. After a build has completed, the resulting product will be found in the build directory named ''build-*'' where the ''*'' is wildcard representing the platform dependent part of the name.<br />
<br />
Developers who wish to build a viewer with an IDE don't have to do a full command line build. Using<br />
autobuild configure -c [CONFIGURATION]<br />
Will install any dependencies (if the build configuration uses them) and construct an appropriate project or solution file (''.xcodeproj'' for mac and ''.sln'' for windows) inside the build directory.<br />
<br />
==== Base build configurations ====<br />
There are three basic types of build configurations which are used to vary the debugability of the resulting build versus optimization. These configurations are:<br />
* '''Debug''' &mdash; unoptimized with debugging information.<br />
* '''RelWithDebInfo''' &mdash; optimized but with debugging information.<br />
* '''Release''' &mdash; optimized with no debug information.<br />
'''Debug''' will result in a slow client but is the easiest to use with a debugger. '''RelWithDebInfo''' is significantly faster and is often easy to debug, but code optimizations may occasionally make tracking program flow in a debugger challenging. '''Release''' is used for building a shipping version of the viewer.<br />
<br />
==== Build variations for open source developers ====<br />
The unmodified build configurations defined in the previous section are configured for use by Linden developers and may require access to installables which are not publicly available. For open source developers two variations are provided to support development by third parties using the following prefixes:<br />
* '''OpenSource''' &mdash; build a viewer using only publicly distributed installables.<br />
* '''OpenSourceStandAlone''' &mdash; build a viewer without using any installable packages provided by Linden.<br />
*: Developers will need to install any 3<sup>rd</sup> party dependencies manually.<br />
To build an open source configuration choose a build configuration which is a concatenation of one of the two above prefixes with a base configuration name. For example to build a stand alone viewer with release optimization including debug information run<br />
autobuild build -c OpenSourceStandAloneRelWithDebInfo<br />
<br />
==== Custom builds ====<br />
If none of the predefined build configurations matches your needs, you have two options for building with exactly the options you need. If you just need to pass an extra configuration option, you should first run the ''configure'' command with the following syntax<br />
autobuild configure -c [build configuration] -- [Option, [Option...]]<br />
Options which appear after the '''--''' are passed through to the configuration command. Now you may build using<br />
autobuild configure -c [build configuration] --no-configure -- [Option, [Option]]<br />
passing any options that should be forwarded to the build command after the '''--'''. Using the ''--no-configure'' option prevents the configure step from being run again (potentially reverting any option you passed) during the build step.<br />
<br />
Alternatively you may add a new configuration to the ''autobuild.xml'' configuration file using<br />
autobuild edit configure<br />
and<br />
autobuild edit build<br />
to interactively create new configure and build configurations. More information on creating these configurations may be found in the [[Autobuild_How_To]] page.<br />
<br />
[[Category:Autobuild]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Building_the_Viewer_with_Autobuild&diff=1139967Building the Viewer with Autobuild2011-04-11T19:00:27Z<p>Jenn Linden: Adding note regarding cygwin installation requiring additional path configuration.</p>
<hr />
<div>{{Autobuild Nav}}<br />
=== Install autobuild ===<br />
If you haven't done so already, install ''autobuild''. Full instructions can be found on the [[Autobuild]] page, but most users may simply use<br />
[http://pypi.python.org/pypi/setuptools easy_install] autobuild<br />
or<br />
[http://pypi.python.org/pypi/pip pip] install autobuild<br />
to install.<br />
<br />
{{KBnote|1=If you're building using cygwin, you'll also need to do the following:<br />
Add the /cygdrive/c/Python26/Scripts (on some installations, /cygdrive/c/Python26/Tools/Scripts) directory to your cygwin path. <br/><br />
In your cygwin '''.bashrc''' file:<br />
<pre><br />
pattern=/cygdrive/c/Python26/Scripts<br />
if [ -d "${pattern}" ] ; then<br />
already_exists=`echo $PATH | grep -o $pattern`<br />
if [ -z $already_exists ]; then<br />
PATH=$pattern:${PATH}<br />
fi<br />
fi <br />
</pre>}}<br />
<br />
=== Build a desired configuration ===<br />
With a properly configured developer machine (see [[Get_source_and_compile#Compiling| compiling]]), building the viewer with ''autobuild'' is as simple as invoking<br />
autobuild build -c [CONFIGURATION]<br />
where '''CONFIGURATION''' stands for the build configuration you would like to build. The build configurations defined in the viewer's ''autobuild.xml'' file follow some simple conventions which we describe below. As a developer you should choose the appropriate build configuration for your needs. After a build has completed, the resulting product will be found in the build directory named ''build-*'' where the ''*'' is wildcard representing the platform dependent part of the name.<br />
<br />
Developers who wish to build a viewer with an IDE don't have to do a full command line build. Using<br />
autobuild configure -c [CONFIGURATION]<br />
Will install any dependencies (if the build configuration uses them) and construct an appropriate project or solution file (''.xcodeproj'' for mac and ''.sln'' for windows) inside the build directory.<br />
<br />
==== Base build configurations ====<br />
There are three basic types of build configurations which are used to vary the debugability of the resulting build versus optimization. These configurations are:<br />
* '''Debug''' &mdash; unoptimized with debugging information.<br />
* '''RelWithDebInfo''' &mdash; optimized but with debugging information.<br />
* '''Release''' &mdash; optimized with no debug information.<br />
'''Debug''' will result in a slow client but is the easiest to use with a debugger. '''RelWithDebInfo''' is significantly faster and is often easy to debug, but code optimizations may occasionally make tracking program flow in a debugger challenging. '''Release''' is used for building a shipping version of the viewer.<br />
<br />
==== Build variations for open source developers ====<br />
The unmodified build configurations defined in the previous section are configured for use by Linden developers and may require access to installables which are not publicly available. For open source developers two variations are provided to support development by third parties using the following prefixes:<br />
* '''OpenSource''' &mdash; build a viewer using only publicly distributed installables.<br />
* '''OpenSourceStandAlone''' &mdash; build a viewer without using any installable packages provided by Linden.<br />
*: Developers will need to install any 3<sup>rd</sup> party dependencies manually.<br />
To build an open source configuration choose a build configuration which is a concatenation of one of the two above prefixes with a base configuration name. For example to build a stand alone viewer with release optimization including debug information run<br />
autobuild build -c OpenSourceStandAloneRelWithDebInfo<br />
<br />
==== Custom builds ====<br />
If none of the predefined build configurations matches your needs, you have two options for building with exactly the options you need. If you just need to pass an extra configuration option, you should first run the ''configure'' command with the following syntax<br />
autobuild configure -c [build configuration] -- [Option, [Option...]]<br />
Options which appear after the '''--''' are passed through to the configuration command. Now you may build using<br />
autobuild configure -c [build configuration] --no-configure -- [Option, [Option]]<br />
passing any options that should be forwarded to the build command after the '''--'''. Using the ''--no-configure'' option prevents the configure step from being run again (potentially reverting any option you passed) during the build step.<br />
<br />
Alternatively you may add a new configuration to the ''autobuild.xml'' configuration file using<br />
autobuild edit configure<br />
and<br />
autobuild edit build<br />
to interactively create new configure and build configurations. More information on creating these configurations may be found in the [[Autobuild_How_To]] page.<br />
<br />
[[Category:Autobuild]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Viewer_2_Microsoft_Windows_Builds&diff=1139966Viewer 2 Microsoft Windows Builds2011-04-11T18:59:00Z<p>Jenn Linden: </p>
<hr />
<div>{{multi-lang}}<br />
{{CompileNav}}<br />
<br />
{{KBwarning|custom=Work in progress|'''These instructions are not yet complete or debugged''' as of March 22, 2011.}}<br />
<br />
When finished, we hope this page will constitute a complete recipe for compiling viewer 2 from source on a Windows machine. <br />
<br />
Philosophy: to keep it brief, this page should only include steps we KNOW ARE NEEDED, not random hints. Extra details or open issues can go on the talk page.<br />
<br />
{{KBnote|Following this recipe will probably take 6 to 12 hours of wall-clock time, and 2 to 6 hours of your time, if you're starting from a fresh Windows XP/Vista/7 system.}}<br />
<br />
== Establish your programming environment ==<br />
This is needed for compiling any viewer based on the LL open source code, but only needs to be done once.<br />
#Obtain Visual Studio 2010 (Express is OK)<br />
#:[http://www.microsoft.com/express/download/ Click here to download Visual C++ Express - current version is VS2010]<br />
#Install Microsoft Platform & DirectX SDKs<br />
#:Download and install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=35aeda01-421d-4ba5-b44b-543dc8c33a20 Windows SDK for Windows 7 and .NET Framework 4 (ISO)] or [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6B6C21D2-2006-4AFA-9702-529FA782D63B Windows SDK for Windows 7 and .NET Framework 4 (Web Install)], and <br />
#:[http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba Download and install DirectX SDK (June 2010)]<br />
#Run Microsoft Update, and keep running it until no updates are needed. This may take 6~8 iterations on older versions of windows.<br />
#Install other development tools<br />
#*[http://code.google.com/p/unsis/downloads/list Unicode NSIS (Nullsoft Scriptable Install System)]<br />
#*:This is the package installer used to build Setup.exe.<br />
#*[http://www.cmake.org/files/v2.8/ CMake]<br />
#*:This should be version 2.8.4 (or above in the 2.8.x series). Ensure that any older versions aren't in your PATH environment variables.<br />
#*[http://www.cygwin.com/ Cygwin]<br />
#*:When you run the Cygwin setup utility make sure you have selected to install patchutils, flex, and bison (all located under "devel") which are not part of the default install. Do not install Cygwin Python or Mercurial. You won't need to use the Cygwin shell for anything; just have the binaries accessible to the regular command line via your PATH.<br />
#*Python (either [http://www.python.org/download/ Python.org Standard Python] or [http://www.activestate.com/activepython/downloads ActivePython])<br />
#*:Note: build scripts support Python 2.6, not 2.7 yet.<br />
#*Mercurial (either [http://tortoisehg.bitbucket.org/ TortoiseHg] or [http://mercurial.selenic.com/release/windows/Mercurial-1.7.5.exe Mercurial Hg]) <br />
#*''(optional)'' [http://notepadplusplus.org/ Notepad++]<br />
#*:You need to use an editor that conforms to the [[Coding Standard]]. In particular, you must not check in files with DOS line endings except in very limited circumstances; see [[How to avoid DOS line endings in Windows tools]].<br />
<br />
{{KBnote|If the installer for a particular package does not update your PATH environment setting you will have to do this manually.}}<br />
<br />
{{KBcaution|The native Cygwin python and hg do not work very well and should be avoided.}}<br />
If necessary, use the following shell scripts to update your Cygwin installation to use the Windows native versions of these apps:<br />
*Override cygwin's python:<br />
if [ -f /usr/bin/python.exe ]; then<br />
mv /usr/bin/python.exe /usr/bin/cygwin-python.exe<br />
fi<br />
cp /cygdrive/c/Python26/python.exe /usr/bin/python.exe<br />
*Override cygwin's mercurial:<br />
if [ -f /usr/bin/hg.exe ]; then<br />
mv /usr/bin/hg.exe /usr/bin/cygwin-hg.exe<br />
fi<br />
cp /cygdrive/c/Program\ Files/Mercurial/hg.exe /usr/bin/hg.exe<br />
* Rename cygwin's link to allow VS2010 linker to run:<br />
if [ -f /usr/bin/link.exe ]; then<br />
mv /usr/bin/link.exe /usr/bin/cygwin-link.exe<br />
fi<br />
<br />
== Set up your source code tree ==<br />
<br />
Plan your directory structure ahead of time. If you are going to be producing changes or patches you will be cloning a copy of an unaltered source code tree for every change or patch you make, so you might want to have all this work stored in it's own directory.<br />
<br />
To get a copy of the source code tree:<br />
* Open up a DOS/Command window<br />
* Make a directory to contain it (it is strongly suggested to name it <code>viewer-development</code>)<br />
* Go into that directory<br />
* Do <code>hg init</code><br />
* Do <code>hg pull <nowiki>http://hg.secondlife.com/viewer-development</nowiki></code><br />
<br />
* Example: ((specific snapshot example TBD))<br />
<br />
Let's say some time has gone by since you have performed the previous steps and now you want to develop a change or work on a jira. You will<br />
* Go into <code>viewer-development</code> (or whatever you named the master source tree copy)<br />
* Do <code>hg pull</code><br />
* Do <code>hg update</code><br />
* Move up one level from <code>viewer-development</code><br />
* Do <code>hg clone viewer-development VWR-nnnnn</code> (where <code>nnnnn</code> is the jira number, or clone to a name of your choosing if there is not jira number)<br />
<br />
== Run Autobuild ==<br />
First, install [[Autobuild]] into Python, by running '''one''' of the following at the command line:<br />
* <code>[http://pypi.python.org/pypi/setuptools easy_install] autobuild</code><br />
* <code>[http://pypi.python.org/pypi/pip pip] install autobuild</code><br />
<br />
Then decide whether you want to build at the command line, or generate a Visual Studio solution. (For details on either, see [[Building the Viewer with Autobuild]].)<br />
<br />
=== Build the viewer with autobuild ===<br />
At the command line in the source tree's root directory (e.g. <code>C:\linden\viewer-development\</code>), run:<br />
autobuild build -c [CONFIGURATION]<br />
...where <code>[CONFIGURATION]</code> is one of those listed at [[Building the Viewer with Autobuild#Build a desired configuration]] (Debug, RelWithDebInfo, Release, etc.)<br />
<br />
=== Compile using the IDE ===<br />
At the command line in the source tree's root directory (e.g. <code>C:\linden\viewer-development\</code>), run:<br />
autobuild configure<br />
This will create the ''build-vc100'' directory at the root of the source tree, in which contains the ''SecondLife.sln'' solution file. The solution is fully configured and ready to be built - open it and compile.<br />
<br />
== Iteratively fix things until the compile succeeds ==<br />
<br />
* If Cmake/Autobuild attempts to download FMOD and can't, one can turn off FMOD by adding two dashes (<code>--</code>), and then the extra configuration option <code>-DFMOD:BOOL=FALSE</code>. Similarly, if it attempts to download KDU and can't, try adding <code>-DINSTALL_PROPRIETARY:BOOL=FALSE -DUSE_KDU:BOOL=FALSE</code> after those dashes.<br />
*: For example, <code>autobuild configure -- -DFMOD:BOOL=FALSE -DINSTALL_PROPRIETARY:BOOL=FALSE -DUSE_KDU:BOOL=FALSE</code><br />
<br />
((TBD - add any fixup steps here. e.g. does <code>fmod375.dll</code> need to be moved into <code>RelWithDbgInfo</code> at this step?))<br />
<br />
* report your experiences, if useful, on the talk page, [[Talk:Viewer 2 Microsoft Windows Builds]]<br />
<br />
== Common Issues/Bugs/Glitches And Solutions ==<br />
<br />
*Getting help:<br />
** Subscribe to [[OpenSource-Dev|OpenSource-Dev Mailing List]] ([https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev subscribe]) and post your question there.<br />
** For faster response, find a free IRC client program and join [irc://irc.freenode.org/opensl #opensl on freenode], the general open source viewer discussion and development channel. Hopefully a helpful person is online when you ask your question.<br />
<br />
== References ==<br />
<br />
* Tip of the hat to Nicky_Perian for [[User:Nicky_Perian/Visual_Studio_10_Autobuild]]<br />
<br />
[[Category:Compiling viewer]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Viewer_2_Microsoft_Windows_Builds&diff=1139960Viewer 2 Microsoft Windows Builds2011-04-11T18:34:10Z<p>Jenn Linden: </p>
<hr />
<div>{{multi-lang}}<br />
{{CompileNav}}<br />
<br />
{{KBwarning|custom=Work in progress|'''These instructions are not yet complete or debugged''' as of March 22, 2011.}}<br />
<br />
When finished, we hope this page will constitute a complete recipe for compiling viewer 2 from source on a Windows machine. <br />
<br />
Philosophy: to keep it brief, this page should only include steps we KNOW ARE NEEDED, not random hints. Extra details or open issues can go on the talk page.<br />
<br />
{{KBnote|Following this recipe will probably take 6 to 12 hours of wall-clock time, and 2 to 6 hours of your time, if you're starting from a fresh Windows XP/Vista/7 system.}}<br />
<br />
== Establish your programming environment ==<br />
This is needed for compiling any viewer based on the LL open source code, but only needs to be done once.<br />
#Obtain Visual Studio 2010 (Express is OK)<br />
#:[http://www.microsoft.com/express/download/ Click here to download Visual C++ Express - current version is VS2010]<br />
#Install Microsoft Platform & DirectX SDKs<br />
#:Download and install [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=35aeda01-421d-4ba5-b44b-543dc8c33a20 Windows SDK for Windows 7 and .NET Framework 4 (ISO)] or [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6B6C21D2-2006-4AFA-9702-529FA782D63B Windows SDK for Windows 7 and .NET Framework 4 (Web Install)], and <br />
#:[http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba Download and install DirectX SDK (June 2010)]<br />
#Run Microsoft Update, and keep running it until no updates are needed. This may take 6~8 iterations on older versions of windows.<br />
#Install other development tools<br />
#*[http://code.google.com/p/unsis/downloads/list Unicode NSIS (Nullsoft Scriptable Install System)]<br />
#*:This is the package installer used to build Setup.exe.<br />
#*[http://www.cmake.org/files/v2.8/ CMake]<br />
#*:This should be version 2.8.4 (or above in the 2.8.x series). Ensure that any older versions aren't in your PATH environment variables.<br />
#*[http://www.cygwin.com/ Cygwin]<br />
#*:When you run the Cygwin setup utility make sure you have selected to install patchutils, flex, and bison (all located under "devel") which are not part of the default install. Do not install Cygwin Python or Mercurial. You won't need to use the Cygwin shell for anything; just have the binaries accessible to the regular command line via your PATH.<br />
#*Python (either [http://www.python.org/download/ Python.org Standard Python] or [http://www.activestate.com/activepython/downloads ActivePython])<br />
#*:Note: build scripts support Python 2.6, not 2.7 yet.<br />
#*Mercurial (either [http://tortoisehg.bitbucket.org/ TortoiseHg] or [http://mercurial.selenic.com/release/windows/Mercurial-1.7.5.exe Mercurial Hg]) <br />
#*''(optional)'' [http://notepadplusplus.org/ Notepad++]<br />
#*:You need to use an editor that conforms to the [[Coding Standard]]. In particular, you must not check in files with DOS line endings except in very limited circumstances; see [[How to avoid DOS line endings in Windows tools]].<br />
<br />
{{KBnote|If the installer for a particular package does not update your PATH environment setting you will have to do this manually.}}<br />
<br />
{{KBcaution|The native Cygwin python and hg do not work very well and should be avoided.}}<br />
If necessary, use the following shell scripts to update your Cygwin installation to use the Windows native versions of these apps:<br />
*Override cygwin's python:<br />
if [ -f /usr/bin/python.exe ]; then<br />
mv /usr/bin/python.exe /usr/bin/cygwin-python.exe<br />
fi<br />
cp /cygdrive/c/Python26/python.exe /usr/bin/python.exe<br />
*Override cygwin's mercurial:<br />
if [ -f /usr/bin/hg.exe ]; then<br />
mv /usr/bin/hg.exe /usr/bin/cygwin-hg.exe<br />
fi<br />
cp /cygdrive/c/Program\ Files/Mercurial/hg.exe /usr/bin/hg.exe<br />
<br />
== Set up your source code tree ==<br />
<br />
Plan your directory structure ahead of time. If you are going to be producing changes or patches you will be cloning a copy of an unaltered source code tree for every change or patch you make, so you might want to have all this work stored in it's own directory.<br />
<br />
To get a copy of the source code tree:<br />
* Open up a DOS/Command window<br />
* Make a directory to contain it (it is strongly suggested to name it <code>viewer-development</code>)<br />
* Go into that directory<br />
* Do <code>hg init</code><br />
* Do <code>hg pull <nowiki>http://hg.secondlife.com/viewer-development</nowiki></code><br />
<br />
* Example: ((specific snapshot example TBD))<br />
<br />
Let's say some time has gone by since you have performed the previous steps and now you want to develop a change or work on a jira. You will<br />
* Go into <code>viewer-development</code> (or whatever you named the master source tree copy)<br />
* Do <code>hg pull</code><br />
* Do <code>hg update</code><br />
* Move up one level from <code>viewer-development</code><br />
* Do <code>hg clone viewer-development VWR-nnnnn</code> (where <code>nnnnn</code> is the jira number, or clone to a name of your choosing if there is not jira number)<br />
<br />
== Run Autobuild ==<br />
First, install [[Autobuild]] into Python, by running '''one''' of the following at the command line:<br />
* <code>[http://pypi.python.org/pypi/setuptools easy_install] autobuild</code><br />
* <code>[http://pypi.python.org/pypi/pip pip] install autobuild</code><br />
<br />
Then decide whether you want to build at the command line, or generate a Visual Studio solution. (For details on either, see [[Building the Viewer with Autobuild]].)<br />
<br />
=== Build the viewer with autobuild ===<br />
At the command line in the source tree's root directory (e.g. <code>C:\linden\viewer-development\</code>), run:<br />
autobuild build -c [CONFIGURATION]<br />
...where <code>[CONFIGURATION]</code> is one of those listed at [[Building the Viewer with Autobuild#Build a desired configuration]] (Debug, RelWithDebInfo, Release, etc.)<br />
<br />
=== Compile using the IDE ===<br />
At the command line in the source tree's root directory (e.g. <code>C:\linden\viewer-development\</code>), run:<br />
autobuild configure<br />
This will create the ''build-vc100'' directory at the root of the source tree, in which contains the ''SecondLife.sln'' solution file. The solution is fully configured and ready to be built - open it and compile.<br />
<br />
== Iteratively fix things until the compile succeeds ==<br />
<br />
* If Cmake/Autobuild attempts to download FMOD and can't, one can turn off FMOD by adding two dashes (<code>--</code>), and then the extra configuration option <code>-DFMOD:BOOL=FALSE</code>. Similarly, if it attempts to download KDU and can't, try adding <code>-DINSTALL_PROPRIETARY:BOOL=FALSE -DUSE_KDU:BOOL=FALSE</code> after those dashes.<br />
*: For example, <code>autobuild configure -- -DFMOD:BOOL=FALSE -DINSTALL_PROPRIETARY:BOOL=FALSE -DUSE_KDU:BOOL=FALSE</code><br />
<br />
((TBD - add any fixup steps here. e.g. does <code>fmod375.dll</code> need to be moved into <code>RelWithDbgInfo</code> at this step?))<br />
<br />
* report your experiences, if useful, on the talk page, [[Talk:Viewer 2 Microsoft Windows Builds]]<br />
<br />
== Common Issues/Bugs/Glitches And Solutions ==<br />
<br />
*Getting help:<br />
** Subscribe to [[OpenSource-Dev|OpenSource-Dev Mailing List]] ([https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev subscribe]) and post your question there.<br />
** For faster response, find a free IRC client program and join [irc://irc.freenode.org/opensl #opensl on freenode], the general open source viewer discussion and development channel. Hopefully a helpful person is online when you ask your question.<br />
<br />
== References ==<br />
<br />
* Tip of the hat to Nicky_Perian for [[User:Nicky_Perian/Visual_Studio_10_Autobuild]]<br />
<br />
[[Category:Compiling viewer]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Preview_Grid&diff=1139499Preview Grid2011-04-06T19:17:52Z<p>Jenn Linden: /* How do I log in to Aditi? */</p>
<hr />
<div>{{Help|Viewer=*|Misc=*}}<br />
=Aditi, the Preview Grid=<br />
<br />
In addition to Second Life, the main service that many thousands of Residents log into each day, there is a second [[Land#Grid|grid]] open to the public. This grid is known as the Preview Grid, or "Aditi" (in comparison with "[[Land#Agni|Agni]]", the name we give the production Second Life environment). Aditi is where we test server software that is under development, or that will be coming to Second Life soon. After being dedicated to pre-release testing of the Havok4 physics code for many months, we are again beginning to use it for true server beta tests. It will give all of you a chance to test at the server software we're planning to deploy to Agni in the near future.<br />
<br />
<br />
==What We Do with the Preview Grid==<br />
<br />
The Preview Grid is used for a number of different things. This means that there, much more frequently than in Second Life, you will find that as you move from one region to another, you will be moving to regions that are running a different version of the server software. To get the most of the Preview Grid, you need to know where you are.<br />
<br />
===How do I know what version is running on the region I'm in?===<br />
<br />
Some regions have a "channel name" imprinted into the ground over and over again. If the ground texture doesn't make it obvious, look at "About Second Life" in the help menu. There, you will see a wealth of information about your own system, as well as about the server software that the region you are in is running. The image below shows you where in the help dialog to find the channel the region you're in is running. (Just to the right of that is the version.)<br />
<br />
[[Image:Helpversion.jpg]]<br />
<br />
The most important information in the image here is "Second Life Server"; that's the channel that you're on. The version number is also important, but the biggest changes you will see are between different channels.<br />
<br />
<br />
==Reporting Bugs or Problems==<br />
<br />
This will vary depending on the channel of the region, and on the state of the release. If you find problems in the "Second Life Beta Server" channel before that version has been deployed to the main Second Life service, please use our [http://jira.secondlife.com Bug Tracker] to check to see if that problem has already been reported, and to report it if not. When reporting a problem, please give as much information as possible: what region you were in, exactly what you did and what behavior you saw, when it happened, and the version of both your viewer software and of the server software running in the region where you saw the problem.<br />
<br />
In general, you will use the same procedure for problems found on regions in other channels, but sometimes those channels are being used for a focused test by other developers.<br />
<br />
<br />
==What is on the Preview Grid==<br />
<br />
We will be using Aditi for beta testing of the next server version, but we will also be using it for early previews of software that isn't going to be on Second Life right away, and for some specific public testing of bug-fixes being worked on by some teams of developers.<br />
<br />
The regions on Aditi are divided into different channels. There will always be two core channels:<br />
<br />
* '''Second Life Production Server''' : this has the same version of the software as is running on the main Second Life hosts. This exists for purposes of comparison. Sometimes, it will have the *previous* release, right after a new server has been deployed to Second Life.<br />
<br />
<br />
* '''Second Life Beta Server''' : this channel is designated for the version of the server we're planning on next deploying to Second Life in a rolling restart. Generally, after a new server version is deployed to Second Life, it will be at least a few days before the next beta version goes out to Aditi.<br />
<br />
In addition, there will sometimes be other channels for specific tests and/or early betas of upcoming features.<br />
<br />
<br />
==How do I log in to Aditi?==<br />
<br />
You can use the same Second Life viewer you already use to log into Second Life! At the login screen, hit {{KeyCombo|ctrl=*|shift=*|G}}. At the bottom of the screen to the right of the "Log In" button, you will see a dropdown menu that allows you to select the grid that you want to log in to:<br />
*[[Image:Whichgrid.jpg]]<br />
*Select "Agni" to log into the Second Life main grid. Select "Aditi" to log into the Preview Grid. (A number of other grids are listed in this dropdown. These are internal development grids which are not available for public access.)<br />
<br />
{{note|Starting with Viewer version 2.6.0, you will need to go to the Me->Preferences->Advanced menu and enable "Show Advanced Menu" before the above will work.}}<br />
<br />
Once you do log into Aditi, you will have all of the inventory that you have at the time when you first log in. However, new items acquired in Second Life maingrid (AGNI) will not be available to your account in Aditi until you update your account as outlined in the next section. '''IN NO EVENT''' will you be able to transfer money or objects back from the Preview Grid for use in the production Second Life maingrid (AGNI) environment.<br />
<br />
== Using Web Profiles on ADITI ==<br />
Web Profiles (https://wiki.secondlife.com/wiki/Web_profiles) are available on ADITI with a bit of tweaking. To test web based profiles in the Viewer (2.5+) on ADITI, the WebProfileURL debug setting needs to be changed before logging in to the Viewer. You have two ways of doing this:<br />
* The debug setting can be accessed via Advanced->Debug Settings. Change the value to https://my-demo.secondlife.com/. This process will be automatic once login.cgi has been updated.<br />
* You can invoke your viewer with the following executable parameter:<br />
** --set WebProfileURL "https://my-demo.secondlife.com/" <br />
** Removing this variable or setting it to "https://my.secondlife.com/" will set it back to use the AGNI based profiles<br />
* Before logging back into AGNI remove this variable.<br />
* This is ADITI, so things might be borked. Please bear with us.<br />
<br />
== Updating Your Account on Aditi ==<br />
<br />
We have an account auto updater system of sorts in place. If you cannot log into ADITI or would like your inventory updated change your password. Then your account will be updated automagically within 24 hours. You have the control to update your accounts now. You no longer need to message Oskar for account updates to ADITI.<br />
<br />
'''Account Update Steps'''<br />
# Change your login password on AGNI.<br />
#* [[Linden_Lab_Official:How_do_I_change_my_password%3F | How to change your password]]<br />
# Wait 24 hours.<br />
# Log into ADITI.<br />
# Rejoice!!<br />
<br />
== Regions on Aditi ==<br />
<br />
This is not an exhaustive list, but it does list the regions that are on Aditi and that we expect to stay on Aditi. Other regions may come and go. A "&beta;" next to the region name indicates that this region is running in the Second Life Beta Server channel, see [[Aditi Notes]] for the most current information and [http://aditi.99k.org/ADITI/aditi_sims.php this page] for the status of selected regions. Other regions are in the Second Life Production Server channel.<br />
<br />
* '''Aviation'''<br />
** Abbotts &beta;<br />
<br />
* '''Core Mainland Area (down to the Named Sandboxes)'''<br />
** Ahern<br />
** Bonifacio &beta;<br />
** Dore<br />
** Morris &beta;<br />
** Balance &beta;<br />
** Bethel &beta;<br />
** Brilliant<br />
** Fame<br />
** Fortuna<br />
** Kapor &beta;<br />
** Lusk &beta;<br />
** Oak Grove &beta;<br />
<br />
* '''Mainland Adjacent Regions'''<br />
** Blue<br />
** Mauve<br />
** Lime &beta;<br />
** Mocha &beta;<br />
<br />
* '''Help Regions'''<br />
** Help Island &beta;<br />
<br />
* '''TSL Core'''<br />
** TSL Volunteer Island<br />
** Card &beta;<br />
** Pullman<br />
<br />
* '''Combat Regions'''<br />
** Combat (sandbox) - Red Team's HQ &beta;<br />
** Combat (sandbox) Rausch &beta;<br />
** Combat (sandbox) - Blue Team's HQ<br />
** Sandbox - Weapons testing (no damag &beta;<br />
** TSL Weapons Testing Sandbox &beta;<br />
<br />
* '''Vehicle Regions'''<br />
** Periwinkle<br />
** Purple &beta;<br />
<br />
* '''General Sandbox Regions'''<br />
** Sandbox Island<br />
** Sandbox Island Extension &beta;<br />
** Sandbox Island (TG) &beta;<br />
** Sandbox Island 2 (TG)<br />
** Sandbox Island 3 (TG) &beta;<br />
** Sandbox Island 4 (TG)<br />
** Sandbox Newcomb &beta;<br />
** Sandbox Goguen &beta;<br />
** Sandbox Cordova &beta;<br />
** Sandbox Wanderton &beta;<br />
<br />
* '''Openspace Sims, mainland, contiguous'''<br />
** Adriatic &beta;<br />
** Aegean<br />
** Arafura<br />
** Azov<br />
** Baltic &beta;<br />
** Banda<br />
** Beibu &beta;<br />
** Bering &beta;<br />
** Bohai<br />
** Bohol &beta;<br />
** Bothnia &beta;<br />
** Carpentaria<br />
** Celebes &beta;<br />
** Cortez &beta;<br />
** Flores<br />
** Hudson<br />
** Ionian<br />
** Ligurian<br />
** Marmara<br />
** Mirtoon<br />
** Okhotsk &beta;<br />
** Sargasso &beta;<br />
** Seto &beta;<br />
** Sidra<br />
** Sulu &beta;<br />
** Tasman<br />
** Tyrrhenian &beta;<br />
** Baffin (not openspace, in the middle of the rest)<br />
<br />
= See Also =<br />
* [[Preview Grid Common Questions]]<br />
* [http://blog.secondlife.com/2008/10/23/help-us-beta-test-second-life-server-releases/ Blog Post about Beta Testing]<br />
* [[Beta Server Office Hours]] are held ''on the preview grid'' at Morris (192, 251, 35). These are to discuss beta testing of the next upcoming release of Second Life; when there is not a release pending, we will discuss general SVC issues listed in the JIRA.<br />
* The [https://blogs.secondlife.com/community/technology/release?view=all Release Team blog] has discussions about rolling restarts, server release beta testing in general, and specific versions of the server that are about to be released. Also see the archived [http://forums-archive.secondlife.com/348/1.html Server Deploy Forums] for updates before February 2010.<br />
<br />
[[Category:Bug Tracker]]<br />
[[Category:Quality Assurance]]<br />
[[Category:QA_Portal]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Autobuild&diff=1138945Autobuild2011-04-01T22:15:16Z<p>Jenn Linden: </p>
<hr />
<div>{{Autobuild Nav}}<br />
<br />
== Overview ==<br />
Autobuild is a framework for maintaining and building libraries. It acts as director providing a common interface to build and package libraries, but it is not a build system like make or cmake. You will still need platform-specific make, cmake, or project files to configure and build your library. Autobuild will, however, allow you invoke these commands and package the product with a common interface. <br />
<br />
{{KBcaution|Linden Lab Autobuild is not the same as or derived from [http://josefsson.org/autobuild/ GNU Autobuild], but they are similar enough to cause confusion.}}<br />
<br />
For Linden old hands: Autobuild is designed as a replacement for the old [https://svn.lindenlab.com/svn/lindenlib/trunk lindenlib] policies; doing the right thing so you don't have to.<br />
<br />
== Getting Autobuild ==<br />
<br />
Autobuild is available as a PyPI package:<br />
<br />
[http://pypi.python.org/pypi/setuptools easy_install] autobuild<br />
<br />
or<br />
<br />
[http://pypi.python.org/pypi/pip pip] install autobuild<br />
<br />
of if you don't have pip or easy_install<br />
<br />
hg clone http://hg.secondlife.com/autobuild<br />
cd autobuild<br />
python setup.py install<br />
<br />
You may need administrative privilege on your system to install into system command directories.<br />
<br />
{{KBnote|If you are using Cygwin on Windows, you must also add your Python scripts directory (for example <code>C:/Program Files/python26/Scripts</code>) to your PATH. If you have further problems, please see [[Autobuild/Cygwin]]}}<br />
<br />
{{KBtip|If you do not have administrative privilege on your system, or for any reason you wish to avoid adding autobuild into system-level Python or command directories, you can use [http://www.virtualenv.org/en/latest/index.html virtualenv], e.g.:<br />
<br />
mkdir ~/virtualenvs # or any directory for your Python-package environments<br />
VENV{{=}}~/virtualenvs/autobuild<br />
virtualenv "$VENV"<br />
. "$VENV/bin/activate"<br />
<br />
Then your <code>pip install autobuild</code> command will install autobuild under <code>$VENV</code> instead of into system directories. (Note that this <code>pip install</code> command will work either way. If you have an active virtualenv, it will install into the virtualenv; if not it will attempt to install into system directories.)<br />
}} <!-- end pip/virtualenv tip --><br />
<br />
== Running Autobuild == <br />
<br />
=== Building the Viewer ===<br />
<br />
See: [[Build_Viewer_With_Autobuild]]<br />
<br />
=== Changing or Adding Build Configuration Details ===<br />
Usage:<br />
{{Syntax|autobuild ''options'' ''sub-command''<br />
}}<br />
<br />
Supply zero or more options, and one sub-command.<br />
<br />
'''Options''':<br />
{|border="1" class="lltable"<br />
<br />
|--<br />
! Option<br />
! Description <br />
<br />
|--<br />
| --debug<br />
| Display debug information<br />
<br />
|--<br />
| --dry-run<br />
| Run tool in dry run mode if available<br />
<br />
|--<br />
| --help&nbsp;[''command'']<br />
| Find all valid Autobuild tools and show help<br />
<br />
|--<br />
| --quiet<br />
| Display minimal output<br />
<br />
|--<br />
| --verbose<br />
| Display verbose output<br />
<br />
|--<br />
| -V, --version<br />
| Show version information<br />
<br />
|}<br />
<br />
'''Sub-commands'''<br />
{| class=lltable border=1<br />
|--<br />
! Sub-command<br />
! Description<br />
|--<br />
| [[autobuild build|build]]<br />
| Build platform targets.<br />
|--<br />
| [[autobuild configure|configure]]<br />
| Configure platform targets.<br />
|--<br />
| [[autobuild edit|edit]]<br />
| Manage build and package configuration.<br />
|--<br />
| [[autobuild install|install]]<br />
| Fetch and install package archives.<br />
|--<br />
| [[autobuild installables|installables]]<br />
| Manipulate installable package entries in the autobuild configuration.<br />
|--<br />
| [[autobuild manifest|manifest]]<br />
| Manipulate manifest entries to the autobuild configuration.<br />
|--<br />
| [[autobuild package|package]]<br />
| Create an archive of build output.<br />
|--<br />
| [[autobuild print|print]]<br />
| Print configuration.<br />
|--<br />
| [[autobuild source_environment|source_environment]]<br />
| Print the shell environment Autobuild-based build scripts to use (by calling 'eval').<br />
|--<br />
| [[autobuild uninstall|uninstall]]<br />
| Uninstall package archives.<br />
|--<br />
| [[autobuild upload|upload]]<br />
| Upload tool for autobuild <br />
|}<br />
<br />
===Background and Tutorials===<br />
<br />
; [[Autobuild How To]]<br />
: A tutorial introduction to using autobuild<br />
; [[Autobuild Lexicon]]<br />
: A list of terms and how they are used in the context of autobuild<br />
; [[Autobuild Package Layout]]<br />
: Describes the standard directory tree for packages managed with autobuild<br />
; [[Autobuild Quick Start]]<br />
: A basic walkthrough of how to add autobuild management to an existing software project<br />
; [[Autobuild Class Model]]<br />
: Describes the fundamental objects in the autobuild design and the relationships between them.<br />
; [[Autobuild Package Examples|Autobuild Examples]]<br />
: Links to packages built with autobuild.<br />
; [[Build Script Anatomy]]<br />
: An annotated build script typical of those used to build third party libraries.<br />
; [[Autobuild Shell Functions]]<br />
: A description of all shell functions provided by Autobuild for use in build scripts.<br />
<br />
== Contributing to Autobuild ==<br />
<br />
Autobuild is open source. Improvements are most welcome. <br />
<br />
* Discussion of and help with Autobuild are available on the [https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev opensource-dev mailing list] and the [irc://irc.freenode.org/%23opensl #opensl channel on the freenode.org IRC network].<br />
* Bug reports and feature suggestions are tracked in the [https://jira.secondlife.com/browse/OPEN Open Development project on jira.secondlife.com].<br />
** Suggested patches for issues from the jira are reviewed on our [https://codereview.secondlife.com code review system] (see [[Code Review Tool|the documentation on how to use it]]).<br />
** Testing procedures for patch submissions are documented here: [[Autobuild/Integration]]<br />
<br />
[[Category:Autobuild]] [[Category:Open Source Portal]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Autobuild_Shell_Functions&diff=1136763Autobuild Shell Functions2011-03-05T01:15:01Z<p>Jenn Linden: </p>
<hr />
<div>Autobuild offers a set of shell functions for use in <tt>build-cmd.sh</tt> scripts which can be added to the environment by inserting the following line into any build script:<br />
<br />
eval "$("$AUTOBUILD" source_environment)"<br />
<br />
The exact shell code that is injected into your environment upon execution of this command [https://bitbucket.org/lindenlab/autobuild/src/tip/autobuild/autobuild_tool_source_environment.py is here].<br />
<br />
Shell functions provided by autobuild:<br />
:{|border="0" cellpadding="5" style="border-collapse: collapse; border-style: none;"<br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>pass</nowiki><br />
|<nowiki>Indicates build has succeeded</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>fail $comment</nowiki><br />
|<nowiki>Indicates build has failed, citing $comment in the output</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>fetch_archive $url $archive $md5</nowiki><br />
|<nowiki>Uses curl to download $archive from the $url and checks the downloaded file hash against the $md5 provided.</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>extract $file</nowiki><br />
| <nowiki>Extracts contents of an archive appropriate for the tar extension of $file.</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>calc_md5 $file</nowiki><br />
|<nowiki>Calculate the md5 of $file</nowiki><br />
<br />
|}<br />
<br />
<br />
Windows-only shell commands (Cygwin):<br />
:{|border="0" cellpadding="5" style="border-collapse: collapse; border-style: none;"<br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>build_vcproj $vcproj $config</nowiki><br />
|<nowiki>Launches a Visual Studio build of $vcproj, building configuration $config. If $USE_INCREDIBUILD is set, the same build is launched via BuildConsole, Incredibuild's command-line launcher.</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>build_sln $sln $config $project</nowiki><br />
|<nowiki>Launches a Visual Studio build using the solution file $sln, configuration $config, and specifying project $project.</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>load_vsvars</nowiki><br />
|<nowiki>Import Visual Studio paths, includes and libs into the shell environment</nowiki><br />
<br />
|}</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Autobuild_Shell_Functions&diff=1136762Autobuild Shell Functions2011-03-05T01:11:00Z<p>Jenn Linden: </p>
<hr />
<div>Autobuild offers a set of shell functions for use in <tt>build-cmd.sh</tt> scripts which can be added to the environment by inserting the following line into any build script:<br />
<br />
eval "$("$AUTOBUILD" source_environment)"<br />
<br />
The exact shell code that is injected into your environment upon execution of this command [https://bitbucket.org/lindenlab/autobuild/src/tip/autobuild/autobuild_tool_source_environment.py is here].<br />
<br />
Shell functions provided by autobuild:<br />
:{|border="0" cellpadding="5" style="border-collapse: collapse; border-style: none;"<br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>pass</nowiki><br />
|<nowiki>Indicates build has succeeded</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>fail $comment</nowiki><br />
|<nowiki>Indicates build has failed, citing $comment in the output</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>fetch_archive $url $archive $md5</nowiki><br />
|<nowiki>Uses curl to download $archive from the $url and checks the downloaded file hash against the $md5 provided.</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>extract $file</nowiki><br />
| <nowiki>Extracts contents of an archive appropriate for the tar extension of $file.</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>calc_md5 $file</nowiki><br />
|<nowiki>Calculate the md5 of $file</nowiki><br />
<br />
|}<br />
<br />
<br />
Windows-only shell commands (Cygwin):<br />
:{|border="0" cellpadding="5" style="border-collapse: collapse; border-style: none;"<br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>build_vcproj $vcproj $config</nowiki><br />
|<nowiki>Launches a Visual Studio build of $vcproj, building configuration $config. If $USE_INCREDIBUILD is set, the same build is launched via BuildConsole, Incredibuild's command-line launcher.</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>build_sln $solution $config $project</nowiki><br />
|<nowiki>Launches a Visual Studio build using the solution file $solution, configuration $config, and specifying project $project.</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>load_vsvars</nowiki><br />
|<nowiki>Import Visual Studio paths, includes and libs into the shell environment</nowiki><br />
<br />
|}</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Build_Script_Anatomy&diff=1136761Build Script Anatomy2011-03-05T01:09:28Z<p>Jenn Linden: </p>
<hr />
<div>Because autobuild tool itself does not provide direct mechanisms to configure and build applications and libraries (that's just too big a problem for one tool to solve), we need to provide wrappers that autobuild can use to preform these tasks for each platform. For Linden projects we have chosen to use shell for scripting builds as we can run these on both UNIX like platforms and Windows (using CYGWIN). On this page we show an annotated typical example of a build script that we use along with autobuild to build a package. While some details obviously will change from library to library, many of the elements seen here are common to the majority of third party packages we build. You may see the original source for this page at https://bitbucket.org/lindenlab/3p-zlib/src/826e9d636a6d/build-cmd.sh. Note that build scripts are conventionally named ''build-cmd.sh''. <br />
<br />
=== Example build-cmd.sh ===<br />
<br />
<pre><br />
#!/bin/bash<br />
</pre><br />
Build scripts by default are run from the build directory not the directory of this script or the directory of the ''autobuild.xml'' configuration file. This command will change directories to the location of the build script which is useful for this library.<br />
<pre><br />
cd "$(dirname "$0")"<br />
</pre><br />
<pre><br />
# turn on verbose debugging output for parabuild logs.<br />
set -x<br />
# make errors fatal<br />
set -e<br />
<br />
ZLIB_VERSION="1.2.5"<br />
ZLIB_SOURCE_DIR="zlib-$ZLIB_VERSION"<br />
</pre><br />
The autobuild command should be passed as an environment variable, but we sanity check that.<br />
<pre><br />
if [ -z "$AUTOBUILD" ] ; then <br />
fail<br />
fi<br />
</pre><br />
On windows systems, the path contained in the '''AUTOBUILD''' environment variable is stored in DOS format. CYGWIN isn't smart enough to understand DOS paths so we need to convert the path to a UNIX format with the ''cygpath'' command.<br />
<pre><br />
if [ "$OSTYPE" = "cygwin" ] ; then<br />
export AUTOBUILD="$(cygpath -u $AUTOBUILD)"<br />
fi<br />
</pre><br />
The ''autobuild source_environment'' command returns a string with shell code. This code contains some useful functions that we will use later in the build process. <br />
<pre><br />
# load autbuild provided shell functions and variables<br />
set +x<br />
eval "$("$AUTOBUILD" source_environment)"<br />
set -x<br />
</pre><br />
Refer to [[Autobuild Shell Functions]] for more details.<br />
<pre><br />
stage="$(pwd)/stage"<br />
pushd "$ZLIB_SOURCE_DIR"<br />
</pre><br />
Now we get to the platform specific build commands.<br />
<pre><br />
case "$AUTOBUILD_PLATFORM" in<br />
</pre><br />
<pre><br />
"windows")<br />
load_vsvars<br />
</pre><br />
The packagers of '''zlib''' included this batch file to build some assembly code.<br />
<pre> <br />
pushd contrib/masmx86<br />
./bld_ml32.bat<br />
popd<br />
</pre><br />
The packagers of '''zlib''' added a VisualStudio project to build this package on windows. We take advantage of this by using the ''biulld_sln'' function defined in the source environment to build the desired projects from the command line.<br />
<pre> <br />
build_sln "contrib/vstudio/vc10/zlibvc.sln" "Debug|Win32" "zlibstat"<br />
build_sln "contrib/vstudio/vc10/zlibvc.sln" "Release|Win32" "zlibstat"<br />
</pre><br />
The build product is output into the source directory, so we need to manually copy the libraries and headers into the autobuild build directory. Note how the debug and release versions of the library are copied into their respective ''lib/debug'' and ''lib/release'' directories. The headers are copied into ''include/zlib''<br />
<pre><br />
mkdir -p "$stage/lib/debug"<br />
mkdir -p "$stage/lib/release"<br />
cp "contrib/vstudio/vc10/x86/ZlibStatDebug/zlibstat.lib" \<br />
"$stage/lib/debug/zlibd.lib"<br />
cp "contrib/vstudio/vc10/x86/ZlibStatRelease/zlibstat.lib" \<br />
"$stage/lib/release/zlib.lib"<br />
mkdir -p "$stage/include/zlib"<br />
cp {zlib.h,zconf.h} "$stage/include/zlib"<br />
</pre><br />
<pre><br />
;;<br />
"darwin")<br />
</pre><br />
Since Darwin is a UNIX variant, we can use the common configure and make commands. Note how the ''--prefix'' option is set to the build directory so the files get installed mostly where we want. <br />
<pre><br />
./configure --prefix="$stage"<br />
make<br />
make install<br />
</pre><br />
We still need to move the header files into ''include/zlib''.<br />
<pre><br />
mkdir -p "$stage/include/zlib"<br />
mv "$stage/include/"*.h "$stage/include/zlib/"<br />
</pre><br />
<pre><br />
;;<br />
"linux")<br />
</pre><br />
Linux looks pretty much like Darwin.<br />
<pre><br />
CFLAGS="-m32" CXXFLAGS="-m32" ./configure --prefix="$stage"<br />
make<br />
make install<br />
mkdir -p "$stage/include/zlib"<br />
mv "$stage/include/"*.h "$stage/include/zlib/"<br />
</pre><br />
<pre><br />
;;<br />
esac<br />
</pre><br />
Finally we copy the license file into the '''LICENSES''' directory regardless of platform.<br />
<pre><br />
mkdir -p "$stage/LICENSES"<br />
tail -n 31 README > "$stage/LICENSES/zlib.txt"<br />
</pre><br />
<pre><br />
popd<br />
<br />
pass<br />
</pre></div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Build_Script_Anatomy&diff=1136760Build Script Anatomy2011-03-05T01:09:07Z<p>Jenn Linden: </p>
<hr />
<div>Because autobuild tool itself does not provide direct mechanisms to configure and build applications and libraries (that's just too big a problem for one tool to solve), we need to provide wrappers that autobuild can use to preform these tasks for each platform. For Linden projects we have chosen to use shell for scripting builds as we can run these on both UNIX like platforms and Windows (using CYGWIN). On this page we show an annotated typical example of a build script that we use along with autobuild to build a package. While some details obviously will change from library to library, many of the elements seen here are common to the majority of third party packages we build. You may see the original source for this page at https://bitbucket.org/lindenlab/3p-zlib/src/826e9d636a6d/build-cmd.sh. Note that build scripts are conventionally named ''build-cmd.sh''. <br />
<br />
=== Example build-cmd.sh ===<br />
<br />
<pre><br />
#!/bin/bash<br />
</pre><br />
Build scripts by default are run from the build directory not the directory of this script or the directory of the ''autobuild.xml'' configuration file. This command will change directories to the location of the build script which is useful for this library.<br />
<pre><br />
cd "$(dirname "$0")"<br />
</pre><br />
<pre><br />
# turn on verbose debugging output for parabuild logs.<br />
set -x<br />
# make errors fatal<br />
set -e<br />
<br />
ZLIB_VERSION="1.2.5"<br />
ZLIB_SOURCE_DIR="zlib-$ZLIB_VERSION"<br />
</pre><br />
The autobuild command should be passed as an environment variable, but we sanity check that.<br />
<pre><br />
if [ -z "$AUTOBUILD" ] ; then <br />
fail<br />
fi<br />
</pre><br />
On windows systems, the path contained in the '''AUTOBUILD''' environment variable is stored in DOS format. CYGWIN isn't smart enough to understand DOS paths so we need to convert the path to a UNIX format with the ''cygpath'' command.<br />
<pre><br />
if [ "$OSTYPE" = "cygwin" ] ; then<br />
export AUTOBUILD="$(cygpath -u $AUTOBUILD)"<br />
fi<br />
</pre><br />
The ''autobuild source_environment'' command returns a string with shell code. This code contains some useful functions that we will use later in the build process. Refer to [[Autobuild Shell Functions]] for more details.<br />
<pre><br />
# load autbuild provided shell functions and variables<br />
set +x<br />
eval "$("$AUTOBUILD" source_environment)"<br />
set -x<br />
</pre><br />
<pre><br />
stage="$(pwd)/stage"<br />
pushd "$ZLIB_SOURCE_DIR"<br />
</pre><br />
Now we get to the platform specific build commands.<br />
<pre><br />
case "$AUTOBUILD_PLATFORM" in<br />
</pre><br />
<pre><br />
"windows")<br />
load_vsvars<br />
</pre><br />
The packagers of '''zlib''' included this batch file to build some assembly code.<br />
<pre> <br />
pushd contrib/masmx86<br />
./bld_ml32.bat<br />
popd<br />
</pre><br />
The packagers of '''zlib''' added a VisualStudio project to build this package on windows. We take advantage of this by using the ''biulld_sln'' function defined in the source environment to build the desired projects from the command line.<br />
<pre> <br />
build_sln "contrib/vstudio/vc10/zlibvc.sln" "Debug|Win32" "zlibstat"<br />
build_sln "contrib/vstudio/vc10/zlibvc.sln" "Release|Win32" "zlibstat"<br />
</pre><br />
The build product is output into the source directory, so we need to manually copy the libraries and headers into the autobuild build directory. Note how the debug and release versions of the library are copied into their respective ''lib/debug'' and ''lib/release'' directories. The headers are copied into ''include/zlib''<br />
<pre><br />
mkdir -p "$stage/lib/debug"<br />
mkdir -p "$stage/lib/release"<br />
cp "contrib/vstudio/vc10/x86/ZlibStatDebug/zlibstat.lib" \<br />
"$stage/lib/debug/zlibd.lib"<br />
cp "contrib/vstudio/vc10/x86/ZlibStatRelease/zlibstat.lib" \<br />
"$stage/lib/release/zlib.lib"<br />
mkdir -p "$stage/include/zlib"<br />
cp {zlib.h,zconf.h} "$stage/include/zlib"<br />
</pre><br />
<pre><br />
;;<br />
"darwin")<br />
</pre><br />
Since Darwin is a UNIX variant, we can use the common configure and make commands. Note how the ''--prefix'' option is set to the build directory so the files get installed mostly where we want. <br />
<pre><br />
./configure --prefix="$stage"<br />
make<br />
make install<br />
</pre><br />
We still need to move the header files into ''include/zlib''.<br />
<pre><br />
mkdir -p "$stage/include/zlib"<br />
mv "$stage/include/"*.h "$stage/include/zlib/"<br />
</pre><br />
<pre><br />
;;<br />
"linux")<br />
</pre><br />
Linux looks pretty much like Darwin.<br />
<pre><br />
CFLAGS="-m32" CXXFLAGS="-m32" ./configure --prefix="$stage"<br />
make<br />
make install<br />
mkdir -p "$stage/include/zlib"<br />
mv "$stage/include/"*.h "$stage/include/zlib/"<br />
</pre><br />
<pre><br />
;;<br />
esac<br />
</pre><br />
Finally we copy the license file into the '''LICENSES''' directory regardless of platform.<br />
<pre><br />
mkdir -p "$stage/LICENSES"<br />
tail -n 31 README > "$stage/LICENSES/zlib.txt"<br />
</pre><br />
<pre><br />
popd<br />
<br />
pass<br />
</pre></div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Autobuild&diff=1136759Autobuild2011-03-05T01:08:36Z<p>Jenn Linden: /* Background and Tutorials */</p>
<hr />
<div>{{RightToc}}<br />
Autobuild is an in-house framework for maintaining and building libraries. It acts as director providing a common interface to build and package libraries, but it is not a build system like make or cmake. You will still need platform specific make, cmake, or project files to actually configure and build your library. Autobuild will, however, allow you invoke these commands and package the product with a common interface. (''for Linden old hands: Autobuild is designed as a replacement for the old [https://svn.lindenlab.com/svn/lindenlib/trunk lindenlib] policies, doing the right thing so you don't have to.'')<br />
<br />
{{KBcaution|Linden Lab Autobuild is not the same as or derived from [http://josefsson.org/autobuild/ GNU Autobuild], but they are similar enough to cause confusion.}}<br />
<br />
== Getting Autobuild ==<br />
<br />
Autobuild is available as a Mercurial repository:<br />
https://bitbucket.org/lindenlab/autobuild <br />
<br />
=== Installing Autobuild ===<br />
<br />
You can either run the autobuild command directly from the "bin" directory in a working copy of that repository, or install it as a normal python package by running <br />
python setup.py install<br />
from the top level directory of the working copy. You may need administrative privilege on your system to install into system command directories.<br />
{{KBnote|if you intend to run autobuild from a cygwin shell on windows, it is strongly recommended that you run <tt>python setup.py install</tt> rather than run it directly from the checkout. This is the most reliable way to ensure that cygwin paths get correctly translated to native windows paths for python. Then ensure that your python scripts directory (for example <tt>C:/Program Files/python26/Scripts</tt>) is in your PATH.}}<br />
<br />
== Running Autobuild == <br />
Usage:<br />
<nowiki>autobuild [-v] [--help [HELP]] [--dry-run] [--quiet] [--verbose]</nowiki><br />
<nowiki>[--debug]</nowiki><br />
<br />
<nowiki>{installables,configure,package,edit,upload,manifest,build,install,print,source_environment,uninstall}</nowiki><br />
<nowiki>...</nowiki><br />
<br />
Sub Commands:<br />
<br />
:;[[autobuild build]]<br />
::<nowiki>Builds platform targets.</nowiki><br />
:;[[autobuild configure]]<br />
::<nowiki>Configures platform targets.</nowiki><br />
:;[[autobuild edit]]<br />
::<nowiki>Manage build and package configuration.</nowiki><br />
:;[[autobuild install]]<br />
::<nowiki>Fetch and install package archives.</nowiki><br />
:;[[autobuild installables]]<br />
::<nowiki>Manipulate installable package entries in the autobuild configuration.</nowiki><br />
:;[[autobuild manifest]]<br />
::<nowiki>Manipulate manifest entries to the autobuild configuration.</nowiki><br />
:;[[autobuild package]]<br />
::<nowiki>Creates an archive of build output.</nowiki><br />
:;[[autobuild print]]<br />
::<nowiki>Print configuration.</nowiki><br />
:;[[autobuild source_environment]]<br />
::<nowiki>Prints out the shell environment Autobuild-based buildscripts to use (by calling 'eval').</nowiki><br />
:;[[autobuild uninstall]]<br />
::<nowiki>Uninstall package archives.</nowiki><br />
:;[[autobuild upload]]<br />
::<nowiki>upload tool for autobuild </nowiki><br />
<br />
Options:<br />
:{|border="0" cellpadding="5" style="border-collapse: collapse; border-style: none;"<br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>-v, --version</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--help&nbsp;[HELP]</nowiki><br />
|<nowiki>find all valid Autobuild Tools and show help</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--dry-run</nowiki><br />
|<nowiki>run tool in dry run mode if available</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--quiet</nowiki><br />
|<nowiki>minimal output</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--verbose</nowiki><br />
|<nowiki>verbose output</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--debug</nowiki><br />
<br />
|}<br />
<br />
===Background and Tutorials===<br />
<br />
; [[Autobuild How To]]<br />
: A tutorial introduction to using autobuild<br />
; [[Autobuild Lexicon]]<br />
: A list of terms and how they are used in the context of autobuild<br />
; [[Autobuild Package Layout]]<br />
: Describes the standard directory tree for packages managed with autobuild<br />
; [[Autobuild Quick Start]]<br />
: A basic walkthrough of how to add autobuild management to an existing software project<br />
; [[Autobuild Class Model]]<br />
: Describes the fundamental objects in the autobuild design and the relationships between them.<br />
; [[Autobuild Package Examples|Autobuild Examples]]<br />
: Links to packages built with autobuild.<br />
; [[Build Script Anatomy]]<br />
: An annotated build script typical of those used to build third party libraries.<br />
; [[Autobuild Shell Functions]]<br />
: A description of all shell functions provided by Autobuild for use in build scripts.<br />
<br />
== Contributing to Autobuild ==<br />
<br />
Autobuild is open source. Improvements are most welcome. <br />
<br />
* Discussion of and help with Autobuild are available on the [https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev opensource-dev mailing list] and the [irc://irc.freenode.org/%23opensl #opensl channel on the freenode.org IRC network].<br />
* Bug reports and feature suggestions are tracked in the [https://jira.secondlife.com/browse/OPEN Open Development project on jira.secondlife.com].<br />
** Suggested patches for issues from the jira are reviewed on our [https://codereview.secondlife.com code review system] (see [[Code Review Tool|the documentation on how to use it]]).<br />
<br />
[[Category:Autobuild]] [[Category:Open Source Portal]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Autobuild_Shell_Functions&diff=1136758Autobuild Shell Functions2011-03-05T01:07:13Z<p>Jenn Linden: Created page with "Autobuild offers a set of shell functions for use in <tt>build-cmd.sh</tt> scripts which can be added to the environment by inserting the following line into any build script: …"</p>
<hr />
<div>Autobuild offers a set of shell functions for use in <tt>build-cmd.sh</tt> scripts which can be added to the environment by inserting the following line into any build script:<br />
<br />
eval "$("$AUTOBUILD" source_environment)"<br />
<br />
The exact shell code that is injected into your environment upon execution of this command [http://bitbucket.org/lindenlab/autobuild/autobuild/autobuild_tool_source_environment.py is here].<br />
<br />
Shell functions provided by autobuild:<br />
:{|border="0" cellpadding="5" style="border-collapse: collapse; border-style: none;"<br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>pass</nowiki><br />
|<nowiki>Indicates build has succeeded</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>fail $comment</nowiki><br />
|<nowiki>Indicates build has failed, citing $comment in the output</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>fetch_archive $url $archive $md5</nowiki><br />
|<nowiki>Uses curl to download $archive from the $url and checks the downloaded file hash against the $md5 provided.</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>extract $file</nowiki><br />
| <nowiki>Extracts contents of an archive appropriate for the tar extension of $file.</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>calc_md5 $file</nowiki><br />
|<nowiki>Calculate the md5 of $file</nowiki><br />
<br />
|}<br />
<br />
<br />
Windows-only shell commands (Cygwin):<br />
:{|border="0" cellpadding="5" style="border-collapse: collapse; border-style: none;"<br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>build_vcproj $vcproj $config</nowiki><br />
|<nowiki>Launches a Visual Studio build of $vcproj, building configuration $config. If $USE_INCREDIBUILD is set, the same build is launched via BuildConsole, Incredibuild's command-line launcher.</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>build_sln $solution $config $project</nowiki><br />
|<nowiki>Launches a Visual Studio build using the solution file $solution, configuration $config, and specifying project $project.</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>load_vsvars</nowiki><br />
|<nowiki>Import Visual Studio paths, includes and libs into the shell environment</nowiki><br />
<br />
|}</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Autobuild/Quick_Start&diff=1136746Autobuild/Quick Start2011-03-04T22:03:40Z<p>Jenn Linden: </p>
<hr />
<div>{{RightToc}}<br />
<br />
When creating a new autobuild package of a library, it can be unclear where to start. [[Autobuild How To]] can be a little intimidating. We're packaging a simple third party library just like all the rest of ours, so we don't need to use autobuild in it's full generality. We can skip some steps and share script fragments with other library packages.<br />
<br />
Autobuild is largely self documenting. You can access help via the commands <tt>autobuild --help</tt> or <tt>autobuild &lt;subcommand&gt; --help</tt>, for example <tt>autobuild edit --help</tt>. If the help text is unclear, please file a bug.<br />
<br />
Here's a crash course:<br />
<br />
==What will we be doing==<br />
<br />
Your packaging efforts will mostly consist of creating or modifying 2 files: autobuild.xml, and build-cmd.sh<br />
<br />
;autobuild.xml : Autobuild package definition metadata. For now, what you should focus on "This specifies the actual shell commands that autobuild should execute for each step." You should modify this file using the '<tt>autobuild edit</tt>' command. Editing it by hand will lead to problems.<br />
;build-cmd.sh : the shell script that we are going to specify as the build command in autobuild.xml we've encapsulated a lot of the complexity within this script for our third party libraries, so we can just clone it from an existing library and customize it for our package.<br />
<br />
==What do we do==<br />
Get autobuild:<br />
hg clone http://hg.secondlife.com/autobuild<br />
cd autobuild/bin<br />
export PATH="$PATH:$(pwd)"<br />
cd ../..<br />
<br />
Copy the skeleton from an existing package.<br />
hg init hello<br />
cd hello<br />
curl -OL http://hg.secondlife.com/3p-zlib/raw/tip/BuildParams<br />
curl -OL http://hg.secondlife.com/3p-zlib/raw/tip/build-cmd.sh<br />
chmod +x build-cmd.sh<br />
curl -OL http://hg.secondlife.com/3p-zlib/raw/tip/.hgignore<br />
hg add BuildParams build-cmd.sh .hgignore<br />
<br />
Now you'll need to edit build-cmd.sh and customize it for your package in our case, [http://www.gnu.org/software/hello/ GNU Hello]. Mostly this is just a search and replace (replace occurrences of curl and CURL with the name or your package). For example, the sed search & replace commands would be <tt>s/curl/hello/g</tt> and <tt>s/CURL/HELLO/g</tt> in this case. You'll likely also need to update the version number variables to match your package's version.<br />
<br />
Additionally you'll need to update the 3 sections under the case statement with any platform specific quirks for how to build your package natively. Darwin and Linux can be pretty standardized, but under windows there are a lot of different ways to build your package. Most of these have been worked through already for one package or another. You can use these [[Autobuild Package Examples|Autobuild Examples]] as a starting point.<br />
<br />
<br />
In the end, you should come up with something like this [[Autobuild/Quick_Start/build-cmd.sh|example build-cmd.sh]]. See [[Build Script Anatomy]].<br />
<br />
You'll need some information about your package from the upstream package distributor for filling in some of the prompts. For example you should copy the copyright string and license info verbatim from the upstream distributor. Additionally we should always write our build script to copy the text of the license into <tt>LICENSES/&lt;package name&gt;.txt</tt> and specify that location as the "Path to license file"<br />
<br />
Next you'll want to configure autobuild to use your build-cmd.sh.<br />
autobuild edit package<br />
# Name of package> hello<br />
# Package description> The GNU Hello program produces a familiar, friendly greeting. Yes, this is another implementation of the classic program that prints “Hello, world!” when you run it.<br />
# Copyright string (as appropriate for your package)> Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/><br />
# Type of license (as appropriate for your package)> gpl3<br />
# Path to license file relative to package root, if known> LICENSES/hello.txt<br />
# Version> 2.6<br />
hg add autobuild.xml<br />
autobuild edit build<br />
# Name of config> default<br />
# Platform of config> common<br />
# Command to execute> bash<br />
# Options for command> -c,../build-cmd.sh<br />
# Arguments for command><br />
autobuild edit platform name=linux build_directory=stage<br />
autobuild edit platform name=darwin build_directory=stage<br />
autobuild edit platform name=windows build_directory=stage<br />
autobuild edit build name=default platform=linux default=true<br />
autobuild edit build name=default platform=darwin default=true<br />
autobuild edit build name=default platform=windows default=true<br />
<br />
Now if you run <tt>autobuild print</tt> its output should look like this [[Autobuild/Quick_Start/Build Configured|autobuild print example]]<br />
<br />
Next you'll want to configure the manifest for packaging.<br />
<br />
autobuild manifest --platform common add "include/hello/*.h"<br />
autobuild manifest --platform common add "LICENSES/hello.txt"<br />
autobuild manifest --platform linux add "lib/*.a"<br />
autobuild manifest --platform darwin add "lib/*.a"<br />
autobuild manifest --platform windows add "lib/debug/*.pdb"<br />
autobuild manifest --platform windows add "lib/debug/*.lib"<br />
autobuild manifest --platform windows add "lib/release/*.pdb"<br />
autobuild manifest --platform windows add "lib/release/*.lib"<br />
autobuild manifest --platform linux add "bin/*"<br />
autobuild manifest --platform darwin add "bin/*"<br />
autobuild manifest --platform windows add "bin/*.exe"<br />
<br />
Now if you run <tt>autobuild print</tt> its output should look like this [[Autobuild/Quick_Start/Manifest Configured|autobuild manifest example]]<br />
<br />
Now things should be complete (for this simplified example), and you should be able to run <tt>autobuild build && autobuild package</tt> to get a package generated. Hooray!<br />
<br />
hg commit<br />
<br />
==What did we do==<br />
#We defined a build script that drives the native build of the package in a way that is compatible with our viewer builds and sandboxed from the rest of the system.<br />
# We configured autobuild to use that build script on all 3 platforms.<br />
#We packaged the result in a tarball consistent with [[Autobuild/Package_Layout]]<br />
<br />
==What haven't we done==<br />
<br />
# We haven't addressed how to handle dependencies. For example libcurl depends upon zlib and openssl already having their autobuild packages availible for use. If you're packaging a new library that has dependencies you should begin at the leaves of the dependency tree.<br />
#:[[Autobuild_How_To#Adding_dependencies]] covers this excellently.<br />
# We skipped features of autobuild that aren't useful for the way we're currently packaging third party library packages.<br />
## like multiple configurations (Debug/RelWithDebInfo/Release)<br />
## like options and arguments to the build command.<br />
## like distinct configure and build stages.<br />
# We haven't covered the specifics of how autobuild integrates with the windows Visual Studio build system.<br />
# We haven't covered specifically what the ABI requirements are for packages intended to be linked into the viewer.<br />
<br />
[[Category:Autobuild]] [[Category:Open Source Portal]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Autobuild&diff=1136745Autobuild2011-03-04T22:00:09Z<p>Jenn Linden: /* Background and Tutorials */</p>
<hr />
<div>{{RightToc}}<br />
Autobuild is an in-house framework for maintaining and building libraries. It acts as director providing a common interface to build and package libraries, but it is not a build system like make or cmake. You will still need platform specific make, cmake, or project files to actually configure and build your library. Autobuild will, however, allow you invoke these commands and package the product with a common interface. (''for Linden old hands: Autobuild is designed as a replacement for the old [https://svn.lindenlab.com/svn/lindenlib/trunk lindenlib] policies, doing the right thing so you don't have to.'')<br />
<br />
{{KBcaution|Linden Lab Autobuild is not the same as or derived from [http://josefsson.org/autobuild/ GNU Autobuild], but they are similar enough to cause confusion.}}<br />
<br />
== Getting Autobuild ==<br />
<br />
Autobuild is available as a Mercurial repository:<br />
https://bitbucket.org/lindenlab/autobuild <br />
<br />
=== Installing Autobuild ===<br />
<br />
You can either run the autobuild command directly from the "bin" directory in a working copy of that repository, or install it as a normal python package by running <br />
python setup.py install<br />
from the top level directory of the working copy. You may need administrative privilege on your system to install into system command directories.<br />
<br />
== Running Autobuild == <br />
Usage:<br />
<nowiki>autobuild [-v] [--help [HELP]] [--dry-run] [--quiet] [--verbose]</nowiki><br />
<nowiki>[--debug]</nowiki><br />
<br />
<nowiki>{installables,configure,package,edit,upload,manifest,build,install,print,source_environment,uninstall}</nowiki><br />
<nowiki>...</nowiki><br />
<br />
Sub Commands:<br />
<br />
:;[[autobuild build]]<br />
::<nowiki>Builds platform targets.</nowiki><br />
:;[[autobuild configure]]<br />
::<nowiki>Configures platform targets.</nowiki><br />
:;[[autobuild edit]]<br />
::<nowiki>Manage build and package configuration.</nowiki><br />
:;[[autobuild install]]<br />
::<nowiki>Fetch and install package archives.</nowiki><br />
:;[[autobuild installables]]<br />
::<nowiki>Manipulate installable package entries in the autobuild configuration.</nowiki><br />
:;[[autobuild manifest]]<br />
::<nowiki>Manipulate manifest entries to the autobuild configuration.</nowiki><br />
:;[[autobuild package]]<br />
::<nowiki>Creates an archive of build output.</nowiki><br />
:;[[autobuild print]]<br />
::<nowiki>Print configuration.</nowiki><br />
:;[[autobuild source_environment]]<br />
::<nowiki>Prints out the shell environment Autobuild-based buildscripts to use (by calling 'eval').</nowiki><br />
:;[[autobuild uninstall]]<br />
::<nowiki>Uninstall package archives.</nowiki><br />
:;[[autobuild upload]]<br />
::<nowiki>upload tool for autobuild </nowiki><br />
<br />
Options:<br />
:{|border="0" cellpadding="5" style="border-collapse: collapse; border-style: none;"<br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>-v, --version</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--help&nbsp;[HELP]</nowiki><br />
|<nowiki>find all valid Autobuild Tools and show help</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--dry-run</nowiki><br />
|<nowiki>run tool in dry run mode if available</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--quiet</nowiki><br />
|<nowiki>minimal output</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--verbose</nowiki><br />
|<nowiki>verbose output</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--debug</nowiki><br />
<br />
|}<br />
<br />
===Background and Tutorials===<br />
<br />
; [[Autobuild How To]]<br />
: A tutorial introduction to using autobuild<br />
; [[Autobuild Lexicon]]<br />
: A list of terms and how they are used in the context of autobuild<br />
; [[Autobuild Package Layout]]<br />
: Describes the standard directory tree for packages managed with autobuild<br />
; [[Autobuild Quick Start]]<br />
: A basic walkthrough of how to add autobuild management to an existing software project<br />
; [[Autobuild Class Model]]<br />
: Describes the fundamental objects in the autobuild design and the relationships between them.<br />
; [[Autobuild Package Examples|Autobuild Examples]]<br />
: Links to packages built with autobuild.<br />
; [[Build Script Anatomy]]<br />
: An annotated build script typical of those used to build third party libraries.<br />
<br />
== Contributing to Autobuild ==<br />
<br />
Autobuild is open source. Improvements are most welcome. <br />
<br />
* Discussion of and help with Autobuild are available on the [https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev opensource-dev mailing list] and the [irc://irc.freenode.org/%23opensl #opensl channel on the freenode.org IRC network].<br />
* Bug reports and feature suggestions are tracked in the [https://jira.secondlife.com/browse/OPEN Open Development project on jira.secondlife.com].<br />
** Suggested patches for issues from the jira are reviewed on our [https://codereview.secondlife.com code review system] (see [[Code Review Tool|the documentation on how to use it]]).<br />
<br />
[[Category:Autobuild]] [[Category:Open Source Portal]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Autobuild&diff=1136744Autobuild2011-03-04T21:59:33Z<p>Jenn Linden: /* Background and Tutorials */</p>
<hr />
<div>{{RightToc}}<br />
Autobuild is an in-house framework for maintaining and building libraries. It acts as director providing a common interface to build and package libraries, but it is not a build system like make or cmake. You will still need platform specific make, cmake, or project files to actually configure and build your library. Autobuild will, however, allow you invoke these commands and package the product with a common interface. (''for Linden old hands: Autobuild is designed as a replacement for the old [https://svn.lindenlab.com/svn/lindenlib/trunk lindenlib] policies, doing the right thing so you don't have to.'')<br />
<br />
{{KBcaution|Linden Lab Autobuild is not the same as or derived from [http://josefsson.org/autobuild/ GNU Autobuild], but they are similar enough to cause confusion.}}<br />
<br />
== Getting Autobuild ==<br />
<br />
Autobuild is available as a Mercurial repository:<br />
https://bitbucket.org/lindenlab/autobuild <br />
<br />
=== Installing Autobuild ===<br />
<br />
You can either run the autobuild command directly from the "bin" directory in a working copy of that repository, or install it as a normal python package by running <br />
python setup.py install<br />
from the top level directory of the working copy. You may need administrative privilege on your system to install into system command directories.<br />
<br />
== Running Autobuild == <br />
Usage:<br />
<nowiki>autobuild [-v] [--help [HELP]] [--dry-run] [--quiet] [--verbose]</nowiki><br />
<nowiki>[--debug]</nowiki><br />
<br />
<nowiki>{installables,configure,package,edit,upload,manifest,build,install,print,source_environment,uninstall}</nowiki><br />
<nowiki>...</nowiki><br />
<br />
Sub Commands:<br />
<br />
:;[[autobuild build]]<br />
::<nowiki>Builds platform targets.</nowiki><br />
:;[[autobuild configure]]<br />
::<nowiki>Configures platform targets.</nowiki><br />
:;[[autobuild edit]]<br />
::<nowiki>Manage build and package configuration.</nowiki><br />
:;[[autobuild install]]<br />
::<nowiki>Fetch and install package archives.</nowiki><br />
:;[[autobuild installables]]<br />
::<nowiki>Manipulate installable package entries in the autobuild configuration.</nowiki><br />
:;[[autobuild manifest]]<br />
::<nowiki>Manipulate manifest entries to the autobuild configuration.</nowiki><br />
:;[[autobuild package]]<br />
::<nowiki>Creates an archive of build output.</nowiki><br />
:;[[autobuild print]]<br />
::<nowiki>Print configuration.</nowiki><br />
:;[[autobuild source_environment]]<br />
::<nowiki>Prints out the shell environment Autobuild-based buildscripts to use (by calling 'eval').</nowiki><br />
:;[[autobuild uninstall]]<br />
::<nowiki>Uninstall package archives.</nowiki><br />
:;[[autobuild upload]]<br />
::<nowiki>upload tool for autobuild </nowiki><br />
<br />
Options:<br />
:{|border="0" cellpadding="5" style="border-collapse: collapse; border-style: none;"<br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>-v, --version</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--help&nbsp;[HELP]</nowiki><br />
|<nowiki>find all valid Autobuild Tools and show help</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--dry-run</nowiki><br />
|<nowiki>run tool in dry run mode if available</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--quiet</nowiki><br />
|<nowiki>minimal output</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--verbose</nowiki><br />
|<nowiki>verbose output</nowiki><br />
<br />
|- style="vertical-align: top;"<br />
|<nowiki>--debug</nowiki><br />
<br />
|}<br />
<br />
===Background and Tutorials===<br />
<br />
; [[Autobuild How To]]<br />
: A tutorial introduction to using autobuild<br />
; [[Autobuild Lexicon]]<br />
: A list of terms and how they are used in the context of autobuild<br />
; [[Autobuild Package Layout]]<br />
: Describes the standard directory tree for packages managed with autobuild<br />
; [[Autobuild Quick Start]]<br />
: A basic walkthrough of how to add autobuild management to an existing software project<br />
; [[Autobuild Class Model]]<br />
: Describes the fundamental objects in the autobuild design and the relationships between them.<br />
; [[Autobuild Examples]]<br />
: Links to packages built with autobuild.<br />
; [[Build Script Anatomy]]<br />
: An annotated build script typical of those used to build third party libraries.<br />
<br />
== Contributing to Autobuild ==<br />
<br />
Autobuild is open source. Improvements are most welcome. <br />
<br />
* Discussion of and help with Autobuild are available on the [https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev opensource-dev mailing list] and the [irc://irc.freenode.org/%23opensl #opensl channel on the freenode.org IRC network].<br />
* Bug reports and feature suggestions are tracked in the [https://jira.secondlife.com/browse/OPEN Open Development project on jira.secondlife.com].<br />
** Suggested patches for issues from the jira are reviewed on our [https://codereview.secondlife.com code review system] (see [[Code Review Tool|the documentation on how to use it]]).<br />
<br />
[[Category:Autobuild]] [[Category:Open Source Portal]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Autobuild/Quick_Start&diff=1134927Autobuild/Quick Start2011-02-23T19:46:34Z<p>Jenn Linden: /* What do we do */</p>
<hr />
<div>{{RightToc}}<br />
<br />
When creating a new autobuild package of a library, it can be unclear where to start. [[Autobuild How To]] can be a little intimidating. We're packaging a simple third party library just like all the rest of ours, so we don't need to use autobuild in it's full generality. We can skip some steps and share script fragments with other library packages.<br />
<br />
Autobuild is largely self documenting. You can access help via the commands <tt>autobuild --help</tt> or <tt>autobuild &lt;subcommand&gt; --help</tt>, for example <tt>autobuild edit --help</tt>. If the help text is unclear, please file a bug.<br />
<br />
Here's a crash course:<br />
<br />
==What will we be doing==<br />
<br />
Your packaging efforts will mostly consist of creating or modifying 2 files: autobuild.xml, and build-cmd.sh<br />
<br />
;autobuild.xml : Autobuild package definition metadata. For now, what you should focus on "This specifies the actual shell commands that autobuild should execute for each step." You should modify this file using the '<tt>autobuild edit</tt>' command. Editing it by hand will lead to problems.<br />
;build-cmd.sh : the shell script that we are going to specify as the build command in autobuild.xml we've encapsulated a lot of the complexity within this script for our third party libraries, so we can just clone it from an existing library and customize it for our package.<br />
<br />
==What do we do==<br />
Get autobuild:<br />
hg clone http://hg.secondlife.com/autobuild<br />
cd autobuild/bin<br />
export PATH="$PATH:$(pwd)"<br />
cd ../..<br />
<br />
Copy the skeleton from an existing package.<br />
hg init hello<br />
cd hello<br />
curl -OL http://hg.secondlife.com/3p-zlib/raw/tip/BuildParams<br />
curl -OL http://hg.secondlife.com/3p-zlib/raw/tip/build-cmd.sh<br />
chmod +x build-cmd.sh<br />
curl -OL http://hg.secondlife.com/3p-zlib/raw/tip/.hgignore<br />
hg add BuildParams build-cmd.sh .hgignore<br />
<br />
Now you'll need to edit build-cmd.sh and customize it for your package in our case, [http://www.gnu.org/software/hello/ GNU Hello]. Mostly this is just a search and replace (replace occurrences of curl and CURL with the name or your package). For example, the sed search & replace commands would be <tt>s/curl/hello/g</tt> and <tt>s/CURL/HELLO/g</tt> in this case. You'll likely also need to update the version number variables to match your package's version.<br />
<br />
Additionally you'll need to update the 3 sections under the case statement with any platform specific quirks for how to build your package natively. Darwin and Linux can be pretty standardized, but under windows there are a lot of different ways to build your package. Most of these have been worked through already for one package or another, so talk to a team [[Chopper]] member or scan [[Autobuild/Package Index]] if you need examples to imitate.<br />
<br />
<br />
In the end, you should come up with something like this [[Autobuild/Quick_Start/build-cmd.sh|example build-cmd.sh]]. See [[Build Script Anatomy]].<br />
<br />
You'll need some information about your package from the upstream package distributor for filling in some of the prompts. For example you should copy the copyright string and license info verbatim from the upstream distributor. Additionally we should always write our build script to copy the text of the license into <tt>LICENSES/&lt;package name&gt;.txt</tt> and specify that location as the "Path to license file"<br />
<br />
Next you'll want to configure autobuild to use your build-cmd.sh.<br />
autobuild edit package<br />
# Name of package> hello<br />
# Package description> The GNU Hello program produces a familiar, friendly greeting. Yes, this is another implementation of the classic program that prints “Hello, world!” when you run it.<br />
# Copyright string (as appropriate for your package)> Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/><br />
# Type of license (as appropriate for your package)> gpl3<br />
# Path to license file relative to package root, if known> LICENSES/hello.txt<br />
# Version> 2.6<br />
hg add autobuild.xml<br />
autobuild edit build<br />
# Name of config> default<br />
# Platform of config> common<br />
# Command to execute> bash<br />
# Options for command> -c,../build-cmd.sh<br />
# Arguments for command><br />
autobuild edit platform name=linux build_directory=stage<br />
autobuild edit platform name=darwin build_directory=stage<br />
autobuild edit platform name=windows build_directory=stage<br />
autobuild edit build name=default platform=linux default=true<br />
autobuild edit build name=default platform=darwin default=true<br />
autobuild edit build name=default platform=windows default=true<br />
<br />
Now if you run <tt>autobuild print</tt> its output should look like this [[Autobuild/Quick_Start/Build Configured|autobuild print example]]<br />
<br />
Next you'll want to configure the manifest for packaging.<br />
<br />
autobuild manifest --platform common add "include/hello/*.h"<br />
autobuild manifest --platform common add "LICENSES/hello.txt"<br />
autobuild manifest --platform linux add "lib/*.a"<br />
autobuild manifest --platform darwin add "lib/*.a"<br />
autobuild manifest --platform windows add "lib/debug/*.pdb"<br />
autobuild manifest --platform windows add "lib/debug/*.lib"<br />
autobuild manifest --platform windows add "lib/release/*.pdb"<br />
autobuild manifest --platform windows add "lib/release/*.lib"<br />
autobuild manifest --platform linux add "bin/*"<br />
autobuild manifest --platform darwin add "bin/*"<br />
autobuild manifest --platform windows add "bin/*.exe"<br />
<br />
Now if you run <tt>autobuild print</tt> its output should look like this [[Autobuild/Quick_Start/Manifest Configured|autobuild manifest example]]<br />
<br />
Now things should be complete (for this simplified example), and you should be able to run <tt>autobuild build && autobuild package</tt> to get a package generated. Hooray!<br />
<br />
hg commit<br />
<br />
==What did we do==<br />
#We defined a build script that drives the native build of the package in a way that is compatible with our viewer builds and sandboxed from the rest of the system.<br />
# We configured autobuild to use that build script on all 3 platforms.<br />
#We packaged the result in a tarball consistent with [[Autobuild/Package_Layout]]<br />
<br />
==What haven't we done==<br />
<br />
# We haven't addressed how to handle dependencies. For example libcurl depends upon zlib and openssl already having their autobuild packages availible for use. If you're packaging a new library that has dependencies you should begin at the leaves of the dependency tree.<br />
#:[[Autobuild_How_To#Adding_dependencies]] covers this excellently.<br />
# We skipped features of autobuild that aren't useful for the way we're currently packaging third party library packages.<br />
## like multiple configurations (Debug/RelWithDebInfo/Release)<br />
## like options and arguments to the build command.<br />
## like distinct configure and build stages.<br />
# We haven't covered the specifics of how autobuild integrates with the windows Visual Studio build system.<br />
# We haven't covered specifically what the ABI requirements are for packages intended to be linked into the viewer.<br />
<br />
[[Category:Autobuild]] [[Category:Open Source Portal]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Autobuild/Package_Layout&diff=1134424Autobuild/Package Layout2011-02-16T00:23:36Z<p>Jenn Linden: </p>
<hr />
<div>The autobuild tool does not place much in the way of restrictions on how a package is bundled into an archive. The <nowiki>autobuild package</nowiki> command will simply create an archive from the build directory gathering all the files which match manifest entries. When that package is installed using <nowiki>autobuild install</nowiki>, it is just expanded into the ''packages'' subdirectory of the build directory. That said, there is a recommended layout of various build products which has (mostly) been followed by Linden apps. On this page we give the details of that recommended layout.<br />
<br />
=== Pakage layout ===<br />
<br />
The following list gives the basic expected layout for the typical kinds of build product that may end up in a package archive:<br />
*bin<br />
*include<br />
**include/<packagename><br />
*lib<br />
**lib/debug<br />
**lib/relwithdebinfo<br />
**lib/release<br />
*LICENSES<br />
<br />
==== binaries ====<br />
Executables should be packaged in the ''bin'' directory of the archive.<br />
<br />
==== headers ====<br />
Header files should be packaged in the ''include'' directory of the archive typically in a subdirectory named after the package. For example one might include the header ''foo.h" for the ''foo'' package in ''include/foo/foo.h''.<br />
<br />
==== libraries ====<br />
Static and shared libraries should be packaged in the ''lib'' directory in a subdirectory which matches the build configuration (all lower case). This is especially important for packages built for windows where debug and release libraries are binary incompatible. As an example, if the ''foo'' package produces a library ''foo.lib'', the version built with debugging enabled should be bundled in ''lib/debug'' whereas the optimized version should be bundled in ''lib/release''.<br />
<br />
==== License files ====<br />
A copy of the package's license should be bundled under the ''LICENSES'' directory. By convention these files have been named ''<nowiki><packagename>.txt</nowiki>''.<br />
<br />
=== Gotchas ===<br />
<br />
# some existing packages have their libraries located directly under lib, some have them under lib/{debug,relwithdebinfo,release}<br />
# python pacakges are not fully supported, as we have not determined how to cleanly organize python module directories for compatibility with multiple python versions<br />
# this is not compatible with the legacy package layout used in the indra codebase for non autobuild enabled builds. Packages for these builds need to be converted to the legacy layout to be used with install.py for now. UPDATE: {{User|Brad_Linden}} has gotten [[Autobuild/Teamcity|TeamCity]] to do this for us by using a BuildParam value to configure this (build_legacy_package can be set to true).<br />
<br />
[[Category:Autobuild]] [[Category:Open Source Portal]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Autobuild/Package_Layout&diff=1134408Autobuild/Package Layout2011-02-15T23:45:53Z<p>Jenn Linden: </p>
<hr />
<div>The autobuild tool does not place much in the way of restrictions on how a package is bundled into an archive. The <nowiki>autobuild package</nowiki> command will simply create an archive from the build directory gathering all the files which match manifest entries. When that package is installed using <nowiki>autobuild install</nowiki>, it is just expanded into the ''packages'' subdirectory of the build directory. That said, there is a recommended layout of various build products which has (mostly) been followed by Linden apps. On this page we give the details of that recommended layout.<br />
<br />
=== Pakage layout ===<br />
<br />
The following list gives a quick summary of the typical kinds of build product that may end up in a package archive:<br />
*bin<br />
*include<br />
**include/<packagename><br />
*lib<br />
**lib/debug<br />
**lib/relwithdebinfo<br />
**lib/release<br />
*LICENSES<br />
<br />
==== binaries ====<br />
Executables should be packaged in the ''bin'' directory of the archive.<br />
<br />
==== headers ====<br />
Header files should be packaged in the ''include'' directory of the archive typically in a subdirectory named after the package. For example one might include the header ''foo.h" for the ''foo'' package in ''include/foo/foo.h''.<br />
<br />
==== libraries ====<br />
Static and shared libraries should be packaged in the ''lib'' directory in a subdirectory which matches the build configuration (all lower case). This is especially important for packages built for windows where debug and release libraries are binary incompatible. As an example, if the ''foo'' package produces a library ''foo.lib'', the version built with debugging enabled should be bundled in ''lib/debug'' whereas the optimized version should be bundled in ''lib/release''.<br />
<br />
==== License files ====<br />
A copy of the package's license should be bundled under the ''LICENSES'' directory. By convention these files have been named ''<nowiki><packagename>.txt</nowiki>''.<br />
<br />
=== Gotchas ===<br />
<br />
# some existing packages have their libraries located directly under lib, some have them under lib/{debug,relwithdebinfo,release}<br />
# python pacakges are not fully supported, as we have not determined how to cleanly organize python module directories for compatibility with multiple python versions<br />
# this is not compatible with the legacy package layout used in the indra codebase for non autobuild enabled builds. Packages for these builds need to be converted to the legacy layout to be used with install.py for now. UPDATE: {{User|Brad_Linden}} has gotten [[Autobuild/Teamcity|TeamCity]] to do this for us by using a BuildParam value to configure this (build_legacy_package can be set to true).<br />
<br />
[[Category:Autobuild]] [[Category:Open Source Portal]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Autobuild/Package_Layout&diff=1134407Autobuild/Package Layout2011-02-15T23:45:31Z<p>Jenn Linden: </p>
<hr />
<div>The autobuild tool does not place much in the way of restrictions on how an package is bundled into an archive. The <nowiki>autobuild package</nowiki> command will simply create an archive from the build directory gathering all the files which match manifest entries. When that package is installed using <nowiki>autobuild install</nowiki>, it is just expanded into the ''packages'' subdirectory of the build directory. That said, there is a recommended layout of various build products which has (mostly) been followed by Linden apps. On this page we give the details of that recommended layout.<br />
<br />
=== Pakage layout ===<br />
<br />
The following list gives a quick summary of the typical kinds of build product that may end up in a package archive:<br />
*bin<br />
*include<br />
**include/<packagename><br />
*lib<br />
**lib/debug<br />
**lib/relwithdebinfo<br />
**lib/release<br />
*LICENSES<br />
<br />
==== binaries ====<br />
Executables should be packaged in the ''bin'' directory of the archive.<br />
<br />
==== headers ====<br />
Header files should be packaged in the ''include'' directory of the archive typically in a subdirectory named after the package. For example one might include the header ''foo.h" for the ''foo'' package in ''include/foo/foo.h''.<br />
<br />
==== libraries ====<br />
Static and shared libraries should be packaged in the ''lib'' directory in a subdirectory which matches the build configuration (all lower case). This is especially important for packages built for windows where debug and release libraries are binary incompatible. As an example, if the ''foo'' package produces a library ''foo.lib'', the version built with debugging enabled should be bundled in ''lib/debug'' whereas the optimized version should be bundled in ''lib/release''.<br />
<br />
==== License files ====<br />
A copy of the package's license should be bundled under the ''LICENSES'' directory. By convention these files have been named ''<nowiki><packagename>.txt</nowiki>''.<br />
<br />
=== Gotchas ===<br />
<br />
# some existing packages have their libraries located directly under lib, some have them under lib/{debug,relwithdebinfo,release}<br />
# python pacakges are not fully supported, as we have not determined how to cleanly organize python module directories for compatibility with multiple python versions<br />
# this is not compatible with the legacy package layout used in the indra codebase for non autobuild enabled builds. Packages for these builds need to be converted to the legacy layout to be used with install.py for now. UPDATE: {{User|Brad_Linden}} has gotten [[Autobuild/Teamcity|TeamCity]] to do this for us by using a BuildParam value to configure this (build_legacy_package can be set to true).<br />
<br />
[[Category:Autobuild]] [[Category:Open Source Portal]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Viewer_Update_Service/Protocol/v1.0&diff=1131295Viewer Update Service/Protocol/v1.02011-01-11T07:25:48Z<p>Jenn Linden: </p>
<hr />
<div>The Update Service Protocol is implemented in the API presented by the [[Viewer Update Service]].<br />
<br />
==Basics==<br />
<br />
This design is the result of research and a whiteboard discussion followed by comparison with and extension by [http://code.google.com/p/omaha/wiki/ServerProtocol Google's Omaha update server protocol].<br />
<br />
We chose XML as a format (rather than, say, just responding with a redirect to a download url) due to its extensibility. Example potential future uses include more granular updates, updates with dependencies, and more sophisticated user options and viewer behavior regarding updates.<br />
<br />
Rather than there being one update server per grid, there will be a single production update server, and test update servers as needed entirely unassociated with any particular grid.<br />
<br />
==Design==<br />
<br />
Requests are made to: https://update.secondlife.com/update<br />
<br />
===Request===<br />
<br />
Perform an HTTP GET to a URL of this form:<br />
<br />
<tt><nowiki>https://<hostname>/update/<protocol version>/<channel>/<your version>/<platform></nowiki></tt><br />
<br />
''Example''<br />
<br />
GET https://update.secondlife.com/update/v1.0/Second%20Life%20Release/2.3.0.214726/win<br />
<br />
The 'v1.0' string is the version of the update service protocol version being used. This will enable us to maintain compatibility with older viewers when we choose to make changes to this service.<br />
<br />
===Response===<br />
<br />
200 OK<br />
<br />
''Content example''<br />
<br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<llsd><br />
<map><br />
<key>url</key><string>http://download.cloud.secondlife.com/thisupdate</string> <br />
<key>hash</key><string>12345ACDDEF9381</string><br />
<key>version</key><string>2.1.0.207030</string><br />
<key>required</key><boolean>False</boolean><br />
<key>size</key><integer>23467421</integer><br />
<key>channel</key><string>Second Life Release</string><br />
<key>pony</key><string>myponyurl</string><br />
<key>more_info</key><string>http://wiki.secondlife.com/thisinfo</string> <br />
<key>error_url</key><string>http://wiki.secondlife.com/myerorpage</string><br />
</map><br />
</llsd><br />
</pre><br />
<br />
'''Response Fields'''<br />
<br />
If no update is available, the response message body is an empty llsd container.<br />
<br />
If there is an update, the response will be populated as follows:<br />
<br />
* url: the url of the update to download<br />
* hash: the md5sum of the download<br />
* version: the version of the update linked to by the download url<br />
* required: boolean indicating whether an update is required<br />
* size (optional): the size in bytes of the download<br />
* channel (optional): repeat back the channel for which the update was requested<br />
* pony (optional): a link to a picture of a pony. Your reward for performing an update<br />
* more_info (optional): a url containing information about the update<br />
* error_url (optional): a url containing information about any error that may have occurred<br />
<br />
''Note: size may be removed, as we are getting this information from HTTP headers instead at the moment.''<br />
<br />
===Errors===<br />
<br />
'''404 Not Found'''<br />
<br />
If you request a url that is not part of the defined update service interface, you'll receive a 404. <br />
<br />
Also, if you request a URL which contains a channel or version number that aren't in our version database, you'll receive a 404. Our version database tracks all publicly released versions in the Second Life Beta Viewer and Second Life Release channels.<br />
<br />
'''406 Not Acceptable'''<br />
<br />
If a request provides an accept header which contains a format specification that the server is unable to satisfy, the server will respond with a 406.<br />
<br />
'''500 Internal Server Error'''<br />
<br />
If the service hits an unexpected exception, it will return a 500.<br />
<br />
===Testing URLs===<br />
<br />
The following URL paths are provided for testing:<br />
<br />
<pre><br />
https://<hostname>/noupdate/v1.0/...<br />
https://<hostname>/updaterequired/v1.0/...<br />
https://<hostname>/updateoptional/v1.0/...<br />
</pre><br />
<br />
Where '...' is replaced with a normal request predicate. Responses indicating no update, update required, or update optional are returned as described by the path.<br />
<br />
For each of these, special channels will return differently formed responses, e.g.:<br />
<br />
<pre><br />
https://<hostname>/updateoptional/v1.0/Bad%20Hash/...<br />
</pre><br />
<br />
Available channels:<br />
<pre><br />
Bad%20Hash<br />
No%20Hash<br />
No%20URL<br />
No%20Size<br />
</pre><br />
<br />
...where each channel returns a response with the characteristic described by the channel name. All other channels besides these will return generic data containing correct hashes and urls for the platform requested.<br />
<br />
==Discussion==<br />
<br />
===Why LLSD?===<br />
<br />
We compared LLSD as a format to use against atom and straight XML. <br />
* Atom would be able to handle our current use-case, but would not handle the projected future use-case of more granular or dependency-driven updates as naturally.<br />
* We have server and client infrastructure in place to suport LLSD. We don't have the same infrastructure to support atom or straight XML <br />
* On the other hand, atom is an industry standard, with many pre-built tools and pre-made solutions.<br />
* Atom feeds already enjoy some industry adoption for udpater services, aka "appcasts".<br />
<br />
The cost of integrating a new xml library into our set of supported technologies and the tight time budget for version 1.0 of our updater service make atom and straight xml less desirable choices than LLSD at this time.</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Viewer_Update_Service/Protocol/v1.0&diff=1131184Viewer Update Service/Protocol/v1.02011-01-10T18:56:11Z<p>Jenn Linden: </p>
<hr />
<div>The Update Service Protocol is implemented in the API presented by the [[Viewer Update Service]].<br />
<br />
==Basics==<br />
<br />
This design is the result of research and a whiteboard discussion followed by comparison with and extension by [http://code.google.com/p/omaha/wiki/ServerProtocol Google's Omaha update server protocol].<br />
<br />
We chose XML as a format (rather than, say, just responding with a redirect to a download url) due to its extensibility. Example potential future uses include more granular updates, updates with dependencies, and more sophisticated user options and viewer behavior regarding updates.<br />
<br />
Rather than there being one update server per grid, there will be a single production update server, and test update servers as needed entirely unassociated with any particular grid.<br />
<br />
==Design==<br />
<br />
Requests are made to: https://update.secondlife.com/update<br />
<br />
===Request===<br />
<br />
Perform an HTTP GET to a URL of this form:<br />
<br />
<tt><nowiki>https://<hostname>/update/<protocol version>/<channel>/<your version>/<platform></nowiki></tt><br />
<br />
''Example''<br />
<br />
GET https://update.secondlife.com/update/v1.0/Second%20Life%20Release/2.3.0.214726/win<br />
<br />
The 'v1.0' string is the version of the update service protocol version being used. This will enable us to maintain compatibility with older viewers when we choose to make changes to this service.<br />
<br />
===Response===<br />
<br />
200 OK<br />
<br />
''Content example''<br />
<br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<llsd><br />
<map><br />
<key>url</key><string>http://download.cloud.secondlife.com/thisupdate</string> <br />
<key>hash</key><string>12345ACDDEF9381</string><br />
<key>version</key><string>2.1.0.207030</string><br />
<key>required</key><boolean>False</boolean><br />
<key>size</key><integer>23467421</integer><br />
<key>channel</key><string>Second Life Release</string><br />
<key>pony</key><string>myponyurl</string><br />
<key>more_info</key><string>http://wiki.secondlife.com/thisinfo</string> <br />
<key>error_url</key><string>http://wiki.secondlife.com/myerorpage</string><br />
</map><br />
</llsd><br />
</pre><br />
<br />
'''Response Fields'''<br />
<br />
If no update is available, the response message body is an empty llsd container.<br />
<br />
If there is an update, the response will be populated as follows:<br />
<br />
* url: the url of the update to download<br />
* hash: the md5sum of the download<br />
* version: the version of the update linked to by the download url<br />
* required: boolean indicating whether an update is required<br />
* size (optional): the size in bytes of the download<br />
* channel (optional): repeat back the channel for which the update was requested<br />
* pony (optional): a link to a picture of a pony. Your reward for performing an update<br />
* more_info (optional): a url containing information about the update<br />
* error_url (optional): a url containing information about any error that may have occurred<br />
<br />
''Note: size may be removed, as we are getting this information from HTTP headers instead at the moment.''<br />
<br />
===Errors===<br />
<br />
'''404'''<br />
<br />
If you request a url that is not part of the defined update service interface, you'll receive a 404. <br />
<br />
Also, if you request a URL which contains a channel or version number that aren't in our version database, you'll receive a 404. Our version database tracks all publicly released versions in the Second Life Beta Viewer and Second Life Release channels.<br />
<br />
'''500'''<br />
<br />
If the service hits an exception, it will return a 500.<br />
<br />
===Testing URLs===<br />
<br />
The following URL paths are provided for testing:<br />
<br />
<pre><br />
https://<hostname>/noupdate/v1.0/...<br />
https://<hostname>/updaterequired/v1.0/...<br />
https://<hostname>/updateoptional/v1.0/...<br />
</pre><br />
<br />
Where '...' is replaced with a normal request predicate. Responses indicating no update, update required, or update optional are returned as described by the path.<br />
<br />
For each of these, special channels will return differently formed responses, e.g.:<br />
<br />
<pre><br />
https://<hostname>/updateoptional/v1.0/Bad%20Hash/...<br />
</pre><br />
<br />
Available channels:<br />
<pre><br />
Bad%20Hash<br />
No%20Hash<br />
No%20URL<br />
No%20Size<br />
</pre><br />
<br />
...where each channel returns a response with the characteristic described by the channel name. All other channels besides these will return generic data containing correct hashes and urls for the platform requested.<br />
<br />
==Discussion==<br />
<br />
===Why LLSD?===<br />
<br />
We compared LLSD as a format to use against atom and straight XML. <br />
* Atom would be able to handle our current use-case, but would not handle the projected future use-case of more granular or dependency-driven updates as naturally.<br />
* We have server and client infrastructure in place to suport LLSD. We don't have the same infrastructure to support atom or straight XML <br />
* On the other hand, atom is an industry standard, with many pre-built tools and pre-made solutions.<br />
* Atom feeds already enjoy some industry adoption for udpater services, aka "appcasts".<br />
<br />
The cost of integrating a new xml library into our set of supported technologies and the tight time budget for version 1.0 of our updater service make atom and straight xml less desirable choices than LLSD at this time.</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Viewer_Update_Service/Protocol/v1.0&diff=1131174Viewer Update Service/Protocol/v1.02011-01-10T18:45:47Z<p>Jenn Linden: </p>
<hr />
<div>The Update Service Protocol is implemented in the API presented by the [[Viewer Update Service]].<br />
<br />
==Basics==<br />
<br />
This design is the result of research and a whiteboard discussion followed by comparison with and extension by [http://code.google.com/p/omaha/wiki/ServerProtocol Google's Omaha update server protocol].<br />
<br />
We chose XML as a format (rather than, say, just responding with a redirect to a download url) due to its extensibility. Example potential future uses include more granular updates, updates with dependencies, and more sophisticated user options and viewer behavior regarding updates.<br />
<br />
Rather than there being one update server per grid, there will be a single production update server, and test update servers as needed entirely unassociated with any particular grid.<br />
<br />
==Design==<br />
<br />
Requests are made to: https://update.secondlife.com/update<br />
<br />
===Request===<br />
<br />
Perform an HTTP GET to a URL of this form:<br />
<br />
<tt><nowiki>https://<hostname>/update/<protocol version>/<channel>/<your version>/<platform></nowiki></tt><br />
<br />
''Example''<br />
<br />
GET https://update.secondlife.com/update/v1.0/Second%20Life%20Release/2.3.0.214726/win<br />
<br />
The 'v1.0' string is the version of the update service protocol version being used. This will enable us to maintain compatibility with older viewers when we choose to make changes to this service.<br />
<br />
===Response===<br />
<br />
200 OK<br />
<br />
''Content example''<br />
<br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<llsd><br />
<map><br />
<key>url</key><string>http://download.cloud.secondlife.com/thisupdate</string> <br />
<key>hash</key><string>12345ACDDEF9381</string><br />
<key>version</key><string>2.1.0.207030</string><br />
<key>required</key><boolean>False</boolean><br />
<key>size</key><integer>23467421</integer><br />
<key>channel</key><string>Second Life Release</string><br />
<key>pony</key><string>myponyurl</string><br />
<key>more_info</key><string>http://wiki.secondlife.com/thisinfo</string> <br />
<key>error_url</key><string>http://wiki.secondlife.com/myerorpage</string><br />
</map><br />
</llsd><br />
</pre><br />
<br />
'''Response Fields'''<br />
<br />
If no update is available, the response message body is an empty llsd container.<br />
<br />
If there is an update, the response will be populated as follows:<br />
<br />
* url: the url of the update to download<br />
* hash: the md5sum of the download<br />
* version: the version of the update linked to by the download url<br />
* required: boolean indicating whether an update is required<br />
* size (optional): the size in bytes of the download<br />
* channel (optional): repeat back the channel for which the update was requested<br />
* pony (optional): a link to a picture of a pony. Your reward for performing an update<br />
* more_info (optional): a url containing information about the update<br />
* error_url (optional): a url containing information about any error that may have occurred<br />
<br />
''Note: size may be removed, as we are getting this information from HTTP headers instead at the moment.''<br />
<br />
===Errors===<br />
<br />
'''404'''<br />
<br />
If you request a url that is not part of the defined update service interface, you'll receive a 404.<br />
<br />
'''500'''<br />
<br />
If the service hits an exception of some sort, it will return a 500.<br />
<br />
===Testing URLs===<br />
<br />
The following URL paths are provided for testing:<br />
<br />
<pre><br />
https://<hostname>/noupdate/v1.0/...<br />
https://<hostname>/updaterequired/v1.0/...<br />
https://<hostname>/updateoptional/v1.0/...<br />
</pre><br />
<br />
Where '...' is replaced with a normal request predicate. Responses indicating no update, update required, or update optional are returned as described by the path.<br />
<br />
For each of these, special channels will return differently formed responses, e.g.:<br />
<br />
<pre><br />
https://<hostname>/updateoptional/v1.0/Bad%20Hash/...<br />
</pre><br />
<br />
Available channels:<br />
<pre><br />
Bad%20Hash<br />
No%20Hash<br />
No%20URL<br />
No%20Size<br />
</pre><br />
<br />
...where each channel returns a response with the characteristic described by the channel name. All other channels besides these will return generic data containing correct hashes and urls for the platform requested.<br />
<br />
==Discussion==<br />
<br />
===Why LLSD?===<br />
<br />
We compared LLSD as a format to use against atom and straight XML. <br />
* Atom would be able to handle our current use-case, but would not handle the projected future use-case of more granular or dependency-driven updates as naturally.<br />
* We have server and client infrastructure in place to suport LLSD. We don't have the same infrastructure to support atom or straight XML <br />
* On the other hand, atom is an industry standard, with many pre-built tools and pre-made solutions.<br />
* Atom feeds already enjoy some industry adoption for udpater services, aka "appcasts".<br />
<br />
The cost of integrating a new xml library into our set of supported technologies and the tight time budget for version 1.0 of our updater service make atom and straight xml less desirable choices than LLSD at this time.</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Linden_Lab_Official:Getting_Started_Developing_Media_Rendering_Plugins&diff=1083452Linden Lab Official:Getting Started Developing Media Rendering Plugins2010-10-27T22:22:10Z<p>Jenn Linden: Undo revision 1083353 by Jenn Linden (Talk)</p>
<hr />
<div>{{Media Plugin Nav}}<br />
<br />
== Introduction ==<br />
<br />
The Media Rendering Plugin system enables you to create your own media rendering plugins for the Second Life Viewer. Currently, you must download the [[Snowglobe]] source code and build the Viewer to do so; Future releases will enable you to build plugins without building the entire Viewer.<br />
<br />
Media rendering plugins can display content:<br />
* Via [[Parcel media|parcel media]].<br />
* In the Viewer's [Parcel_media#The_Media_Browser_Window media browser] (the built-in web browser window).<br />
* In the [[Plugin Test App: LLMediaPluginTest|Plugin Test App]] provided with Viewer source code (for use during development only).<br />
<br />
== Setting up your environment ==<br />
Before creating a new plugin, set up your development environment and make sure the necessary tools are in place.<br />
<br />
===System requirements and tools===<br />
* Operating System: Windows XP or Vista<br />
* Visual Studio 2005 (Warning: Visual Studio 2008 may not work)<br />
''This guide currently assumes you are using Visual Studio. Some of the specific instructions will not apply to Mac or Linux users.<br />
''<br />
=== Downloading and building the Viewer ===<br />
To download and build the Viewer:<br />
* Follow the [[Get_source_and_compile |Snowglobe instructions for getting and compiling the source code]]<br />
<br />
=== Checking that your environment was built correctly ===<br />
To check that your environment was built correctly, run the example plugin both on the [[Plugin Test App: LLMediaPluginTest|Plugin Test App]] and inworld.<br />
<br />
==== The example plugin: media_plugin_example ====<br />
The source code includes a simple example plugin: <code>indra\media_plugins\example\media_plugin_example.cpp</code>. It displays a checkerboard pattern background overlaid with bouncing squares, with automatically changing colors. Keyboard input causes the checkerboard pattern to change. You can also draw lines by holding the left mouse button down.<br />
<br />
==== Running the example plugin in the Plugin Test App ====<br />
[[Plugin Test App: LLMediaPluginTest#Opening a bookmark in a panel|Open the "(EX) Example Plugin" bookmark in a panel]] using [[Plugin Test App: LLMediaPluginTest|the Plugin Test App]].<br />
<br />
==== Running the example plugin in the Viewer ====<br />
<br />
<ol><br />
<li> Add the example plugin type to the Viewer by adding the following lines to <code>indra\newview\skins\default\xui\en\mime_types.xml</code>:<br />
<xml><scheme name="example"><br />
<label name="example_label"><br />
Example Plugin<br />
</label><br />
<widgettype><br />
image<br />
</widgettype><br />
<impl><br />
media_plugin_example<br />
</impl><br />
</scheme></xml><br />
</li><br />
<li>Add the example plugin to an object inworld: Using <code>example://foo</code> as the URL, follow the [[Adding Shared Media to an object|instructions for adding media to an object]] to use the example plugin inworld. You will see the example plugin animation displayed on the face of the object you selected.<br />
</li><br />
</ol><br />
<br />
== Creating your own Hello World plugin ==<br />
To create your own Hello World plugin, you need to both create the plugin C++ file and edit some supporting files.<br />
<br />
=== Creating and editing the new plugin files ===<br />
To create and edit the new Hello World plugin files:<br />
# Create a new directory: <code>indra\media_plugins\helloworld</code>.<br />
# In the new <code>helloworld</code> directory, create a new file called <code>media_plugin_helloworld.cpp</code> by copying and pasting [[Hello World plugin: basic plugin code |this basic plugin code]]. This code implements the basic functions that are necessary in any plugin.<br />
# Find the "TODO" comment in the <code>MediaPluginHelloworld::update()</code> function, and replace it with [[Hello World plugin: update()|the code snippet here]]. This code displays a moving square with changing color on a black background.<br />
# In the <code>helloworld</code> directory, create another new file called CMakeLists.txt by copying and pasting [[Hello World plugin: CMakeLists.txt|everything on this page]].<br />
# Add the following line to the bottom of <code>indra\media_plugins\CMakeLists.txt</code>:<br />
#: <code>add_subdirectory(helloworld) </code><br />
# Make sure the code compiles:<br />
## In the <code>indra\</code> directory, run <code>develop.py</code>.<br />
## In the Visual Studio Solution Explorer pane, right-click <code>media_plugin_helloworld</code> and '''Build'''.<br />
<br />
=== Testing your new plugin before trying it in the Viewer ===<br />
Use the [[Plugin Test App: LLMediaPluginTest|Plugin Test App]] to test your new plugin before trying it in the Viewer:<br />
# [[Plugin Test App: LLMediaPluginTest#Adding a new plugin type|Add your new plugin]] to the Plugin Test App. ''Note: You can use the example code as-is.''<br />
# [[Plugin Test App: LLMediaPluginTest|Test your new plugin]] using the Plugin Test App.<br />
<br />
=== Using your new plugin inworld ===<br />
To use your new plugin inworld:<br />
<ol><br />
<li> Add your new plugin to the Viewer:<br />
<ol><br />
<li>Add the following lines to <code>indra\newview\skins\default\xui\en\mime_types.xml</code>. This is similar to [[#Running the example plugin in the viewer|the way you modified <code>mime_types.xml</code> for the example plugin]].<br />
<xml><scheme name="helloworld"><br />
<label name="helloworld_label"><br />
Hello World Plugin<br />
</label><br />
<widgettype><br />
image<br />
</widgettype><br />
<impl><br />
media_plugin_helloworld<br />
</impl><br />
</scheme></xml><br />
</li><br />
<li>Add your plugin to the list of dependencies for the Viewer in <code>indra\newview\CMakeList.txt</code>:<br />
<ul><br />
<li>Search for ''every instance'' of "media_plugin_example" in an <code>add_dependencies()</code> line and add "media_plugin_helloworld". Example:<br />
<p>'''Old''': <code>add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit media_plugin_example)</code></p><br />
<p>'''New''': <code>add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit media_plugin_example media_plugin_helloworld)</code></p><br />
</li><br />
<li> Search for "media_plugin_example" in a <code>get_target_property()</code> line. Copy and paste the entire <code>get_target_property()</code> section, replacing "example" with "helloworld". The new section will look like this:<br />
<pre> get_target_property(BUILT_HELLOWORLD_PLUGIN media_plugin_helloworld LOCATION)<br />
add_custom_command(<br />
TARGET ${VIEWER_BINARY_NAME} POST_BUILD<br />
COMMAND ${CMAKE_COMMAND}<br />
ARGS<br />
-E<br />
copy_if_different<br />
${BUILT_HELLOWORLD_PLUGIN}<br />
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin<br />
COMMENT "Copying Hello World Plugin to the runtime folder."<br />
)<br />
</pre><br />
</li><br />
</ul><br />
</li><br />
</ol><br />
</li><br />
<li>[[#Downloading and building the Viewer| Re-build the Viewer]].<br />
<li>Start the Viewer, choose Help, then in the media browser window that opens, enter the URL of your media, <code>helloworld://foo</code>. If desired, you can also log into Second Life add your media as [[Parcel media]].<br />
</ol><br />
<br />
Congratulations! You have successfully created your first simple plugin.<br />
<br />
== How the Hello World plugin works ==<br />
The Hello World plugin implements the basic functions that any media rendering plugin needs to work correctly.<br />
<br />
=== Messages ===<br />
A media rendering plugin uses [[Media Plugin System Messages | messages]] to communicate with the [[Media Rendering Plugin Framework Technical Overview#SLPLugin : Plugin loader shell | Plugin Loader Shell]], which mediates requests between the plugin and the Viewer. <br />
<br />
==== Initialization ====<br />
When a plugin is loaded, the plugin and Plugin Loader Shell exchange specific messages to initialize the plugin. While a plugin is running, the Plugin Loader Shell uses messages to notify it of mouse and keyboard input.<br />
<br />
In the Hello World plugin, <code>init_media_plugin()</code> creates the message interface between the plugin and Plugin Loader Shell:<br />
<cpp><br />
int init_media_plugin( LLPluginInstance::sendMessageFunction host_send_func,<br />
void* host_user_data,<br />
LLPluginInstance::sendMessageFunction *plugin_send_func,<br />
void **plugin_user_data )<br />
{<br />
MediaPluginHelloworld* self = new MediaPluginHelloworld( host_send_func, host_user_data );<br />
*plugin_send_func = MediaPluginHelloworld::staticReceiveMessage;<br />
*plugin_user_data = ( void* )self;<br />
<br />
return 0;<br />
}<br />
</cpp><br />
<br />
To initialize the plugin, the Plugin Loader Shell sends an "init" message to the Hello World plugin. The plugin responds with messages that contain information about the plugin version ("init_response") and the object's texture parameters ("texture_params"):<br />
<cpp><br />
if ( message_name == "init" )<br />
{<br />
LLPluginMessage message( "base", "init_response" );<br />
LLSD versions = LLSD::emptyMap();<br />
versions[ LLPLUGIN_MESSAGE_CLASS_BASE ] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION;<br />
versions[ LLPLUGIN_MESSAGE_CLASS_MEDIA ] = LLPLUGIN_MESSAGE_CLASS_MEDIA_VERSION;<br />
versions[ LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER ] = LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER_VERSION;<br />
message.setValueLLSD( "versions", versions );<br />
<br />
std::string plugin_version = "Hello World media plugin, Hello World Version 1.0.0.0";<br />
message.setValue( "plugin_version", plugin_version );<br />
sendMessage( message );<br />
<br />
// Plugin gets to decide the texture parameters to use.<br />
message.setMessage( LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params" );<br />
message.setValueS32( "default_width", mWidth ); // width in pixels<br />
message.setValueS32( "default_height", mHeight ); // height in pixels<br />
message.setValueS32( "depth", mDepth ); // pixel size in bytes<br />
message.setValueU32( "internalformat", GL_RGBA );<br />
message.setValueU32( "format", GL_RGBA );<br />
message.setValueU32( "type", GL_UNSIGNED_BYTE );<br />
message.setValueBoolean( "coords_opengl", false );<br />
sendMessage( message );<br />
}<br />
</cpp><br />
<br />
==== Idle messages ====<br />
The Plugin Loader Shell also sends frequent "idle" messages to the plugin. The "idle" messages indicate that time is passing, so the plugin can update its state.<br />
<br />
When the Hello World plugin receives an "idle" message, it updates the color and position of the square in the image by calling <code>update()</code>:<br />
<cpp><br />
if ( message_name == "idle" )<br />
{<br />
// no response is necessary here.<br />
double time = message_in.getValueReal( "time" );<br />
<br />
std::cout << "MediaPluginHelloworld::receiveMessage(): idle"<<std::endl;<br />
// Convert time to milliseconds for update()<br />
update( time );<br />
}<br />
</cpp><br />
==== Keyboard input ====<br />
If keyboard input occurs, the Plugin Loader Shell sends a <code>key_event</code> message to the plugin. The plugin can see what key was pressed and act accordingly.<br />
<br />
In the Hello World plugin, pressing the space key causes the plugin to update:<br />
<cpp><br />
if ( message_name == "key_event" )<br />
{<br />
std::string event = message_in.getValue( "event" );<br />
S32 key = message_in.getValueS32( "key" );<br />
std::string modifiers = message_in.getValue( "modifiers" );<br />
<br />
if ( event == "down" )<br />
{<br />
if ( key == ' ')<br />
{<br />
mLastUpdateTime = 0;<br />
update( 0.0f );<br />
};<br />
};<br />
}<br />
</cpp><br />
<br />
==== Mouse input ====<br />
If the Hello World plugin receives a "left mouse button down" message, it detects the location of the mouse cursor and creates a white dot by writing to shared memory:<br />
<cpp><br />
if ( message_name == "mouse_event" )<br />
{<br />
std::string event = message_in.getValue( "event" );<br />
S32 button = message_in.getValueS32( "button" );<br />
<br />
// left mouse button<br />
if ( button == 0 )<br />
{<br />
int mouse_x = message_in.getValueS32( "x" );<br />
int mouse_y = message_in.getValueS32( "y" );<br />
std::string modifiers = message_in.getValue( "modifiers" );<br />
<br />
if ( event == "move" )<br />
{<br />
if ( mMouseButtonDown )<br />
write_pixel( mouse_x, mouse_y, 0xFF, 0xFF, 0xFF);<br />
}<br />
else<br />
if ( event == "down" )<br />
{<br />
mMouseButtonDown = true;<br />
}<br />
else<br />
if ( event == "up" )<br />
{<br />
mMouseButtonDown = false;<br />
}<br />
else<br />
if ( event == "double_click" )<br />
{<br />
};<br />
};<br />
}<br />
</cpp><br />
<br />
=== Shared memory ===<br />
The shared memory represents the area displayed by the Viewer. In response to the "texture_params" message, the Plugin Loader Shell sends a "shm_added" message with a pointer to the shared memory that the plugin will use to transfer display data:<br />
<cpp><br />
if ( message_name == "shm_added" )<br />
{<br />
SharedSegmentInfo info;<br />
info.mAddress = message_in.getValuePointer( "address" );<br />
info.mSize = ( size_t )message_in.getValueS32( "size" );<br />
std::string name = message_in.getValue( "name" );<br />
<br />
mSharedSegments.insert( SharedSegmentMap::value_type( name, info ) );<br />
<br />
}<br />
</cpp><br />
<br />
=== Display ===<br />
The Hello World plugin writes an image to shared memory using RGB color values. The Viewer reads the image from shared memory and displays it. In the Hello World plugin, the <code>update()</code> function writes the image to shared memory:<br />
<cpp><br />
if ( time( NULL ) > mLastUpdateTime + 1 )<br />
{<br />
// Draw black background<br />
int bkgnd_r = 0;<br />
int bkgnd_g = 0;<br />
int bkgnd_b = 0;<br />
for (int bkgnd_pix = 0; bkgnd_pix < getSurfaceSize(); bkgnd_pix = bkgnd_pix+mDepth)<br />
{<br />
mBackgroundPixels [bkgnd_pix + 0] = bkgnd_r;<br />
mBackgroundPixels [bkgnd_pix + 1] = bkgnd_g;<br />
mBackgroundPixels [bkgnd_pix + 2] = bkgnd_b;<br />
}<br />
<br />
// Set the color of the moving square<br />
squareR = (squareR+1) % (0xFF-0x20) + 0x20;<br />
squareG = (squareG+7) % (0xFF-0x20) + 0x20;<br />
squareB = (squareB+7) % (0xFF-0x20) + 0x20;<br />
<br />
time( &mLastUpdateTime );<br />
<br />
}<br />
memcpy( mPixels, mBackgroundPixels, getSurfaceSize() );<br />
<br />
<br />
// Black out last position of square<br />
for ( int xcnt = 0; xcnt < squareWidth; ++xcnt )<br />
{<br />
for ( int ycnt = 0; ycnt < squareHeight; ++ycnt )<br />
{<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 0 ] = 0;<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 1 ] = 0;<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 2 ] = 0;<br />
}<br />
}<br />
<br />
// Calculate the new position of the moving square. Note: (0,0) is the top left corner.<br />
//<br />
if (rand() % 400 == 0) // only change direction once in a while<br />
{<br />
randomizeDirection();<br />
}<br />
<br />
if ((squareXpos + squareXinc < 0) || (squareXpos + squareXinc >= mWidth - squareWidth))<br />
squareXinc = -squareXinc;<br />
<br />
if ((squareYpos + squareYinc < 0) || (squareYpos + squareYinc >= mHeight - squareHeight))<br />
squareYinc = -squareYinc;<br />
<br />
squareXpos += squareXinc;<br />
squareYpos += squareYinc;<br />
<br />
// Draw square<br />
for ( int xcnt = 0; xcnt < squareWidth; ++xcnt )<br />
{<br />
for ( int ycnt = 0; ycnt < squareHeight; ++ycnt )<br />
{<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 0 ] = squareR;<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 1 ] = squareG;<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 2 ] = squareB;<br />
}<br />
}<br />
</cpp><br />
<br />
== Troubleshooting tips ==<br />
=== Setting breakpoints in plugin code ===<br />
A plugin runs as a separate process from the Viewer, so breakpoints can only be set after the Viewer is running and the plugin has also started running.<br />
<br />
To set breakpoints in plugin code:<br />
# In Visual Studio, with the project set to '''secondlife-bin''', select '''Debug->Start Without Debugging'''.<br />
# Log into Second Life and go to the object using your media rendering plugin.<br />
# Select '''Debug->Attach To Process''', and select the '''SLPlugin.exe''' items in the list.<br />
You can now set breakpoints in your plugin code.</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Linden_Lab_Official:Getting_Started_Developing_Media_Rendering_Plugins&diff=1083353Linden Lab Official:Getting Started Developing Media Rendering Plugins2010-10-27T20:45:00Z<p>Jenn Linden: /* Running the example plugin in the Viewer */</p>
<hr />
<div>{{Media Plugin Nav}}<br />
<br />
== Introduction ==<br />
<br />
The Media Rendering Plugin system enables you to create your own media rendering plugins for the Second Life Viewer. Currently, you must download the [[Snowglobe]] source code and build the Viewer to do so; Future releases will enable you to build plugins without building the entire Viewer.<br />
<br />
Media rendering plugins can display content:<br />
* Via [[Parcel media|parcel media]].<br />
* In the Viewer's [Parcel_media#The_Media_Browser_Window media browser] (the built-in web browser window).<br />
* In the [[Plugin Test App: LLMediaPluginTest|Plugin Test App]] provided with Viewer source code (for use during development only).<br />
<br />
== Setting up your environment ==<br />
Before creating a new plugin, set up your development environment and make sure the necessary tools are in place.<br />
<br />
===System requirements and tools===<br />
* Operating System: Windows XP or Vista<br />
* Visual Studio 2005 (Warning: Visual Studio 2008 may not work)<br />
''This guide currently assumes you are using Visual Studio. Some of the specific instructions will not apply to Mac or Linux users.<br />
''<br />
=== Downloading and building the Viewer ===<br />
To download and build the Viewer:<br />
* Follow the [[Get_source_and_compile |Snowglobe instructions for getting and compiling the source code]]<br />
<br />
=== Checking that your environment was built correctly ===<br />
To check that your environment was built correctly, run the example plugin both on the [[Plugin Test App: LLMediaPluginTest|Plugin Test App]] and inworld.<br />
<br />
==== The example plugin: media_plugin_example ====<br />
The source code includes a simple example plugin: <code>indra\media_plugins\example\media_plugin_example.cpp</code>. It displays a checkerboard pattern background overlaid with bouncing squares, with automatically changing colors. Keyboard input causes the checkerboard pattern to change. You can also draw lines by holding the left mouse button down.<br />
<br />
==== Running the example plugin in the Plugin Test App ====<br />
[[Plugin Test App: LLMediaPluginTest#Opening a bookmark in a panel|Open the "(EX) Example Plugin" bookmark in a panel]] using [[Plugin Test App: LLMediaPluginTest|the Plugin Test App]].<br />
<br />
==== Running the example plugin in the Viewer ====<br />
<br />
<ol><br />
<li> Add the example plugin type to the Viewer by adding the following lines to <code>indra\newview\skins\default\xui\en\mime_types.xml</code>:<br />
<xml><scheme name="example"><br />
<label name="example_label"><br />
Example Plugin<br />
</label><br />
<widgettype><br />
image<br />
</widgettype><br />
<impl><br />
media_plugin_example<br />
</impl><br />
</scheme></xml><br />
</li><br />
<li>Add the example plugin to an object inworld: Using <code>example://foo</code> as the URL, follow the [[Adding media to an object|instructions for adding media to an object]] to use the example plugin inworld. You will see the example plugin animation displayed on the face of the object you selected.<br />
</li><br />
</ol><br />
<br />
== Creating your own Hello World plugin ==<br />
To create your own Hello World plugin, you need to both create the plugin C++ file and edit some supporting files.<br />
<br />
=== Creating and editing the new plugin files ===<br />
To create and edit the new Hello World plugin files:<br />
# Create a new directory: <code>indra\media_plugins\helloworld</code>.<br />
# In the new <code>helloworld</code> directory, create a new file called <code>media_plugin_helloworld.cpp</code> by copying and pasting [[Hello World plugin: basic plugin code |this basic plugin code]]. This code implements the basic functions that are necessary in any plugin.<br />
# Find the "TODO" comment in the <code>MediaPluginHelloworld::update()</code> function, and replace it with [[Hello World plugin: update()|the code snippet here]]. This code displays a moving square with changing color on a black background.<br />
# In the <code>helloworld</code> directory, create another new file called CMakeLists.txt by copying and pasting [[Hello World plugin: CMakeLists.txt|everything on this page]].<br />
# Add the following line to the bottom of <code>indra\media_plugins\CMakeLists.txt</code>:<br />
#: <code>add_subdirectory(helloworld) </code><br />
# Make sure the code compiles:<br />
## In the <code>indra\</code> directory, run <code>develop.py</code>.<br />
## In the Visual Studio Solution Explorer pane, right-click <code>media_plugin_helloworld</code> and '''Build'''.<br />
<br />
=== Testing your new plugin before trying it in the Viewer ===<br />
Use the [[Plugin Test App: LLMediaPluginTest|Plugin Test App]] to test your new plugin before trying it in the Viewer:<br />
# [[Plugin Test App: LLMediaPluginTest#Adding a new plugin type|Add your new plugin]] to the Plugin Test App. ''Note: You can use the example code as-is.''<br />
# [[Plugin Test App: LLMediaPluginTest|Test your new plugin]] using the Plugin Test App.<br />
<br />
=== Using your new plugin inworld ===<br />
To use your new plugin inworld:<br />
<ol><br />
<li> Add your new plugin to the Viewer:<br />
<ol><br />
<li>Add the following lines to <code>indra\newview\skins\default\xui\en\mime_types.xml</code>. This is similar to [[#Running the example plugin in the viewer|the way you modified <code>mime_types.xml</code> for the example plugin]].<br />
<xml><scheme name="helloworld"><br />
<label name="helloworld_label"><br />
Hello World Plugin<br />
</label><br />
<widgettype><br />
image<br />
</widgettype><br />
<impl><br />
media_plugin_helloworld<br />
</impl><br />
</scheme></xml><br />
</li><br />
<li>Add your plugin to the list of dependencies for the Viewer in <code>indra\newview\CMakeList.txt</code>:<br />
<ul><br />
<li>Search for ''every instance'' of "media_plugin_example" in an <code>add_dependencies()</code> line and add "media_plugin_helloworld". Example:<br />
<p>'''Old''': <code>add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit media_plugin_example)</code></p><br />
<p>'''New''': <code>add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit media_plugin_example media_plugin_helloworld)</code></p><br />
</li><br />
<li> Search for "media_plugin_example" in a <code>get_target_property()</code> line. Copy and paste the entire <code>get_target_property()</code> section, replacing "example" with "helloworld". The new section will look like this:<br />
<pre> get_target_property(BUILT_HELLOWORLD_PLUGIN media_plugin_helloworld LOCATION)<br />
add_custom_command(<br />
TARGET ${VIEWER_BINARY_NAME} POST_BUILD<br />
COMMAND ${CMAKE_COMMAND}<br />
ARGS<br />
-E<br />
copy_if_different<br />
${BUILT_HELLOWORLD_PLUGIN}<br />
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin<br />
COMMENT "Copying Hello World Plugin to the runtime folder."<br />
)<br />
</pre><br />
</li><br />
</ul><br />
</li><br />
</ol><br />
</li><br />
<li>[[#Downloading and building the Viewer| Re-build the Viewer]].<br />
<li>Start the Viewer, choose Help, then in the media browser window that opens, enter the URL of your media, <code>helloworld://foo</code>. If desired, you can also log into Second Life add your media as [[Parcel media]].<br />
</ol><br />
<br />
Congratulations! You have successfully created your first simple plugin.<br />
<br />
== How the Hello World plugin works ==<br />
The Hello World plugin implements the basic functions that any media rendering plugin needs to work correctly.<br />
<br />
=== Messages ===<br />
A media rendering plugin uses [[Media Plugin System Messages | messages]] to communicate with the [[Media Rendering Plugin Framework Technical Overview#SLPLugin : Plugin loader shell | Plugin Loader Shell]], which mediates requests between the plugin and the Viewer. <br />
<br />
==== Initialization ====<br />
When a plugin is loaded, the plugin and Plugin Loader Shell exchange specific messages to initialize the plugin. While a plugin is running, the Plugin Loader Shell uses messages to notify it of mouse and keyboard input.<br />
<br />
In the Hello World plugin, <code>init_media_plugin()</code> creates the message interface between the plugin and Plugin Loader Shell:<br />
<cpp><br />
int init_media_plugin( LLPluginInstance::sendMessageFunction host_send_func,<br />
void* host_user_data,<br />
LLPluginInstance::sendMessageFunction *plugin_send_func,<br />
void **plugin_user_data )<br />
{<br />
MediaPluginHelloworld* self = new MediaPluginHelloworld( host_send_func, host_user_data );<br />
*plugin_send_func = MediaPluginHelloworld::staticReceiveMessage;<br />
*plugin_user_data = ( void* )self;<br />
<br />
return 0;<br />
}<br />
</cpp><br />
<br />
To initialize the plugin, the Plugin Loader Shell sends an "init" message to the Hello World plugin. The plugin responds with messages that contain information about the plugin version ("init_response") and the object's texture parameters ("texture_params"):<br />
<cpp><br />
if ( message_name == "init" )<br />
{<br />
LLPluginMessage message( "base", "init_response" );<br />
LLSD versions = LLSD::emptyMap();<br />
versions[ LLPLUGIN_MESSAGE_CLASS_BASE ] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION;<br />
versions[ LLPLUGIN_MESSAGE_CLASS_MEDIA ] = LLPLUGIN_MESSAGE_CLASS_MEDIA_VERSION;<br />
versions[ LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER ] = LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER_VERSION;<br />
message.setValueLLSD( "versions", versions );<br />
<br />
std::string plugin_version = "Hello World media plugin, Hello World Version 1.0.0.0";<br />
message.setValue( "plugin_version", plugin_version );<br />
sendMessage( message );<br />
<br />
// Plugin gets to decide the texture parameters to use.<br />
message.setMessage( LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params" );<br />
message.setValueS32( "default_width", mWidth ); // width in pixels<br />
message.setValueS32( "default_height", mHeight ); // height in pixels<br />
message.setValueS32( "depth", mDepth ); // pixel size in bytes<br />
message.setValueU32( "internalformat", GL_RGBA );<br />
message.setValueU32( "format", GL_RGBA );<br />
message.setValueU32( "type", GL_UNSIGNED_BYTE );<br />
message.setValueBoolean( "coords_opengl", false );<br />
sendMessage( message );<br />
}<br />
</cpp><br />
<br />
==== Idle messages ====<br />
The Plugin Loader Shell also sends frequent "idle" messages to the plugin. The "idle" messages indicate that time is passing, so the plugin can update its state.<br />
<br />
When the Hello World plugin receives an "idle" message, it updates the color and position of the square in the image by calling <code>update()</code>:<br />
<cpp><br />
if ( message_name == "idle" )<br />
{<br />
// no response is necessary here.<br />
double time = message_in.getValueReal( "time" );<br />
<br />
std::cout << "MediaPluginHelloworld::receiveMessage(): idle"<<std::endl;<br />
// Convert time to milliseconds for update()<br />
update( time );<br />
}<br />
</cpp><br />
==== Keyboard input ====<br />
If keyboard input occurs, the Plugin Loader Shell sends a <code>key_event</code> message to the plugin. The plugin can see what key was pressed and act accordingly.<br />
<br />
In the Hello World plugin, pressing the space key causes the plugin to update:<br />
<cpp><br />
if ( message_name == "key_event" )<br />
{<br />
std::string event = message_in.getValue( "event" );<br />
S32 key = message_in.getValueS32( "key" );<br />
std::string modifiers = message_in.getValue( "modifiers" );<br />
<br />
if ( event == "down" )<br />
{<br />
if ( key == ' ')<br />
{<br />
mLastUpdateTime = 0;<br />
update( 0.0f );<br />
};<br />
};<br />
}<br />
</cpp><br />
<br />
==== Mouse input ====<br />
If the Hello World plugin receives a "left mouse button down" message, it detects the location of the mouse cursor and creates a white dot by writing to shared memory:<br />
<cpp><br />
if ( message_name == "mouse_event" )<br />
{<br />
std::string event = message_in.getValue( "event" );<br />
S32 button = message_in.getValueS32( "button" );<br />
<br />
// left mouse button<br />
if ( button == 0 )<br />
{<br />
int mouse_x = message_in.getValueS32( "x" );<br />
int mouse_y = message_in.getValueS32( "y" );<br />
std::string modifiers = message_in.getValue( "modifiers" );<br />
<br />
if ( event == "move" )<br />
{<br />
if ( mMouseButtonDown )<br />
write_pixel( mouse_x, mouse_y, 0xFF, 0xFF, 0xFF);<br />
}<br />
else<br />
if ( event == "down" )<br />
{<br />
mMouseButtonDown = true;<br />
}<br />
else<br />
if ( event == "up" )<br />
{<br />
mMouseButtonDown = false;<br />
}<br />
else<br />
if ( event == "double_click" )<br />
{<br />
};<br />
};<br />
}<br />
</cpp><br />
<br />
=== Shared memory ===<br />
The shared memory represents the area displayed by the Viewer. In response to the "texture_params" message, the Plugin Loader Shell sends a "shm_added" message with a pointer to the shared memory that the plugin will use to transfer display data:<br />
<cpp><br />
if ( message_name == "shm_added" )<br />
{<br />
SharedSegmentInfo info;<br />
info.mAddress = message_in.getValuePointer( "address" );<br />
info.mSize = ( size_t )message_in.getValueS32( "size" );<br />
std::string name = message_in.getValue( "name" );<br />
<br />
mSharedSegments.insert( SharedSegmentMap::value_type( name, info ) );<br />
<br />
}<br />
</cpp><br />
<br />
=== Display ===<br />
The Hello World plugin writes an image to shared memory using RGB color values. The Viewer reads the image from shared memory and displays it. In the Hello World plugin, the <code>update()</code> function writes the image to shared memory:<br />
<cpp><br />
if ( time( NULL ) > mLastUpdateTime + 1 )<br />
{<br />
// Draw black background<br />
int bkgnd_r = 0;<br />
int bkgnd_g = 0;<br />
int bkgnd_b = 0;<br />
for (int bkgnd_pix = 0; bkgnd_pix < getSurfaceSize(); bkgnd_pix = bkgnd_pix+mDepth)<br />
{<br />
mBackgroundPixels [bkgnd_pix + 0] = bkgnd_r;<br />
mBackgroundPixels [bkgnd_pix + 1] = bkgnd_g;<br />
mBackgroundPixels [bkgnd_pix + 2] = bkgnd_b;<br />
}<br />
<br />
// Set the color of the moving square<br />
squareR = (squareR+1) % (0xFF-0x20) + 0x20;<br />
squareG = (squareG+7) % (0xFF-0x20) + 0x20;<br />
squareB = (squareB+7) % (0xFF-0x20) + 0x20;<br />
<br />
time( &mLastUpdateTime );<br />
<br />
}<br />
memcpy( mPixels, mBackgroundPixels, getSurfaceSize() );<br />
<br />
<br />
// Black out last position of square<br />
for ( int xcnt = 0; xcnt < squareWidth; ++xcnt )<br />
{<br />
for ( int ycnt = 0; ycnt < squareHeight; ++ycnt )<br />
{<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 0 ] = 0;<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 1 ] = 0;<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 2 ] = 0;<br />
}<br />
}<br />
<br />
// Calculate the new position of the moving square. Note: (0,0) is the top left corner.<br />
//<br />
if (rand() % 400 == 0) // only change direction once in a while<br />
{<br />
randomizeDirection();<br />
}<br />
<br />
if ((squareXpos + squareXinc < 0) || (squareXpos + squareXinc >= mWidth - squareWidth))<br />
squareXinc = -squareXinc;<br />
<br />
if ((squareYpos + squareYinc < 0) || (squareYpos + squareYinc >= mHeight - squareHeight))<br />
squareYinc = -squareYinc;<br />
<br />
squareXpos += squareXinc;<br />
squareYpos += squareYinc;<br />
<br />
// Draw square<br />
for ( int xcnt = 0; xcnt < squareWidth; ++xcnt )<br />
{<br />
for ( int ycnt = 0; ycnt < squareHeight; ++ycnt )<br />
{<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 0 ] = squareR;<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 1 ] = squareG;<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 2 ] = squareB;<br />
}<br />
}<br />
</cpp><br />
<br />
== Troubleshooting tips ==<br />
=== Setting breakpoints in plugin code ===<br />
A plugin runs as a separate process from the Viewer, so breakpoints can only be set after the Viewer is running and the plugin has also started running.<br />
<br />
To set breakpoints in plugin code:<br />
# In Visual Studio, with the project set to '''secondlife-bin''', select '''Debug->Start Without Debugging'''.<br />
# Log into Second Life and go to the object using your media rendering plugin.<br />
# Select '''Debug->Attach To Process''', and select the '''SLPlugin.exe''' items in the list.<br />
You can now set breakpoints in your plugin code.</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Linden_Lab_Official:Getting_Started_Developing_Media_Rendering_Plugins&diff=1083113Linden Lab Official:Getting Started Developing Media Rendering Plugins2010-10-27T18:47:06Z<p>Jenn Linden: /* Running the example plugin in the Viewer */</p>
<hr />
<div>{{Media Plugin Nav}}<br />
<br />
== Introduction ==<br />
<br />
The Media Rendering Plugin system enables you to create your own media rendering plugins for the Second Life Viewer. Currently, you must download the [[Snowglobe]] source code and build the Viewer to do so; Future releases will enable you to build plugins without building the entire Viewer.<br />
<br />
Media rendering plugins can display content:<br />
* Via [[Parcel media|parcel media]].<br />
* In the Viewer's [Parcel_media#The_Media_Browser_Window media browser] (the built-in web browser window).<br />
* In the [[Plugin Test App: LLMediaPluginTest|Plugin Test App]] provided with Viewer source code (for use during development only).<br />
<br />
== Setting up your environment ==<br />
Before creating a new plugin, set up your development environment and make sure the necessary tools are in place.<br />
<br />
===System requirements and tools===<br />
* Operating System: Windows XP or Vista<br />
* Visual Studio 2005 (Warning: Visual Studio 2008 may not work)<br />
''This guide currently assumes you are using Visual Studio. Some of the specific instructions will not apply to Mac or Linux users.<br />
''<br />
=== Downloading and building the Viewer ===<br />
To download and build the Viewer:<br />
* Follow the [[Get_source_and_compile |Snowglobe instructions for getting and compiling the source code]]<br />
<br />
=== Checking that your environment was built correctly ===<br />
To check that your environment was built correctly, run the example plugin both on the [[Plugin Test App: LLMediaPluginTest|Plugin Test App]] and inworld.<br />
<br />
==== The example plugin: media_plugin_example ====<br />
The source code includes a simple example plugin: <code>indra\media_plugins\example\media_plugin_example.cpp</code>. It displays a checkerboard pattern background overlaid with bouncing squares, with automatically changing colors. Keyboard input causes the checkerboard pattern to change. You can also draw lines by holding the left mouse button down.<br />
<br />
==== Running the example plugin in the Plugin Test App ====<br />
[[Plugin Test App: LLMediaPluginTest#Opening a bookmark in a panel|Open the "(EX) Example Plugin" bookmark in a panel]] using [[Plugin Test App: LLMediaPluginTest|the Plugin Test App]].<br />
<br />
==== Running the example plugin in the Viewer ====<br />
<br />
<ol><br />
<li> Add the example plugin type to the Viewer by adding the following lines to <code>indra\newview\skins\default\xui\en\mime_types.xml</code>:<br />
<xml><scheme name="example"><br />
<label name="example_label"><br />
Example Plugin<br />
</label><br />
<widgettype><br />
image<br />
</widgettype><br />
<impl><br />
media_plugin_example<br />
</impl><br />
</scheme></xml><br />
</li><br />
<li>Add the example plugin to an object inworld: Using <code>example://foo</code> as the URL, follow the [[Adding Shared Media to an object|instructions for adding media to an object]] to use the example plugin inworld. You will see the example plugin animation displayed on the face of the object you selected.<br />
</li><br />
</ol><br />
<br />
== Creating your own Hello World plugin ==<br />
To create your own Hello World plugin, you need to both create the plugin C++ file and edit some supporting files.<br />
<br />
=== Creating and editing the new plugin files ===<br />
To create and edit the new Hello World plugin files:<br />
# Create a new directory: <code>indra\media_plugins\helloworld</code>.<br />
# In the new <code>helloworld</code> directory, create a new file called <code>media_plugin_helloworld.cpp</code> by copying and pasting [[Hello World plugin: basic plugin code |this basic plugin code]]. This code implements the basic functions that are necessary in any plugin.<br />
# Find the "TODO" comment in the <code>MediaPluginHelloworld::update()</code> function, and replace it with [[Hello World plugin: update()|the code snippet here]]. This code displays a moving square with changing color on a black background.<br />
# In the <code>helloworld</code> directory, create another new file called CMakeLists.txt by copying and pasting [[Hello World plugin: CMakeLists.txt|everything on this page]].<br />
# Add the following line to the bottom of <code>indra\media_plugins\CMakeLists.txt</code>:<br />
#: <code>add_subdirectory(helloworld) </code><br />
# Make sure the code compiles:<br />
## In the <code>indra\</code> directory, run <code>develop.py</code>.<br />
## In the Visual Studio Solution Explorer pane, right-click <code>media_plugin_helloworld</code> and '''Build'''.<br />
<br />
=== Testing your new plugin before trying it in the Viewer ===<br />
Use the [[Plugin Test App: LLMediaPluginTest|Plugin Test App]] to test your new plugin before trying it in the Viewer:<br />
# [[Plugin Test App: LLMediaPluginTest#Adding a new plugin type|Add your new plugin]] to the Plugin Test App. ''Note: You can use the example code as-is.''<br />
# [[Plugin Test App: LLMediaPluginTest|Test your new plugin]] using the Plugin Test App.<br />
<br />
=== Using your new plugin inworld ===<br />
To use your new plugin inworld:<br />
<ol><br />
<li> Add your new plugin to the Viewer:<br />
<ol><br />
<li>Add the following lines to <code>indra\newview\skins\default\xui\en\mime_types.xml</code>. This is similar to [[#Running the example plugin in the viewer|the way you modified <code>mime_types.xml</code> for the example plugin]].<br />
<xml><scheme name="helloworld"><br />
<label name="helloworld_label"><br />
Hello World Plugin<br />
</label><br />
<widgettype><br />
image<br />
</widgettype><br />
<impl><br />
media_plugin_helloworld<br />
</impl><br />
</scheme></xml><br />
</li><br />
<li>Add your plugin to the list of dependencies for the Viewer in <code>indra\newview\CMakeList.txt</code>:<br />
<ul><br />
<li>Search for ''every instance'' of "media_plugin_example" in an <code>add_dependencies()</code> line and add "media_plugin_helloworld". Example:<br />
<p>'''Old''': <code>add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit media_plugin_example)</code></p><br />
<p>'''New''': <code>add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit media_plugin_example media_plugin_helloworld)</code></p><br />
</li><br />
<li> Search for "media_plugin_example" in a <code>get_target_property()</code> line. Copy and paste the entire <code>get_target_property()</code> section, replacing "example" with "helloworld". The new section will look like this:<br />
<pre> get_target_property(BUILT_HELLOWORLD_PLUGIN media_plugin_helloworld LOCATION)<br />
add_custom_command(<br />
TARGET ${VIEWER_BINARY_NAME} POST_BUILD<br />
COMMAND ${CMAKE_COMMAND}<br />
ARGS<br />
-E<br />
copy_if_different<br />
${BUILT_HELLOWORLD_PLUGIN}<br />
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin<br />
COMMENT "Copying Hello World Plugin to the runtime folder."<br />
)<br />
</pre><br />
</li><br />
</ul><br />
</li><br />
</ol><br />
</li><br />
<li>[[#Downloading and building the Viewer| Re-build the Viewer]].<br />
<li>Start the Viewer, choose Help, then in the media browser window that opens, enter the URL of your media, <code>helloworld://foo</code>. If desired, you can also log into Second Life add your media as [[Parcel media]].<br />
</ol><br />
<br />
Congratulations! You have successfully created your first simple plugin.<br />
<br />
== How the Hello World plugin works ==<br />
The Hello World plugin implements the basic functions that any media rendering plugin needs to work correctly.<br />
<br />
=== Messages ===<br />
A media rendering plugin uses [[Media Plugin System Messages | messages]] to communicate with the [[Media Rendering Plugin Framework Technical Overview#SLPLugin : Plugin loader shell | Plugin Loader Shell]], which mediates requests between the plugin and the Viewer. <br />
<br />
==== Initialization ====<br />
When a plugin is loaded, the plugin and Plugin Loader Shell exchange specific messages to initialize the plugin. While a plugin is running, the Plugin Loader Shell uses messages to notify it of mouse and keyboard input.<br />
<br />
In the Hello World plugin, <code>init_media_plugin()</code> creates the message interface between the plugin and Plugin Loader Shell:<br />
<cpp><br />
int init_media_plugin( LLPluginInstance::sendMessageFunction host_send_func,<br />
void* host_user_data,<br />
LLPluginInstance::sendMessageFunction *plugin_send_func,<br />
void **plugin_user_data )<br />
{<br />
MediaPluginHelloworld* self = new MediaPluginHelloworld( host_send_func, host_user_data );<br />
*plugin_send_func = MediaPluginHelloworld::staticReceiveMessage;<br />
*plugin_user_data = ( void* )self;<br />
<br />
return 0;<br />
}<br />
</cpp><br />
<br />
To initialize the plugin, the Plugin Loader Shell sends an "init" message to the Hello World plugin. The plugin responds with messages that contain information about the plugin version ("init_response") and the object's texture parameters ("texture_params"):<br />
<cpp><br />
if ( message_name == "init" )<br />
{<br />
LLPluginMessage message( "base", "init_response" );<br />
LLSD versions = LLSD::emptyMap();<br />
versions[ LLPLUGIN_MESSAGE_CLASS_BASE ] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION;<br />
versions[ LLPLUGIN_MESSAGE_CLASS_MEDIA ] = LLPLUGIN_MESSAGE_CLASS_MEDIA_VERSION;<br />
versions[ LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER ] = LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER_VERSION;<br />
message.setValueLLSD( "versions", versions );<br />
<br />
std::string plugin_version = "Hello World media plugin, Hello World Version 1.0.0.0";<br />
message.setValue( "plugin_version", plugin_version );<br />
sendMessage( message );<br />
<br />
// Plugin gets to decide the texture parameters to use.<br />
message.setMessage( LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params" );<br />
message.setValueS32( "default_width", mWidth ); // width in pixels<br />
message.setValueS32( "default_height", mHeight ); // height in pixels<br />
message.setValueS32( "depth", mDepth ); // pixel size in bytes<br />
message.setValueU32( "internalformat", GL_RGBA );<br />
message.setValueU32( "format", GL_RGBA );<br />
message.setValueU32( "type", GL_UNSIGNED_BYTE );<br />
message.setValueBoolean( "coords_opengl", false );<br />
sendMessage( message );<br />
}<br />
</cpp><br />
<br />
==== Idle messages ====<br />
The Plugin Loader Shell also sends frequent "idle" messages to the plugin. The "idle" messages indicate that time is passing, so the plugin can update its state.<br />
<br />
When the Hello World plugin receives an "idle" message, it updates the color and position of the square in the image by calling <code>update()</code>:<br />
<cpp><br />
if ( message_name == "idle" )<br />
{<br />
// no response is necessary here.<br />
double time = message_in.getValueReal( "time" );<br />
<br />
std::cout << "MediaPluginHelloworld::receiveMessage(): idle"<<std::endl;<br />
// Convert time to milliseconds for update()<br />
update( time );<br />
}<br />
</cpp><br />
==== Keyboard input ====<br />
If keyboard input occurs, the Plugin Loader Shell sends a <code>key_event</code> message to the plugin. The plugin can see what key was pressed and act accordingly.<br />
<br />
In the Hello World plugin, pressing the space key causes the plugin to update:<br />
<cpp><br />
if ( message_name == "key_event" )<br />
{<br />
std::string event = message_in.getValue( "event" );<br />
S32 key = message_in.getValueS32( "key" );<br />
std::string modifiers = message_in.getValue( "modifiers" );<br />
<br />
if ( event == "down" )<br />
{<br />
if ( key == ' ')<br />
{<br />
mLastUpdateTime = 0;<br />
update( 0.0f );<br />
};<br />
};<br />
}<br />
</cpp><br />
<br />
==== Mouse input ====<br />
If the Hello World plugin receives a "left mouse button down" message, it detects the location of the mouse cursor and creates a white dot by writing to shared memory:<br />
<cpp><br />
if ( message_name == "mouse_event" )<br />
{<br />
std::string event = message_in.getValue( "event" );<br />
S32 button = message_in.getValueS32( "button" );<br />
<br />
// left mouse button<br />
if ( button == 0 )<br />
{<br />
int mouse_x = message_in.getValueS32( "x" );<br />
int mouse_y = message_in.getValueS32( "y" );<br />
std::string modifiers = message_in.getValue( "modifiers" );<br />
<br />
if ( event == "move" )<br />
{<br />
if ( mMouseButtonDown )<br />
write_pixel( mouse_x, mouse_y, 0xFF, 0xFF, 0xFF);<br />
}<br />
else<br />
if ( event == "down" )<br />
{<br />
mMouseButtonDown = true;<br />
}<br />
else<br />
if ( event == "up" )<br />
{<br />
mMouseButtonDown = false;<br />
}<br />
else<br />
if ( event == "double_click" )<br />
{<br />
};<br />
};<br />
}<br />
</cpp><br />
<br />
=== Shared memory ===<br />
The shared memory represents the area displayed by the Viewer. In response to the "texture_params" message, the Plugin Loader Shell sends a "shm_added" message with a pointer to the shared memory that the plugin will use to transfer display data:<br />
<cpp><br />
if ( message_name == "shm_added" )<br />
{<br />
SharedSegmentInfo info;<br />
info.mAddress = message_in.getValuePointer( "address" );<br />
info.mSize = ( size_t )message_in.getValueS32( "size" );<br />
std::string name = message_in.getValue( "name" );<br />
<br />
mSharedSegments.insert( SharedSegmentMap::value_type( name, info ) );<br />
<br />
}<br />
</cpp><br />
<br />
=== Display ===<br />
The Hello World plugin writes an image to shared memory using RGB color values. The Viewer reads the image from shared memory and displays it. In the Hello World plugin, the <code>update()</code> function writes the image to shared memory:<br />
<cpp><br />
if ( time( NULL ) > mLastUpdateTime + 1 )<br />
{<br />
// Draw black background<br />
int bkgnd_r = 0;<br />
int bkgnd_g = 0;<br />
int bkgnd_b = 0;<br />
for (int bkgnd_pix = 0; bkgnd_pix < getSurfaceSize(); bkgnd_pix = bkgnd_pix+mDepth)<br />
{<br />
mBackgroundPixels [bkgnd_pix + 0] = bkgnd_r;<br />
mBackgroundPixels [bkgnd_pix + 1] = bkgnd_g;<br />
mBackgroundPixels [bkgnd_pix + 2] = bkgnd_b;<br />
}<br />
<br />
// Set the color of the moving square<br />
squareR = (squareR+1) % (0xFF-0x20) + 0x20;<br />
squareG = (squareG+7) % (0xFF-0x20) + 0x20;<br />
squareB = (squareB+7) % (0xFF-0x20) + 0x20;<br />
<br />
time( &mLastUpdateTime );<br />
<br />
}<br />
memcpy( mPixels, mBackgroundPixels, getSurfaceSize() );<br />
<br />
<br />
// Black out last position of square<br />
for ( int xcnt = 0; xcnt < squareWidth; ++xcnt )<br />
{<br />
for ( int ycnt = 0; ycnt < squareHeight; ++ycnt )<br />
{<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 0 ] = 0;<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 1 ] = 0;<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 2 ] = 0;<br />
}<br />
}<br />
<br />
// Calculate the new position of the moving square. Note: (0,0) is the top left corner.<br />
//<br />
if (rand() % 400 == 0) // only change direction once in a while<br />
{<br />
randomizeDirection();<br />
}<br />
<br />
if ((squareXpos + squareXinc < 0) || (squareXpos + squareXinc >= mWidth - squareWidth))<br />
squareXinc = -squareXinc;<br />
<br />
if ((squareYpos + squareYinc < 0) || (squareYpos + squareYinc >= mHeight - squareHeight))<br />
squareYinc = -squareYinc;<br />
<br />
squareXpos += squareXinc;<br />
squareYpos += squareYinc;<br />
<br />
// Draw square<br />
for ( int xcnt = 0; xcnt < squareWidth; ++xcnt )<br />
{<br />
for ( int ycnt = 0; ycnt < squareHeight; ++ycnt )<br />
{<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 0 ] = squareR;<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 1 ] = squareG;<br />
mPixels [ (squareXpos + xcnt)*mDepth + (squareYpos + ycnt)*mWidth*mDepth + 2 ] = squareB;<br />
}<br />
}<br />
</cpp><br />
<br />
== Troubleshooting tips ==<br />
=== Setting breakpoints in plugin code ===<br />
A plugin runs as a separate process from the Viewer, so breakpoints can only be set after the Viewer is running and the plugin has also started running.<br />
<br />
To set breakpoints in plugin code:<br />
# In Visual Studio, with the project set to '''secondlife-bin''', select '''Debug->Start Without Debugging'''.<br />
# Log into Second Life and go to the object using your media rendering plugin.<br />
# Select '''Debug->Attach To Process''', and select the '''SLPlugin.exe''' items in the list.<br />
You can now set breakpoints in your plugin code.</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Linden_Lab_Official:Plugin_Test_App:_LLMediaPluginTest&diff=1082442Linden Lab Official:Plugin Test App: LLMediaPluginTest2010-10-27T18:24:26Z<p>Jenn Linden: </p>
<hr />
<div>{{Media Plugin Nav}}<br />
<br />
== What is the Plugin Test App? ==<br />
[[Image:LLMediaPluginTest_opening_screen.png|480px|right]]<br />
The Second Life Viewer source code includes a media plugin test application called LLMediaPluginTest, or the Plugin Test App. This application acts as as a host for any plugin, so you can use it to debug plugins without having to launch the viewer.<br />
<br />
Building the Viewer automatically builds the Plugin Test App. You can also [[#Building the Plugin Test App|build it independently]].<br />
<br />
<!--A downloadable executable of the Plugin Test App will be needed in the future when developers don't need to build the viewer, or don't need to have all the Viewer code.--><br />
=== Panels and bookmarks ===<br />
<br />
The Plugin Test App enables you to run bookmarks within panels.<br />
<br />
''Panels'' are small windows that can run a plugin within the Plugin Test App. You can add, remove, resize, and rotate panels.<br />
<br />
A ''bookmark'' is a URL with an associated plugin, that you can add to a panel. The Plugin Test App contains a default list of bookmarks that use the WebKit and QuickTime plugins.<br />
<br />
=== Demo video ===<br />
[http://wiki.secondlife.com/wiki/User:Aimee_Trescothick Aimee Trescothick] created a [http://www.youtube.com/watch?v=QH4G9F6zHEw demo video of the Plugin Test App on YouTube].<br />
<br clear="all"/><br />
<br />
== Debugging a plugin with the Plugin Test App ==<br />
To test a new plugin with the Plugin Test App:<br />
# [[#Building the Plugin Test App|Build the Plugin Test App]].<br />
# [[#Adding a new plugin type|Add your new plugin type]] to the Plugin Test App.<br />
# Add breakpoints in your code, and use the [[#Using the debug output window|debug output window]] to monitor the plugin's activity while you [[#Interacting with the plugin|interact with it]].<br />
<br />
=== Building the Plugin Test App ===<br />
<br />
To build the Plugin Test App without building the Viewer:<br />
# In Visual Studio, open the Solution Explorer (View->Solution Explorer). <br />
# Right-click on <code>llmediaplugintest</code> and select '''Build'''.<br />
<br />
The executable is located at <code>indra\build-vc80\test_apps\llplugintest\RelWithDebInfo\llmediaplugintest.exe</code>. <br />
<br />
'''Note:''' on Mac OS, it's easier to launch this application from its own XCode project located in <code>indra/build-darwin-i386/test_apps/llplugintest</code>.<br />
<br />
=== Adding a new plugin type ===<br />
<br />
'''Note: This section assumes you have already [[Getting_Started_Developing_Media_Rendering_Plugins|built a new plugin]] to add.''' <br />
<br />
To add a new plugin type to the Plugin Test App, modify <code>indra\test_apps\llplugintest\llmediaplugintest.cpp</code> and <code>indra\test_apps\llplugintest\CMakeLists.txt</code>. In the examples below, replace "helloworld" with your MIME type and "media_plugin_helloworld" with the name of your DLL.<br />
<ol><br />
<li>Modify <code>indra\test_apps\llplugintest\llmediaplugintest.cpp</code>:<br />
<ol><br />
<li> In <code>LLMediaPluginTest::pluginNameFromMimeType()</code>, search for the if-statement containing "example/example" and add the new plugin type beneath it:<br />
<cpp><br />
else<br />
if ( mime_type == "helloworld/helloworld" )<br />
plugin_name = "media_plugin_helloworld.dll";<br />
</cpp><br />
</li><br />
<li>In <code>LLMediaPluginTest::mimeTypeFromUrl()</code>, search for the if-statement containing "example/example" and add the new plugin type beneath it:<br />
<cpp><br />
else<br />
if ( url.find( "helloworld://" ) != std::string::npos ) // Hello World plugin<br />
mime_type = "helloworld/helloworld";<br />
</cpp><br />
</li><br />
<li>In <code>LLMediaPluginTest::getRandomMediaSize()</code>, search for "example/example". Add the new <code>helloworld/helloworld</code> plugin type:<br />
<cpp><br />
if ( mime_type == "text/html" || mime_type == "example/example" || mime_type == "helloworld/helloworld" )<br />
</cpp><br />
</li><br />
</ol><br />
</li><br />
<li>In <code>indra\test_apps\llplugintest\CMakeLists.txt</code>, search for "media_plugin_example":<br />
<ol><br />
<li>In the add_dependencies() section, below <code>media_plugin_example</code>, add the new plugin type:<br />
<pre><br />
media_plugin_helloworld<br />
</pre><br />
</li><br />
<li>Below the <code>get_target_property()</code> and <code>add_custom_command()</code> section for <code>media_plugin_example</code>, add:<br />
<pre><br />
get_target_property(BUILT_HELLOWORLD_PLUGIN media_plugin_helloworld LOCATION)<br />
add_custom_command(TARGET llmediaplugintest POST_BUILD<br />
COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_HELLOWORLD_PLUGIN} ${PLUGINS_DESTINATION_DIR}<br />
DEPENDS ${BUILT_HELLOWORLD_PLUGIN}<br />
)<br />
</pre> <br />
</ol><br />
</li><br />
<li> In <code>indra\</code>, run <code>develop.py</code>.<br />
<li> [[#Building the Plugin Test App|Re-build the Plugin Test App]].<br />
</ol><br />
<br />
=== Adding a new bookmark ===<br />
<br />
To add a new bookmark:<br />
<ol><li>Add a line in <code>indra\test_apps\llplugintest\bookmarks.txt</code> with the following format:<br />
: Description of the link, URL<br />
For example, add the following to create a bookmark for the example plugin:<br />
: <code> Example - this is the example plugin, example://foo </code><br />
</li><br />
<li> Save <code>bookmarks.txt</code>.<br />
<li> [[#Building the Plugin Test App|Re-build the Plugin Test App]].<br />
</ol><br />
<br />
=== Using the debug output window ===<br />
Launching the Plugin Test App opens an output window separate from the main application window. This output window displays debugging output from the code you're running. If you add print statements in the plugin code, you can monitor what the plugin is doing.<br />
<br />
=== Interacting with the plugin ===<br />
To fully exercise the plugin code, run a plugin in single or multiple panels in the Plugin Test App. You can manipulate a panel in the same ways as an object can be manipulated inworld.<br />
<br />
==== Adding a panel ====<br />
To add a panel, click the '''Add panel''' button.<br />
<br />
==== Opening a bookmark in a panel ====<br />
To open a bookmark in a panel, click the panel to select it, then select a bookmark from the bookmarks list.<br />
<br />
''Note:'' To add a bookmark to the bookmark list, follow the [[#Adding a new bookmark|instructions for adding a new bookmark]].<br />
<br />
==== Removing a panel ====<br />
To remove a panel, click the panel to select it, then click the '''Rem panel''' button.<br />
<br />
==== Rotating, translating, or scaling the panel ====<br />
<br />
To manipulate a panel:<br />
# Click '''Rotation''', '''Translate''', or '''Scale''' and hold the mouse button down.<br />
# To change the view angle, position, or size of the panel, move the mouse while continuing to hold the mouse button down.<br />
<br />
==== Crashing the plugin ====<br />
<br />
To simulate crashing the plugin and ensure your code catches all corresponding errors, click '''Crash plugin'''.<br />
<br />
==== Hanging the plugin ====<br />
<br />
To simulate a hung plugin, click '''Hang plugin'''. This button simply stops the plugin from updating.</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Microsoft_Windows_Builds&diff=1080883Microsoft Windows Builds2010-10-27T00:40:54Z<p>Jenn Linden: /* Getting other development tools */</p>
<hr />
<div>{{multi-lang}}<br />
{{CompileNav}}<br />
<br />
<br />
On Windows, there are several options on build (compile) environment of the Second Life.<br />
<br />
This page explains how you can compile the Viewer on Microsoft Windows.<br />
<br />
Currently, only 32 bit binary is tested. There seems to be several trials to produce 64 bit Windows <code>.exe</code> of the Viewer. If you did, please write your experience on [[Talk:Microsoft Windows Builds|the discussion page]] (regardless it was successful or not!)<br />
<br />
== Choosing and preparing a compiler ==<br />
<br />
=== Linden-supported compilers ===<br />
<br />
Supported compiler: '''Visual Studio .NET 2005 Professional'''<br />
<br />
You need to setup the compiler and Microsoft Development tools as follows:<br />
* Setup [[Microsoft Visual Studio]]<br />
<br />
=== Community experimental compilers ===<br />
<br />
If you don't have Visual Studio .NET 2005 Professional, you may wish to try one of the following alternatives.<br />
<br />
* Visual C++ 2005 Express ([[Microsoft Visual Studio|instructions]], but the screenshots for [[Compiling the Viewer (MSVS2008)|VS2008]] are worth a glance too)<br />
* Visual Studio 2008 ([[Compiling the Viewer (MSVS2008)|instructions]])<br />
* Visual C++ 2008 Express ([[Compiling the Viewer (MSVS2008)|instructions]])<br />
<br />
{{KBwarning|Boost support with Visual Studio 2008 is problematic as of this writing. Check {{jira|VWR-9541}} before continuing on this path.}}<br />
<br />
{{KBcaution|Make sure you install to paths without spaces in it.}}<br />
<br />
== Getting other development tools ==<br />
<br />
You will need to install the following tools to compile the Viewer:<br />
* '''UniCode NSIS''' ([http://code.google.com/p/unsis/downloads/list download Unicode NSIS])<br />
** This is the package installer used to build <code>Setup.exe</code>. ''<b>Note:</b> NSIS is now hosted by Google Code (linked above). Previously at: http://www.scratchpaper.com/home/downloads.'' --[[User:Jenn Linden|Jenn Linden]] 21:56, 25 October 2010 (UTC)<br />
** NSIS must be installed to the default location for your windows install, i.e. "Program Files"<br />
* '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])<br />
** As of this writing, the latest version is 2.6.2. <b>Note</b>: There are many known issues with CMake 2.6.0 and 2.6.1 in conjunction with building the Second Life Viewer. CMake 2.4.8 is supported for compiling the 1.21 version of the Second Life Viewer, but 2.6.2 is likely to become the new minimum requirement in the near future.<br />
* '''Cygwin''' ([http://www.cygwin.com/ download Cygwin])<br />
** When you run the cygwin setup utility make sure you have selected to install '''patchutils''', '''flex''', '''bison''', and '''zlib-devel'''(all located under "devel"), '''openssh''' (located under "Net"), which are not part of the default install. (If you missed one of these, the easiest thing to do is to re-run the entire installation.)<br />
* '''Python''' (download either [http://www.python.org/download/ Python.org Standard Python] or [http://www.activestate.com/Products/ActivePython/?mp=1 ActivePython]<br />
** 2.4.3 is the minimum required version.<br />
** Use version v2.5 preferably. If you use a version newer than 2.5, you may need to change the <code>Python.cmake</code> file. See the [[Talk:CMake#CMake_and_Python_2.6|CMake discussion]] for details (this change was necessary as of 1.21-r99587 source branch). ) <br />
* '''The Windows Platform SDK'''<br />
** Get the latest version (as of 23 March 2010) here: [http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=c17ba869-9671-4330-a63e-1fd44e0e2505&displayLang=en Windows SDK for Windows Server 2008 and .NET Framework 3.5 SP1] (If you use the web installer, you can choose only the "Development Tools" and cut the download size significantly.) <br />
* '''DirectX SDK'''<br />
** Get the latest version (as of 7 June 2010) here: [http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba DirectX SDK (June 2010)]<br />
<br />
Verify that Cygwin, CMake, and Python are in the windows "PATH".<br />
<br />
'''NOTE:''' '''DO NOT''' use the Cygwin version of CMake or Python. The Build will fail. (CMake specifically excludes the Cygwin version of Python, in the <code>Python.cmake</code> file)<br />
<br />
== Downloading Source Code ==<br />
<br />
{{KBcaution|Make sure you install to paths without spaces in it.}}<br />
<br />
You can download the Viewer source code on the [[source downloads]] page. You can also use a [[version control repository]]. If you're just starting out, it's probably best to get the latest Release version, rather than a Release Candidate, because the Release Candidates get updated quite often. But if you would rather work with the latest code, go for the [[version control repository]] "trunk". Don't forget to also download the artwork and library bundles relevant to the repository branch you're using as explained in [[Version_control_repository#Artwork_and_Library_Bundles|Artwork and Library Bundles]].<br />
<br />
If you're downloading from the [[source downloads]] page, there are three packages to get: the source package, the artwork package, and the library package. In versions 1.20 and earlier, Linden packaged the library binaries in the Libs package. For 1.21 and beyond, the CMake <code>develop.py</code> script now downloads '''most''' of the libraries that were previously in the libs zip file. This saves developers who are tracking trunk from constantly downloading them every update and only downloads updated libraries. As of this writing, there are some pieces packages that still require downloading, so be sure to grab the library and artwork bundles from the [[source downloads]] page.<br />
<br />
'''WARNING:'''<br />
* If the directory path you keep the SL source in has a space in it, the batch file that copies <code>message_template.msg</code> will fail. So, if you unzip or checkout the source tree into, e.g., <code>C:\Projects\Dir with space in name\Etc\linden</code>, it won't work!<br />
* You should also avoid using non-ASCII (national) characters in the paths, although some localized versions of the tool puts some as a default...<br />
* Unzip or checkout your source tree into a directory that has as short full pathname as possible, since long paths cause some unexpected trouble during the build.<br />
<br />
In other words, the easiest way to get this working is to get '''source''', '''artwork''', and '''libs''' from the [[source downloads]] page and unpack them all into the same directory/folder, which ideally would be a folder in (or near) the root directory with a short name like <code>sl_1_21_6</code>.<br />
<br />
== Installing libraries ==<br />
<br />
SL Viewer depends on some third party libraries. Some of them are open source, some others are not.<br />
<br />
=== Open source libraries ===<br />
<br />
As of Viewer version 1.21, all open source libraries are automatically downloaded as part of the build script invoked by <code>develop.py</code>, unless you choose to configure a standalone build.<br />
<br />
=== Proprietary libraries ===<br />
<br />
Linden Lab does not provide proprietary libraries. You will need to follow the instructions here under to acquire and copy them to your source tree.<br />
<br />
It's probably a good idea to build an empty directory tree for those files, copy the relevant proprietary files there and, once done, copy the whole to your source tree (like <code>XCOPY OLIB SL_1_16_0_5 /S</code>). The reason is that these steps are cumbersome and will have to be repeated for each new release (at least if you keep the source for each release in its own folder). If you do not want to do this, you can just as well copy the files directly into the linden source paths.<br />
<br />
rem OLIBS.CMD to build a folder tree for 3rd party libraries and includes<br />
md olibs<br />
md olibs\linden\<br />
md olibs\linden\libraries<br />
md olibs\linden\libraries\include<br />
md olibs\linden\libraries\i686-win32<br />
md olibs\linden\libraries\i686-win32\lib_release<br />
md olibs\linden\libraries\i686-win32\lib_debug<br />
md olibs\linden\libraries\i686-win32\include<br />
md olibs\linden\libraries\i686-win32\include\GL<br />
md olibs\linden\libraries\i686-win32\include\quicktime<br />
md olibs\linden\indra<br />
md olibs\linden\indra\newview<br />
<br />
<br />
==== Fmod ==== <br />
* Download & extract [http://www.fmod.org/files/fmod3/fmodapi375win.zip FMOD3.75 API for Windows]. (later versions, like FMOD Ex, are incompatible).<br />
* Copy <code>fmodapi375win\api\inc\fmod.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\inc\fmod_errors.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\inc\fmoddyn.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\lib\fmodvc.lib</code> to <code>linden\libraries\i686-win32\lib_release</code> and to <code>linden\libraries\i686-win32\lib_debug</code><br />
(If using cmake, copy <code>fmodapi375win\api\lib\fmodvc.lib</code> to <code>linden\libraries\i686-win32\lib\release</code> and to <code>linden\libraries\i686-win32\lib\debug</code>)<br />
* Copy <code>fmodapi375win\api\fmod.dll</code> to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
<br />
Note to Snowstorm users: if you are building using the Mercurial repository [https://bitbucket.org/lindenlab/viewer-development lindenlab/viewer-development], these steps have been simplified and cleaned up. In particular, there's no need to drop anything under <code>linden\indra</code> anymore, all the files are under <code>linden\libraries</code> like for other 3rd party libraries. The <code>fmodvc.lib</code> however needs to be renamed <code>fmod.lib</code>. The new instructions are:<br />
* Download & extract [http://www.fmod.org/files/fmod3/fmodapi375win.zip FMOD3.75 API for Windows]<br />
* From <code>fmodapi375win\api\inc\</code>, copy <code>fmod.h</code> and <code>fmod_errors.h</code> to <code>linden\libraries\include</code><br />
* From <code>fmodapi375win\api\lib</code>, choose the relevant <code>.lib</code> that correspond to your environment (e.g. <code>fmodvc.lib</code> for Visual Studio), rename it <code>fmod.lib</code> and copy it to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
* From <code>fmodapi375win\api</code> copy <code>fmod.dll</code> to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
<br />
==== Quicktime ====<br />
<br />
Currently - as of version 1.21 - CMake requires Quicktime to be installed.<br />
<br />
'''Note:''' This download requires a registration at the Apple Quicktime website and take a bit of time. You can avoid using QuickTime if you want, see [[Compiling_older_Viewers_(1.20_and_earlier_with_MSVS)#QuickTime_removal|this]] for details. Remember that your Viewer '''can't play in-world movies''' if you do so.<br />
* Download & install the [http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wo/11.1.17.2.1.3.3.1.0.1.1.0.3.11.3.3.1#main Quicktime SDK for Windows]<br />
* Copy <code>QuicktimeSDK\Libraries\QTMLClient.lib</code> to <code>linden\libraries\i686-win32\lib_release</code> and to <code>linden\libraries\i686-win32\lib_debug</code>.<br />
<br />
(If using CMake, copy <code>QuicktimeSDK\Libraries\QTMLClient.lib</code> to <code>linden\libraries\i686-win32\lib\release</code> and to <code>linden\libraries\i686-win32\lib\debug</code> instead)<br />
<br />
* Copy the contents of <code>QuicktimeSDK\CIncludes</code> into <code>linden\libraries\i686-win32\include\quicktime</code>.<br />
<br />
== Building the Viewer ==<br />
<br />
At this point, you should be ready to use [[CMake]] to build the Visual Studio solution for the project. <br />
<br />
'''NOTE''': CMake is only supported for Viewer versions 1.21 and beyond. <br />
<br />
Before you first run a build, you'll need to configure things. It is recommended that you use the <code>develop.py</code> script that will create a default configuration for you.<br />
<br />
You must make sure that cmake is registered in the Windows environment or you will get strange errors from <code>develop.py</code>. To ensure everything is correct, right click My Computer -> Properties -> Advanced -> Environment Variables -> Inside System Variables, choose PATH (case insensitive) and click Edit. Now in the value field, go to the end of the value and add a semicolon (<code>;</code>), and then the folder containing the CMake binaries (example: <code>C:\Program Files\CMake 2.8\bin</code>). This might already have been set by the CMake installer.<br />
<br />
From the command line, navigate to the <code>indra</code> folder of your source tree and run:<br />
<br />
python develop.py<br />
<br />
CMake will pick the most recent version of Visual Studio we support. If you want to specify the version of Visual Studio to use.<br />
<br />
* VisualStudio 2005:<br />
<br />
python develop.py -G VC80<br />
<br />
* VisualStudio 2008:<br />
<br />
python develop.py -G VC90<br />
<br />
'''NOTE:''' The above commands will configure a "non-standalone" version of the source code tree. This means that the required third party library packages (as built by Linden Lab) will be downloaded during the CMake process.<br />
<br />
=== Finding your build directory ===<br />
<br />
In the CMake world, we keep source and object files separate. The <code>develop.py</code> script did create and populate a build directory for you. It is in one of the following locations:<br />
* VS 2005: <code>indra/build-vc80</code><br />
* VS 2008: <code>indra/build-vc90</code> <br />
<br />
=== Compiling ===<br />
<br />
To start a build, do one of the following:<br />
* Run <code>python develop.py build</code> from the <code>indra</code> directory.<br />
** '''NOTE FOR VS 2008 USERS:''' This command will not work, since it will only look for VS 2005. Instead, run the command <code>python develop.py -G VC90 build</code><br />
* Load the Visual Studio solution into your IDE. For MSVS VC++:<br />
** Use "File -> Open -> Project/Solution", and open the <code>linden/indra/build-VC80/SecondLife.sln</code> solution file<br />
*** '''NOTE FOR VS 2008 USERS:''' Even though a build-VC90 was created in the above steps, <code>developer.py</code> places the VS 2008 solution/project files in the <code>indra</code> directory. Don't move them to <code>build-VC90</code> - the paths in the project files are relative to the <code>indra</code> directory.<br />
** In the MSVS toolbar, just to the right of the triangular "Start Debugging" arrow, is a text box whose tooltip is "Solution Configurations". Select RelWithDebugInfo.<br />
** If ALL_BUILD is not set as your StartUp Project (the StartUp Project is displayed in bold font), right-click on ALL_BUILD and choose "Set as StartUp Project".<br />
** Right-click on ALL_BUILD and choose "Properties". In "Configuration Properties -> Debugging", find "Working Directory" and navigate to <code>linden\indra\newview</code>.<br />
** (For Snowglobe 1.x) In the Solution Explorer pane, right-click on the project named "prepare" and select Project Only -> Build Only prepare. This downloads and installs precompiled libraries and only needs to be done when the source tree is clean or if libraries in the list included in the source tree get updated. Running this when not required is brief and causes no harm.<br />
** Build -> Build Solution (F7)<br />
** Debug -> "Start Debugging" or "Start without debugging".<br />
** MSVC might not be able to find the executable. If not, point it to <code>linden\indra\build-VC80\newview\relwithdebinfo\secondlife-bin.exe</code>, and try again.<br />
** You may see an error due to not being able to find <code>fmod.dll</code>. If so, find a copy (remember, you copied this in a step above) and copy it into <code>indra\build-VC80\newview\relwithdebinfo</code>. Try again.<br />
** You may see an error due to not finding <code>llkdu.dll</code>. If so, find it in the normal installed version (make sure it's the same version as your source) and copy it into <code>indra\build-VC80\newview\relwithdebinfo</code>. Try again.<br />
** Good luck!<br />
<br />
=== Where's the built Viewer? ===<br />
<br />
On Windows, the built Viewer ought to run from VS2005.<br />
<br />
To run outside MS VS, see Discussion tab:<br />
[[Talk:Microsoft_Windows_Builds#Running_Viewer_outside_of_MS_VC]]<br />
<br />
=== Build instructions for 1.20 and earlier ===<br />
<br />
See [[Compiling older Viewers (1.20 and earlier with MSVS)]] if you'd like to compile a version of the Viewer older than 1.20.<br />
<br />
== What to do if it doesn't work for you ==<br />
<br />
* Ask for help on [[IRC]] ([irc://irc.freenode.net/opensl #opensl on freenode])<br />
* Find someone on the [[OpenSource-Dev|OpenSource-Dev mailing list]]<br />
* Fix it: [[Modifying CMake Files]] (and please, submit a patch!)<br />
<br />
Please also see the (user contributed) instructions at [[User:Michelle2_Zenovka/cmake]]<br />
<br />
[[Category:Compiling viewer]]</div>Jenn Lindenhttps://wiki.secondlife.com/w/index.php?title=Microsoft_Windows_Builds&diff=1080863Microsoft Windows Builds2010-10-27T00:06:40Z<p>Jenn Linden: </p>
<hr />
<div>{{multi-lang}}<br />
{{CompileNav}}<br />
<br />
<br />
On Windows, there are several options on build (compile) environment of the Second Life.<br />
<br />
This page explains how you can compile the Viewer on Microsoft Windows.<br />
<br />
Currently, only 32 bit binary is tested. There seems to be several trials to produce 64 bit Windows <code>.exe</code> of the Viewer. If you did, please write your experience on [[Talk:Microsoft Windows Builds|the discussion page]] (regardless it was successful or not!)<br />
<br />
== Choosing and preparing a compiler ==<br />
<br />
=== Linden-supported compilers ===<br />
<br />
Supported compiler: '''Visual Studio .NET 2005 Professional'''<br />
<br />
You need to setup the compiler and Microsoft Development tools as follows:<br />
* Setup [[Microsoft Visual Studio]]<br />
<br />
=== Community experimental compilers ===<br />
<br />
If you don't have Visual Studio .NET 2005 Professional, you may wish to try one of the following alternatives.<br />
<br />
* Visual C++ 2005 Express ([[Microsoft Visual Studio|instructions]], but the screenshots for [[Compiling the Viewer (MSVS2008)|VS2008]] are worth a glance too)<br />
* Visual Studio 2008 ([[Compiling the Viewer (MSVS2008)|instructions]])<br />
* Visual C++ 2008 Express ([[Compiling the Viewer (MSVS2008)|instructions]])<br />
<br />
{{KBwarning|Boost support with Visual Studio 2008 is problematic as of this writing. Check {{jira|VWR-9541}} before continuing on this path.}}<br />
<br />
{{KBcaution|Make sure you install to paths without spaces in it.}}<br />
<br />
== Getting other development tools ==<br />
<br />
You will need to install the following tools to compile the Viewer:<br />
* '''UniCode NSIS''' ([http://code.google.com/p/unsis/downloads/list download Unicode NSIS])<br />
** This is the package installer used to build <code>Setup.exe</code>. ''<b>Note:</b> NSIS is now hosted by Google Code (linked above). Previously at: http://www.scratchpaper.com/home/downloads.'' --[[User:Jenn Linden|Jenn Linden]] 21:56, 25 October 2010 (UTC)<br />
* '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])<br />
** As of this writing, the latest version is 2.6.2. <b>Note</b>: There are many known issues with CMake 2.6.0 and 2.6.1 in conjunction with building the Second Life Viewer. CMake 2.4.8 is supported for compiling the 1.21 version of the Second Life Viewer, but 2.6.2 is likely to become the new minimum requirement in the near future.<br />
* '''Cygwin''' ([http://www.cygwin.com/ download Cygwin])<br />
** When you run the cygwin setup utility make sure you have selected to install '''patchutils''', '''flex''', '''bison''', and '''zlib-devel'''(all located under "devel"), '''openssh''' (located under "Net"), which are not part of the default install. (If you missed one of these, the easiest thing to do is to re-run the entire installation.)<br />
* '''Python''' (download either [http://www.python.org/download/ Python.org Standard Python] or [http://www.activestate.com/Products/ActivePython/?mp=1 ActivePython]<br />
** 2.4.3 is the minimum required version.<br />
** Use version v2.5 preferably. If you use a version newer than 2.5, you may need to change the <code>Python.cmake</code> file. See the [[Talk:CMake#CMake_and_Python_2.6|CMake discussion]] for details (this change was necessary as of 1.21-r99587 source branch). ) <br />
* '''The Windows Platform SDK'''<br />
** Get the latest version (as of 23 March 2010) here: [http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=c17ba869-9671-4330-a63e-1fd44e0e2505&displayLang=en Windows SDK for Windows Server 2008 and .NET Framework 3.5 SP1] (If you use the web installer, you can choose only the "Development Tools" and cut the download size significantly.) <br />
* '''DirectX SDK'''<br />
** Get the latest version (as of 7 June 2010) here: [http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba DirectX SDK (June 2010)]<br />
<br />
Verify that Cygwin, CMake, and Python are in the windows "PATH".<br />
<br />
'''NOTE:''' '''DO NOT''' use the Cygwin version of CMake or Python. The Build will fail. (CMake specifically excludes the Cygwin version of Python, in the <code>Python.cmake</code> file)<br />
<br />
== Downloading Source Code ==<br />
<br />
{{KBcaution|Make sure you install to paths without spaces in it.}}<br />
<br />
You can download the Viewer source code on the [[source downloads]] page. You can also use a [[version control repository]]. If you're just starting out, it's probably best to get the latest Release version, rather than a Release Candidate, because the Release Candidates get updated quite often. But if you would rather work with the latest code, go for the [[version control repository]] "trunk". Don't forget to also download the artwork and library bundles relevant to the repository branch you're using as explained in [[Version_control_repository#Artwork_and_Library_Bundles|Artwork and Library Bundles]].<br />
<br />
If you're downloading from the [[source downloads]] page, there are three packages to get: the source package, the artwork package, and the library package. In versions 1.20 and earlier, Linden packaged the library binaries in the Libs package. For 1.21 and beyond, the CMake <code>develop.py</code> script now downloads '''most''' of the libraries that were previously in the libs zip file. This saves developers who are tracking trunk from constantly downloading them every update and only downloads updated libraries. As of this writing, there are some pieces packages that still require downloading, so be sure to grab the library and artwork bundles from the [[source downloads]] page.<br />
<br />
'''WARNING:'''<br />
* If the directory path you keep the SL source in has a space in it, the batch file that copies <code>message_template.msg</code> will fail. So, if you unzip or checkout the source tree into, e.g., <code>C:\Projects\Dir with space in name\Etc\linden</code>, it won't work!<br />
* You should also avoid using non-ASCII (national) characters in the paths, although some localized versions of the tool puts some as a default...<br />
* Unzip or checkout your source tree into a directory that has as short full pathname as possible, since long paths cause some unexpected trouble during the build.<br />
<br />
In other words, the easiest way to get this working is to get '''source''', '''artwork''', and '''libs''' from the [[source downloads]] page and unpack them all into the same directory/folder, which ideally would be a folder in (or near) the root directory with a short name like <code>sl_1_21_6</code>.<br />
<br />
== Installing libraries ==<br />
<br />
SL Viewer depends on some third party libraries. Some of them are open source, some others are not.<br />
<br />
=== Open source libraries ===<br />
<br />
As of Viewer version 1.21, all open source libraries are automatically downloaded as part of the build script invoked by <code>develop.py</code>, unless you choose to configure a standalone build.<br />
<br />
=== Proprietary libraries ===<br />
<br />
Linden Lab does not provide proprietary libraries. You will need to follow the instructions here under to acquire and copy them to your source tree.<br />
<br />
It's probably a good idea to build an empty directory tree for those files, copy the relevant proprietary files there and, once done, copy the whole to your source tree (like <code>XCOPY OLIB SL_1_16_0_5 /S</code>). The reason is that these steps are cumbersome and will have to be repeated for each new release (at least if you keep the source for each release in its own folder). If you do not want to do this, you can just as well copy the files directly into the linden source paths.<br />
<br />
rem OLIBS.CMD to build a folder tree for 3rd party libraries and includes<br />
md olibs<br />
md olibs\linden\<br />
md olibs\linden\libraries<br />
md olibs\linden\libraries\include<br />
md olibs\linden\libraries\i686-win32<br />
md olibs\linden\libraries\i686-win32\lib_release<br />
md olibs\linden\libraries\i686-win32\lib_debug<br />
md olibs\linden\libraries\i686-win32\include<br />
md olibs\linden\libraries\i686-win32\include\GL<br />
md olibs\linden\libraries\i686-win32\include\quicktime<br />
md olibs\linden\indra<br />
md olibs\linden\indra\newview<br />
<br />
<br />
==== Fmod ==== <br />
* Download & extract [http://www.fmod.org/files/fmod3/fmodapi375win.zip FMOD3.75 API for Windows]. (later versions, like FMOD Ex, are incompatible).<br />
* Copy <code>fmodapi375win\api\inc\fmod.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\inc\fmod_errors.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\inc\fmoddyn.h</code> to <code>linden\libraries\include</code><br />
* Copy <code>fmodapi375win\api\lib\fmodvc.lib</code> to <code>linden\libraries\i686-win32\lib_release</code> and to <code>linden\libraries\i686-win32\lib_debug</code><br />
(If using cmake, copy <code>fmodapi375win\api\lib\fmodvc.lib</code> to <code>linden\libraries\i686-win32\lib\release</code> and to <code>linden\libraries\i686-win32\lib\debug</code>)<br />
* Copy <code>fmodapi375win\api\fmod.dll</code> to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
<br />
Note to Snowstorm users: if you are building using the Mercurial repository [https://bitbucket.org/lindenlab/viewer-development lindenlab/viewer-development], these steps have been simplified and cleaned up. In particular, there's no need to drop anything under <code>linden\indra</code> anymore, all the files are under <code>linden\libraries</code> like for other 3rd party libraries. The <code>fmodvc.lib</code> however needs to be renamed <code>fmod.lib</code>. The new instructions are:<br />
* Download & extract [http://www.fmod.org/files/fmod3/fmodapi375win.zip FMOD3.75 API for Windows]<br />
* From <code>fmodapi375win\api\inc\</code>, copy <code>fmod.h</code> and <code>fmod_errors.h</code> to <code>linden\libraries\include</code><br />
* From <code>fmodapi375win\api\lib</code>, choose the relevant <code>.lib</code> that correspond to your environment (e.g. <code>fmodvc.lib</code> for Visual Studio), rename it <code>fmod.lib</code> and copy it to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
* From <code>fmodapi375win\api</code> copy <code>fmod.dll</code> to <code>linden\libraries\i686-win32\lib\release</code> and <code>linden\libraries\i686-win32\lib\debug</code><br />
<br />
==== Quicktime ====<br />
<br />
Currently - as of version 1.21 - CMake requires Quicktime to be installed.<br />
<br />
'''Note:''' This download requires a registration at the Apple Quicktime website and take a bit of time. You can avoid using QuickTime if you want, see [[Compiling_older_Viewers_(1.20_and_earlier_with_MSVS)#QuickTime_removal|this]] for details. Remember that your Viewer '''can't play in-world movies''' if you do so.<br />
* Download & install the [http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wo/11.1.17.2.1.3.3.1.0.1.1.0.3.11.3.3.1#main Quicktime SDK for Windows]<br />
* Copy <code>QuicktimeSDK\Libraries\QTMLClient.lib</code> to <code>linden\libraries\i686-win32\lib_release</code> and to <code>linden\libraries\i686-win32\lib_debug</code>.<br />
<br />
(If using CMake, copy <code>QuicktimeSDK\Libraries\QTMLClient.lib</code> to <code>linden\libraries\i686-win32\lib\release</code> and to <code>linden\libraries\i686-win32\lib\debug</code> instead)<br />
<br />
* Copy the contents of <code>QuicktimeSDK\CIncludes</code> into <code>linden\libraries\i686-win32\include\quicktime</code>.<br />
<br />
== Building the Viewer ==<br />
<br />
At this point, you should be ready to use [[CMake]] to build the Visual Studio solution for the project. <br />
<br />
'''NOTE''': CMake is only supported for Viewer versions 1.21 and beyond. <br />
<br />
Before you first run a build, you'll need to configure things. It is recommended that you use the <code>develop.py</code> script that will create a default configuration for you.<br />
<br />
You must make sure that cmake is registered in the Windows environment or you will get strange errors from <code>develop.py</code>. To ensure everything is correct, right click My Computer -> Properties -> Advanced -> Environment Variables -> Inside System Variables, choose PATH (case insensitive) and click Edit. Now in the value field, go to the end of the value and add a semicolon (<code>;</code>), and then the folder containing the CMake binaries (example: <code>C:\Program Files\CMake 2.8\bin</code>). This might already have been set by the CMake installer.<br />
<br />
From the command line, navigate to the <code>indra</code> folder of your source tree and run:<br />
<br />
python develop.py<br />
<br />
CMake will pick the most recent version of Visual Studio we support. If you want to specify the version of Visual Studio to use.<br />
<br />
* VisualStudio 2005:<br />
<br />
python develop.py -G VC80<br />
<br />
* VisualStudio 2008:<br />
<br />
python develop.py -G VC90<br />
<br />
'''NOTE:''' The above commands will configure a "non-standalone" version of the source code tree. This means that the required third party library packages (as built by Linden Lab) will be downloaded during the CMake process.<br />
<br />
=== Finding your build directory ===<br />
<br />
In the CMake world, we keep source and object files separate. The <code>develop.py</code> script did create and populate a build directory for you. It is in one of the following locations:<br />
* VS 2005: <code>indra/build-vc80</code><br />
* VS 2008: <code>indra/build-vc90</code> <br />
<br />
=== Compiling ===<br />
<br />
To start a build, do one of the following:<br />
* Run <code>python develop.py build</code> from the <code>indra</code> directory.<br />
** '''NOTE FOR VS 2008 USERS:''' This command will not work, since it will only look for VS 2005. Instead, run the command <code>python develop.py -G VC90 build</code><br />
* Load the Visual Studio solution into your IDE. For MSVS VC++:<br />
** Use "File -> Open -> Project/Solution", and open the <code>linden/indra/build-VC80/SecondLife.sln</code> solution file<br />
*** '''NOTE FOR VS 2008 USERS:''' Even though a build-VC90 was created in the above steps, <code>developer.py</code> places the VS 2008 solution/project files in the <code>indra</code> directory. Don't move them to <code>build-VC90</code> - the paths in the project files are relative to the <code>indra</code> directory.<br />
** In the MSVS toolbar, just to the right of the triangular "Start Debugging" arrow, is a text box whose tooltip is "Solution Configurations". Select RelWithDebugInfo.<br />
** If ALL_BUILD is not set as your StartUp Project (the StartUp Project is displayed in bold font), right-click on ALL_BUILD and choose "Set as StartUp Project".<br />
** Right-click on ALL_BUILD and choose "Properties". In "Configuration Properties -> Debugging", find "Working Directory" and navigate to <code>linden\indra\newview</code>.<br />
** (For Snowglobe 1.x) In the Solution Explorer pane, right-click on the project named "prepare" and select Project Only -> Build Only prepare. This downloads and installs precompiled libraries and only needs to be done when the source tree is clean or if libraries in the list included in the source tree get updated. Running this when not required is brief and causes no harm.<br />
** Build -> Build Solution (F7)<br />
** Debug -> "Start Debugging" or "Start without debugging".<br />
** MSVC might not be able to find the executable. If not, point it to <code>linden\indra\build-VC80\newview\relwithdebinfo\secondlife-bin.exe</code>, and try again.<br />
** You may see an error due to not being able to find <code>fmod.dll</code>. If so, find a copy (remember, you copied this in a step above) and copy it into <code>indra\build-VC80\newview\relwithdebinfo</code>. Try again.<br />
** You may see an error due to not finding <code>llkdu.dll</code>. If so, find it in the normal installed version (make sure it's the same version as your source) and copy it into <code>indra\build-VC80\newview\relwithdebinfo</code>. Try again.<br />
** Good luck!<br />
<br />
=== Where's the built Viewer? ===<br />
<br />
On Windows, the built Viewer ought to run from VS2005.<br />
<br />
To run outside MS VS, see Discussion tab:<br />
[[Talk:Microsoft_Windows_Builds#Running_Viewer_outside_of_MS_VC]]<br />
<br />
=== Build instructions for 1.20 and earlier ===<br />
<br />
See [[Compiling older Viewers (1.20 and earlier with MSVS)]] if you'd like to compile a version of the Viewer older than 1.20.<br />
<br />
== What to do if it doesn't work for you ==<br />
<br />
* Ask for help on [[IRC]] ([irc://irc.freenode.net/opensl #opensl on freenode])<br />
* Find someone on the [[OpenSource-Dev|OpenSource-Dev mailing list]]<br />
* Fix it: [[Modifying CMake Files]] (and please, submit a patch!)<br />
<br />
Please also see the (user contributed) instructions at [[User:Michelle2_Zenovka/cmake]]<br />
<br />
[[Category:Compiling viewer]]</div>Jenn Linden