Difference between revisions of "Viewer 2 Microsoft Windows Builds"

From Second Life Wiki
Redirect page
Jump to: navigation, search
m (Redirected page to Visual Studio 2013 Viewer Builds)
 
(367 intermediate revisions by 21 users not shown)
Line 1: Line 1:
{{multi-lang}}
+
#REDIRECT [[Visual Studio 2013 Viewer Builds]]
{{CompileNav}}
+
 
+
{{KBwarning|custom=Work in progress|'''These instructions are not yet complete or  debugged''' as of March 22, 2011.}}
+
 
+
When finished, we hope this page will constitute a complete recipe for compiling viewer 2 from source on a Windows machine. 
+
 
+
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.
+
 
+
{{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.}}
+
 
+
== Establish your programming environment ==
+
This is needed for compiling any viewer based on the LL open source code, but only needs to be done once.
+
#Obtain Visual Studio 2010 (Express is OK)
+
#:[http://www.microsoft.com/express/download/ Click here to download Visual C++ Express - current version is VS2010]
+
#Install Microsoft Platform & DirectX SDKs
+
#: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
+
#:[http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba Download and install DirectX SDK (June 2010)]
+
#Run Microsoft update and keep running it until no updates are needed. This may take 6~8 iterations on older versions of windows.
+
#Install other development tools
+
#*[http://code.google.com/p/unsis/downloads/list UniCode NSIS(download Unicode NSIS)]
+
#*:This is the package installer used to build Setup.exe.  Note: As of this writing the file is downloaded with an *.exec extension that needs renamed *.exe.
+
#*CMake ([http://www.cmake.org/files/v2.8/ download CMake])
+
#*:should be version 2.8.1  Kitware corrected a bug related to VS2010 at 2.8.1 and it came back in the current versions but, is due to be fixed in version 2.8.4. (and ensure any other versions aren't in your PATH environment variables)
+
#*Cygwin ([http://www.cygwin.com/ download Cygwin])
+
#*: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.
+
#*Python ([http://www.python.org/download/ download either Python.org Standard Python] or [http://www.activestate.com/activepython/downloads ActivePython]) Note: build scripts support Python 2.6, not 2.7 yet.
+
#*TortoiseHg ([http://tortoisehg.bitbucket.org/ download TortoiseHg]) or ([http://mercurial.selenic.com/release/windows/Mercurial-1.7.5.exe Mercurial Hg])
+
#*: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]].
+
#*Notepad++ ([http://notepadplusplus.org/ download Notepad++]) (Optional)
+
 
+
{{KBnote|If the installer for a particular package does not update your PATH environment setting you will have to do this manually.}}
+
 
+
Additionally it is recommended that you make the following changes to your Cygwin installation:
+
*Override cygwin's python:
+
  if [ -f /usr/bin/python.exe ]; then
+
    mv /usr/bin/python.exe /usr/bin/cygwin-python.exe
+
  fi
+
  cp /cygdrive/c/Python26/python.exe /usr/bin/python.exe
+
*Override cygwin's mercurial:
+
  if [ -f /usr/bin/hg.exe ]; then
+
    mv /usr/bin/hg.exe /usr/bin/cygwin-hg.exe
+
  fi
+
  cp /cygdrive/c/Program\ Files/Mercurial/hg.exe /usr/bin/hg.exe
+
The native Cygwin python and hg do not work very well and should be avoided.
+
 
+
== Set up your source code tree ==
+
 
+
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.
+
 
+
To get a copy of the source code tree:
+
* Open up a DOS/Command window
+
* Make a directory to contain it (it is strongly suggested to name it <code>viewer-development</code>)
+
* Go into that directory
+
* Do <code>hg init</code>
+
* Do <code>hg pull <nowiki>http://hg.secondlife.com/viewer-development</nowiki></code>
+
 
+
* Example:  ((specific snapshot example TBD))
+
 
+
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
+
* Go into <code>viewer-development</code> (or whatever you named the master source tree copy)
+
* Do <code>hg pull</code>
+
* Do <code>hg update</code>
+
* Move up one level from <code>viewer-development</code>
+
* 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)
+
* Copy your <code>olibs</code> from above into this new source tree.
+
 
+
== Build the viewer with autobuild ==
+
=== Install autobuild ===
+
If you haven't done so already, install ''autoubuild''.  Full instructions can be found on the [[Autobuild]] page, but most users may simply use
+
  [http://pypi.python.org/pypi/setuptools easy_install] autobuild
+
or
+
[http://pypi.python.org/pypi/pip pip] install autobuild
+
to install.
+
 
+
=== Build a desired configuration ===
+
With a properly configured developer machine (see [[Get_source_and_compile#Compiling| compiling]]), building the viewer with ''autobuild'' is as simple as invoking
+
  autobuild build -c [CONFIGURATION]
+
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.
+
 
+
Developers who wish to build a viewer with an IDE don't have to do a full command line build.  Using
+
  autobuild configure -c [CONFIGURATION]
+
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.
+
+
==== Base build configurations ====
+
There are three basic types of build configurations which are used to vary the debugability of the resulting build versus optimization.  These configurations are:
+
* '''Debug''' &mdash; unoptomized with debugging information.
+
* '''RelWithDebInfo''' &mdash; optomized but with debugging information.
+
* '''Release''' &mdash; optimized with no debug information.
+
'''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.
+
 
+
==== Build variations for open source developers ====
+
The unmodified build configuraitons 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:
+
* '''OpenSource''' &mdash; build a viewer using only publicly distributed installables.
+
* '''OpenSourceStandAlone''' &mdash; build a viewer without using any installable packages provided by Linden.
+
*: Developers will need to install any 3<sup>rd</sup> party dependencies manually.
+
To build an open source configuration choose a build configuration which is a concatonation of one of the two above prefixes with a base configuraiton name.  For example to build a stand alone viewer with release optimization including debug information run
+
autobuild build -c OpenSourceStandAloneRelWithDebInfo
+
 
+
== Compile using the IDE ==
+
 
+
== Iteratively fix things until the compile succeeds ==
+
 
+
((TBD - add any fixup steps here.  e.g. does <code>fmod375.dll</code> need to be moved into <code>RelWithDbgInfo</code> at this step?))
+
 
+
* report your experiences, if useful, on the talk page, [[Talk:Viewer 2 Microsoft Windows Builds]]
+
 
+
== Common Issues/Bugs/Glitches And Solutions ==
+
 
+
*Getting help:
+
** Subscribe to [[OpenSource-Dev|OpenSource-Dev Mailing List]] ([https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev subscribe]) and post your question there.
+
** 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.
+
 
+
== References ==
+
 
+
These instructions are condensed from about a dozen previous pages of info:
+
*https://wiki.secondlife.com/wiki/Microsoft_Windows_Builds
+
*https://wiki.secondlife.com/wiki/Compiling_the_Viewer_%28MSVS2008%29
+
*https://wiki.secondlife.com/wiki/User:Jodiah_Jensen#UPDATING_BOOST_LIBRARIES_TO_WORK_WITH_VS2008
+
** now partially incorrect
+
*http://jira.secondlife.com/browse/VWR-9541
+
 
+
((add other references here))
+
 
+
 
+
[[Category:Compiling viewer]]
+

Latest revision as of 12:26, 23 April 2015