Difference between revisions of "Build the Viewer on Windows"

From Second Life Wiki
Jump to navigation Jump to search
m (changed canonical repository for autobuild 1.0)
m (move some warnings closer to where they are relevant, add one about installing autobuild, minor formatting changes)
Line 17: Line 17:
*An installer for Visual Studio 2013
*An installer for Visual Studio 2013
*A valid license for Visual Studio 2013
*A valid license for Visual Studio 2013
Every effort has been made to make this recipe work with the Cygwin shell only.  Currently, the "Set up Autobuild and Python" section '''only''' works inside the Windows Command Prompt. ''If you figure out a way to make this work with Cygwin, please let us know.''
The combination of Cygwin and Tortoise Hg means it is not possible to check out or check into a repository that requires you to enter login credentials. Currently, to do this, you must switch to a Windows Command Prompt. ''Again, if you know how to fix this or have a suggestion for a better package to use, please let us know.''
}}
}}
 
__TOC__
=="Minimum Requirements" recipe==
==Windows==
===Windows===


*Install Windows 7 Pro 64bit using your own product key
*Install Windows 7 Pro 64bit using your own product key
Line 30: Line 25:
*Keep running Windows Update (Start Menu -> All Programs -> Windows Update) until clicking on "Check for Updates" there tells you everything is up to date. Depending on the age of the install media you started with, this could take a really long time and many, many iterations.
*Keep running Windows Update (Start Menu -> All Programs -> Windows Update) until clicking on "Check for Updates" there tells you everything is up to date. Depending on the age of the install media you started with, this could take a really long time and many, many iterations.


===Microsoft Visual Studio 2013 Pro===
==Microsoft Visual Studio 2013 Pro==
*Install VS 2013 Pro
*Install VS 2013 Pro
* Note: If you don't own a copy of VS 2013 Pro, you might consider installing the the [http://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx Community Version]
* Note: If you don't own a copy of VS 2013 Pro, you might consider installing the the [http://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx Community Version]
Line 40: Line 35:
**Run the installer as Administrator (right click, "Run as administrator")
**Run the installer as Administrator (right click, "Run as administrator")


===DirectX SDK===
==DirectX SDK==
*Download and install [http://www.microsoft.com/en-us/download/details.aspx?id=6812 DirectX SDK (June 2010)]
*Download and install [http://www.microsoft.com/en-us/download/details.aspx?id=6812 DirectX SDK (June 2010)]
**Run the installer as Administrator (right click, "Run as administrator")
**Run the installer as Administrator (right click, "Run as administrator")
**At the Installation Options screen, set everything except the DirectX Headers and Libs to "This feature will not be installed"
**At the Installation Options screen, set everything except the DirectX Headers and Libs to "This feature will not be installed"


===Tortoise Hg===
==Tortoise Hg==
{{KBcaution|
The combination of Cygwin and Tortoise Hg means it is not possible to check out or check into a repository that requires you to enter login credentials. Currently, to do this, you must switch to a Windows Command Prompt. ''Again, if you know how to fix this or have a suggestion for a better package to use, please let us know.''
}}
 
*Download and install [http://tortoisehg.bitbucket.org/download/ TortoiseHg 3.2.3] (64bit)
*Download and install [http://tortoisehg.bitbucket.org/download/ TortoiseHg 3.2.3] (64bit)
**Note: No option available to install as Administrator
**Note: No option available to install as Administrator
**Use default options (path, components etc.)
**Use default options (path, components etc.)


===CMake===
==CMake==
*Download and install [http://www.cmake.org/download/ CMake 3.1.0] (32bit is only option)
*Download and install [http://www.cmake.org/download/ CMake 3.1.0] (32bit is only option)
**Run the installer as Administrator (right click, "Run as administrator")
**Run the installer as Administrator (right click, "Run as administrator")
Line 56: Line 55:
**For everything else, use the default options (path, etc.)
**For everything else, use the default options (path, etc.)


===Cygwin===
==Cygwin==
*Download and install [http://cygwin.com/install.html Cygwin 64] (64bit)
*Download and install [http://cygwin.com/install.html Cygwin 64] (64bit)
**Run the installer as Administrator (right click, "Run as administrator")
**Run the installer as Administrator (right click, "Run as administrator")
Line 66: Line 65:
**Use default options for everything else
**Use default options for everything else


===Python===
==Python==
*Download and install [https://www.python.org/ftp/python/2.7.8/python-2.7.8.msi Python 2.7.<font color="red">8</font> (32bit)] (Do '''not''' install version 2.7.9 - it doesn't work for our setup currently])
*Download and install [https://www.python.org/ftp/python/2.7.8/python-2.7.8.msi Python 2.7.<font color="red">8</font> (32bit)] (Do '''not''' install version 2.7.9 - it doesn't work for our setup currently])
**Note: No option available to install as Administrator
**Note: No option available to install as Administrator
Line 72: Line 71:
**Change "Add python.exe to Path" to "Will be installed on local hard drive"
**Change "Add python.exe to Path" to "Will be installed on local hard drive"


===Intermediate check===
==Intermediate check==
{{KBnote|custom=Confirm things are installed properly so far|
{{KBnote|custom=Confirm things are installed properly so far|
Open a Cygwin terminal and type:
Open a Cygwin terminal and type:
Line 82: Line 81:
If they all report sensible values and not "Command not found" errors, then you are in good shape}}
If they all report sensible values and not "Command not found" errors, then you are in good shape}}


===Set up Autobuild and Python===
==Set up Autobuild and Python==
{{KBcaution|This section '''only''' works inside the Windows Command Prompt. ''If you figure out a way to make this work with Cygwin, please let us know.''
}}
*Bootstrap pip  
*Bootstrap pip  
** Download (Save As) [https://bootstrap.pypa.io/get-pip.py get-pip.py] and copy to a temp folder
** Download (Save As) [https://bootstrap.pypa.io/get-pip.py get-pip.py] and copy to a temp folder
Line 98: Line 99:
** Typically <code>cd \Python27\Scripts</code>
** Typically <code>cd \Python27\Scripts</code>
** Run <code>pip install hg+http://bitbucket.org/lindenlab/autobuild-1.0#egg=autobuild</code>
** Run <code>pip install hg+http://bitbucket.org/lindenlab/autobuild-1.0#egg=autobuild</code>
** Autobuild will be installed
** Autobuild will be installed.  '''Earlier versions of autobuild could be made to work by just putting the source files into your path correctly; this is no longer true - autobuild ''must'' be installed as described here'''
*Update system PATH
*Update system PATH
**Add Python Scripts folder to PATH environment variable via the Control Panel
**Add Python Scripts folder to PATH environment variable via the Control Panel
**Typically <code>C:\Python27\Scripts</code>
**Typically <code>C:\Python27\Scripts</code>


===NSIS (Unicode)===
==NSIS (Unicode)==
* You must install the Unicode version [http://www.scratchpaper.com/ here] and not the one from the NSIS page
* You must install the Unicode version [http://www.scratchpaper.com/ here] and not the one from the NSIS page
* Not strictly required for developers (although it's useful)  
* Not strictly required for developers (although it's useful)  
<br>
<br>
===Test build of the Second Life Viewer===
==Test build of the Second Life Viewer==
Open a Cygwin shell and create a folder to hold your work
Open a Cygwin shell and create a folder to hold your work
  cd /cygdrive/c
  cd /cygdrive/c

Revision as of 09:35, 5 May 2015

Visual Studio 2013 - Second Life Developer set up

This "Minimum Requirements recipe" listed below works for both local machines and VMs such as VMWare Fusion.

This document is mostly complete (see Todo sections below and has been tested a number of times on bare metal systems. It is expected (and hoped) that developers will improve and refine this process over time - there are still some rough edges and things will change as new versions of software become available.

KBnote.png For Lindens Only See this page on the internal wiki for specifics of internal use.
KBcaution.png Some Gotchas before we start

The external package versions and bit-widths listed below have been carefully selected and tested. If you decide to install a different version of a given package (even a minor update), you are on your own.

This recipe, by design, only covers development using the Cygwin shell - some commands will have to be modified if you want to use the Windows Command Prompt instead.

You will need at the very least, these items before you begin:

  • An installer for Windows 7 Pro 64bit
  • A valid Windows Product key
  • An installer for Visual Studio 2013
  • A valid license for Visual Studio 2013

Windows

  • Install Windows 7 Pro 64bit using your own product key
  • Keep running Windows Update (Start Menu -> All Programs -> Windows Update) until clicking on "Check for Updates" there tells you everything is up to date. Depending on the age of the install media you started with, this could take a really long time and many, many iterations.

Microsoft Visual Studio 2013 Pro

  • Install VS 2013 Pro
  • Note: If you don't own a copy of VS 2013 Pro, you might consider installing the the Community Version
    • Run the installer as Administrator (right click, "Run as administrator")
    • Uncheck all the "Optional features to install:" - they are not required
  • Download and install VS2013 Service Packs and updates
    • Update 4 is the most recent released version at time of writing (2015-01)
    • Run the installer as Administrator (right click, "Run as administrator")

DirectX SDK

  • Download and install DirectX SDK (June 2010)
    • Run the installer as Administrator (right click, "Run as administrator")
    • At the Installation Options screen, set everything except the DirectX Headers and Libs to "This feature will not be installed"

Tortoise Hg

KBcaution.png Important:

The combination of Cygwin and Tortoise Hg means it is not possible to check out or check into a repository that requires you to enter login credentials. Currently, to do this, you must switch to a Windows Command Prompt. Again, if you know how to fix this or have a suggestion for a better package to use, please let us know.

  • Download and install TortoiseHg 3.2.3 (64bit)
    • Note: No option available to install as Administrator
    • Use default options (path, components etc.)

CMake

  • Download and install CMake 3.1.0 (32bit is only option)
    • Run the installer as Administrator (right click, "Run as administrator")
    • At the "Install options" screen, select "Add CMake to the system PATH for all users"
    • For everything else, use the default options (path, etc.)

Cygwin

  • Download and install Cygwin 64 (64bit)
    • Run the installer as Administrator (right click, "Run as administrator")
    • Use default options (path, components etc.) *until* you get to the "Select Packages" screen
    • Add additional packages:
      • Devel/bison
      • Devel/flex
      • Devel/patch
    • Use default options for everything else

Python

  • Download and install Python 2.7.8 (32bit) (Do not install version 2.7.9 - it doesn't work for our setup currently])
    • Note: No option available to install as Administrator
    • Use default options (path, components etc.) *until* you get to the "Customize Python" screen
    • Change "Add python.exe to Path" to "Will be installed on local hard drive"

Intermediate check

KBnote.png Confirm things are installed properly so far

Open a Cygwin terminal and type:

bison --version
cmake --version
flex --version
hg --version
python --version
If they all report sensible values and not "Command not found" errors, then you are in good shape

Set up Autobuild and Python

KBcaution.png Important: This section only works inside the Windows Command Prompt. If you figure out a way to make this work with Cygwin, please let us know.
  • Bootstrap pip
    • Download (Save As) get-pip.py and copy to a temp folder
    • Open Windows Command Prompt
    • Switch to that temp folder and execute it python get-pip.py
    • Pip will be installed
  • Bootstrap easy_install
    • Download (Save As) ez_setup.py and copy to a temp folder
    • Remain in Windows Command Prompt
    • Switch to that temp folder and execute it python ez_setup.py
    • easy_install will be installed
  • Install Autobuild
    • Remain in Windows Command Prompt
    • Change to the Python Scripts folder that was just created
    • Typically cd \Python27\Scripts
    • Run pip install hg+http://bitbucket.org/lindenlab/autobuild-1.0#egg=autobuild
    • Autobuild will be installed. Earlier versions of autobuild could be made to work by just putting the source files into your path correctly; this is no longer true - autobuild must be installed as described here
  • Update system PATH
    • Add Python Scripts folder to PATH environment variable via the Control Panel
    • Typically C:\Python27\Scripts

NSIS (Unicode)

  • You must install the Unicode version here and not the one from the NSIS page
  • Not strictly required for developers (although it's useful)


Test build of the Second Life Viewer

Open a Cygwin shell and create a folder to hold your work

cd /cygdrive/c
mkdir work
cd work

Check out a branch from Mercurial

Currently this has to be Viewer Tools Update but eventually will apply to Viewer Release too.
hg clone https://bitbucket.org/lindenlab/viewer-tools-update

Switch to the directory you just checked out and run Autobuild Configure

cd viewer-tools-update
autobuild configure -c RelWithDebInfoOS|ReleaseOS
KBnote.png TBD we need a description here or somewhere on optional configuration switches

When that completes, open the VS 2013 solution file that gets created

cygstart build-vc120/SecondLife.sln

Right-click on "secondlife-bin" in the Solution Explorer and select "Build"

wait...

When the build completes (hopefully without errors) run it by pressing Control-F5

KBnote.png Note: At some point, this recipe will include steps that facilitate command line builds - for the moment, only option is to use the VS 2013 IDE

Additional Tools & Settings you might need

  • Tools
    • Install and set up hg hooks using instructions
      This arguably should be in the "minimum Requirements" section as it's way to easy to accidentally check in files with Windows line endings. Strongly suggested you install this.
    • Install a Visual Studio helper like WholeTomato Visual Assist for VS2013 or Workspace Whiz
      These extensions to Visual Studio add many great features. Pretty much essential for serious work.
    • Install a decent merge tool like Araxis Merge
      Many free alternatives out there but Araxis is the best (and most expensive)