Difference between revisions of "Build the Viewer on Windows"

From Second Life Wiki
Jump to navigation Jump to search
(→‎Test build of the Second Life Viewer: point people to lindenlab/viewer64; mention -A switch)
(→‎Test build of the Second Life Viewer: counsel patience with configure; clarify that eval is bash-only; update build-vc120-* directory)
Line 109: Line 109:
where ''configuration'' is either "RelWithDebInfoOS" or "ReleaseOS". You can omit that option if you set the AUTOBUILD_CONFIGURATION environment variable to the one you want.
where ''configuration'' is either "RelWithDebInfoOS" or "ReleaseOS". You can omit that option if you set the AUTOBUILD_CONFIGURATION environment variable to the one you want.
<code>-A</code> may be either 64 or 32, depending on which you intend to build. You can omit that option if you set the AUTOBUILD_ADDRSIZE environment variable accordingly.
<code>-A</code> may be either 64 or 32, depending on which you intend to build. You can omit that option if you set the AUTOBUILD_ADDRSIZE environment variable accordingly.
Please be patient: the <tt>autobuild configure</tt> command silently fetches and installs required autobuild packages, and some of them are large.
{{KBnote|custom=TBD|we need a description here or somewhere on optional configuration switches}}
{{KBnote|custom=TBD|we need a description here or somewhere on optional configuration switches}}
When that completes, you can either build within Visual Studio or from the command line
When that completes, you can either build within Visual Studio or from the command line
===Command Line Builds===
===Command Line Builds===
Initialize your tools environment by running:
In bash, initialize your tools environment by running:
  eval $(autobuild source_environment)
  eval $(autobuild source_environment)
That only needs to be done once per terminal session.
That only needs to be done once per bash session.


Build by running:
Build by running:
  autobuild build --no-configure  -c ''configuration''
  autobuild build --no-configure  -c ''configuration''
the resulting viewer executable will be at:
the resulting viewer executable will be at:
  build-vc120/newview/''configuration''/secondlife-bin.exe
  build-vc120-64/newview/''configuration''/secondlife-bin.exe
(or of course build-vc120-32 if you choose to build a 32-bit viewer)


===Building within Visual Studio===
===Building within Visual Studio===

Revision as of 13:26, 16 June 2017

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.
KBwarning.png Warning:

These instructions will not work with viewer-release because they are being updated to build the 64bit (Alex Ivy) repository; for instructions that will work on other repositories, use the history tab above to view the instructions from 15 Jun 2017.

Be aware that upgrading the tools on your system to those described here will mean that you will not be able to build older versions of the viewer.

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 Community version
    • Run the installer as Administrator (right click, "Run as administrator")
    • Uncheck all the "Optional features to install:" - they are not required

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/patch
    • Use default options for everything else

Python

  • Download and install the most recent version of Python 2.7 (32bit)
    • 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:

cmake --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

  • Install Autobuild
  • Check
    • autobuild --version
    • should report 1.1.5 or later

NSIS (Unicode)

  • You must install the Unicode version here and not the one from the NSIS page
  • Not required unless you need to change the NSIS installer package logic itself


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 the current viewer sources from Mercurial

hg clone https://bitbucket.org/lindenlab/viewer-release
hg clone https://bitbucket.org/lindenlab/viewer64  <= until Alex Ivy gets promoted to viewer-release

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

cd viewer-release
autobuild configure -c configuration -A 64

where configuration is either "RelWithDebInfoOS" or "ReleaseOS". You can omit that option if you set the AUTOBUILD_CONFIGURATION environment variable to the one you want. -A may be either 64 or 32, depending on which you intend to build. You can omit that option if you set the AUTOBUILD_ADDRSIZE environment variable accordingly.

Please be patient: the autobuild configure command silently fetches and installs required autobuild packages, and some of them are large.

KBnote.png TBD we need a description here or somewhere on optional configuration switches

When that completes, you can either build within Visual Studio or from the command line

Command Line Builds

In bash, initialize your tools environment by running:

eval $(autobuild source_environment)

That only needs to be done once per bash session.

Build by running:

autobuild build --no-configure  -c configuration

the resulting viewer executable will be at:

build-vc120-64/newview/configuration/secondlife-bin.exe

(or of course build-vc120-32 if you choose to build a 32-bit viewer)

Building within Visual Studio

Open the VS 2013 solution file

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

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)