Difference between revisions of "Microsoft Windows Builds"

From Second Life Wiki
Jump to navigation Jump to search
Line 5: Line 5:
On Windows, there are several options on build (compile) environment of the Second Life.
On Windows, there are several options on build (compile) environment of the Second Life.


This page explains how you can compile the viewer on Microsoft Windows.
This page explains how you can compile the Viewer on Microsoft Windows.


Currently, only 32 bit binary is tested.  There seems to be several trials to produce 64 bit Windows .EXE of the viewer.  If you did, please write your experience on [[Talk:Microsoft Windows Builds|the discussion page]] (regardless it was successful or not!)
Currently, only 32 bit binary is tested.  There seems to be several trials to produce 64 bit Windows .EXE of the Viewer.  If you did, please write your experience on [[Talk:Microsoft Windows Builds|the discussion page]] (regardless it was successful or not!)


= Choosing and Preparing a Compiler =
== Choosing and preparing a compiler ==


== Linden-Supported Compilers ==
=== Linden-supported compilers ===


Supported compiler: '''Visual Studio .NET 2005 Professional'''
Supported compiler: '''Visual Studio .NET 2005 Professional'''
Line 18: Line 18:
* Setup [[Microsoft Visual Studio]]
* Setup [[Microsoft Visual Studio]]


== Community Experimental Compilers ==
=== Community experimental compilers ===


If you don't have Visual Studio .NET 2005 Professional, you may wish to try one of the following alternatives.
If you don't have Visual Studio .NET 2005 Professional, you may wish to try one of the following alternatives.
Line 28: Line 28:
{{Warning|Boost support with Visual Studio 2008 is problematic as of this writing.  Check {{jira|VWR-9541}} before continuing on this path.}}
{{Warning|Boost support with Visual Studio 2008 is problematic as of this writing.  Check {{jira|VWR-9541}} before continuing on this path.}}


= Getting other Development Tools =
== Getting other development tools ==


You will need to install the following tools to compile the viewer:
You will need to install the following tools to compile the Viewer:
* '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])
* '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])
**  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.
**  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.
* '''Cygwin''' ([http://www.cygwin.com/ download Cygwin])
* '''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. (If you missed one of these, the easiest thing to do is to re-run the entire installation.)
** 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. (If you missed one of these, the easiest thing to do is to re-run the entire installation.)
Line 46: Line 46:
'''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)
'''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)


= Downloading Source Code =
== Downloading source code ==


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".
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".
Line 59: Line 59:
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 '''sl_1_21_6'''.
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 '''sl_1_21_6'''.


= Installing Libraries =
== Installing libraries ==


SL Viewer depends on some third party libraries.  Some of them are open source, some others are not.
SL Viewer depends on some third party libraries.  Some of them are open source, some others are not.


== Open Source Libraries ==
=== Open source libraries ===


As of viewer version 1.21, all open source libraries are automatically downloaded as part of the build process, unless you choose to configure a standalone build.
As of Viewer version 1.21, all open source libraries are automatically downloaded as part of the build process, unless you choose to configure a standalone build.


== Proprietary Libraries ==
=== Proprietary libraries ===


Linden does not include the following proprietary libraries.  You will need to follow the instructions to acquire below and copy them to the source path.
Linden does not include the following proprietary libraries.  You will need to follow the instructions to acquire below and copy them to the source path.
Line 86: Line 86:
  md olibs\linden\indra
  md olibs\linden\indra
  md olibs\linden\indra\newview
  md olibs\linden\indra\newview
<br />
 
=== Fmod ===
 
==== Fmod ====
 
* Download & extract [http://www.fmod.org/index.php/download fmod 3.75 api for win32], under section heading '''FMOD 3 Programmers API''' (later versions, like FMOD Ex, are incompatible).
* Download & extract [http://www.fmod.org/index.php/download fmod 3.75 api for win32], under section heading '''FMOD 3 Programmers API''' (later versions, like FMOD Ex, are incompatible).
* Copy "fmodapi375win\api\inc\fmod.h" to "linden\libraries\include"
* Copy "fmodapi375win\api\inc\fmod.h" to "linden\libraries\include"
Line 94: Line 96:
(If using cmake, copy "fmodapi375win\api\lib\fmodvc.lib" to "linden\libraries\i686-win32\lib\release" and to "linden\libraries\i686-win32\lib\debug")
(If using cmake, copy "fmodapi375win\api\lib\fmodvc.lib" to "linden\libraries\i686-win32\lib\release" and to "linden\libraries\i686-win32\lib\debug")
* Copy "fmodapi375win\api\fmod.dll" to "linden\indra\newview"
* Copy "fmodapi375win\api\fmod.dll" to "linden\indra\newview"
<br />


=== Quicktime ===
 
==== Quicktime ====


Currently - as of version 1.21 - CMake requires Quicktime to be installed.
Currently - as of version 1.21 - CMake requires Quicktime to be installed.


'''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.
'''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.
* Download & install the [http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/203/wa/getSoftware?fileID=20525&code=y&source=x&wosid=4h16WcyMtVfd2P1EffGafkoxFcr Quicktime SDK for Windows]
* Download & install the [http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/203/wa/getSoftware?fileID=20525&code=y&source=x&wosid=4h16WcyMtVfd2P1EffGafkoxFcr Quicktime SDK for Windows]
* Copy "QuicktimeSDK\Libraries\QTMLClient.lib" to "linden\libraries\i686-win32\lib_release" and to  "linden\libraries\i686-win32\lib_debug".
* Copy "QuicktimeSDK\Libraries\QTMLClient.lib" to "linden\libraries\i686-win32\lib_release" and to  "linden\libraries\i686-win32\lib_debug".
Line 108: Line 110:
* Copy the contents of "QuicktimeSDK\CIncludes" into "linden\libraries\i686-win32\include\quicktime".
* Copy the contents of "QuicktimeSDK\CIncludes" into "linden\libraries\i686-win32\include\quicktime".


= Building with CMake =
== Building with CMake ==


At this point, you should be ready to use [[CMake]]. '''NOTE''': CMake is only supported for viewer versions 1.21 and beyond.  Before you first run a build, you'll need to configure things.  There's a <code>develop.py</code> script that will create a reasonably sane default configuration for you.
At this point, you should be ready to use [[CMake]]. '''NOTE''': CMake is only supported for Viewer versions 1.21 and beyond.  Before you first run a build, you'll need to configure things.  There's a <code>develop.py</code> script that will create a reasonably sane default configuration for you.


From the command line, '''cd into the indra subdirectory''' and run one of the following commands (depending on your choice of platform and build environment):
From the command line, '''cd into the indra subdirectory''' and run one of the following commands (depending on your choice of platform and build environment):
Line 118: Line 120:
'''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.
'''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.


== Finding your build directory ==
=== Finding your build directory ===


In the CMake world, we keep source and object files separate.  The <code>develop.py</code> script will create and populate a build directory for you.  It should be in one of the following locations:
In the CMake world, we keep source and object files separate.  The <code>develop.py</code> script will create and populate a build directory for you.  It should be in one of the following locations:
Line 124: Line 126:
* VS 2008: <code>'build-vc90'</code>
* VS 2008: <code>'build-vc90'</code>


== Compiling ==
=== Compiling ===


To start a build, do one of the following:
To start a build, do one of the following:
*  Run <code>python develop.py build</code> in the indra directory.
*  Run <code>python develop.py build</code> in the indra directory.
*  Load it into your IDE.  For MSVS VC++:
*  Load it into your IDE.  For MSVS VC++:
** Use "File -> Open -> Project/Solution", and navigate to linden/indra/build-VC80/viewer.vcproj (or build-VC90, as appropriate).
** Use "File -> Open -> Project/Solution", and navigate to linden/indra/build-VC80/Viewer.vcproj (or build-VC90, as appropriate).
** 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.
** 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.
** 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".
** 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".
Line 140: Line 142:
** Good luck!
** Good luck!


== Where's the built viewer? ==
=== Where's the built Viewer? ===


On Windows, the built viewer ought to run from VS2005.
On Windows, the built Viewer ought to run from VS2005.


To run outside MS VS, see Discussion tab:
To run outside MS VS, see Discussion tab:
[[Talk:Microsoft_Windows_Builds#Running_viewer_outside_of_MS_VC]]
[[Talk:Microsoft_Windows_Builds#Running_Viewer_outside_of_MS_VC]]


== Build instructions for 1.20 and earlier ==
=== Build instructions for 1.20 and earlier ===


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




= What to do if it doesn't work for you =
== What to do if it doesn't work for you ==


* Ask for help on [[IRC]] (irc.efnet.org #opensl)
* Ask for help on [[IRC]] (irc.efnet.org #opensl)
Line 160: Line 162:
Please also see the (user contributed) instructions at [[User:Michelle2_Zenovka/cmake]]
Please also see the (user contributed) instructions at [[User:Michelle2_Zenovka/cmake]]


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

Revision as of 09:33, 6 November 2009


On Windows, there are several options on build (compile) environment of the Second Life.

This page explains how you can compile the Viewer on Microsoft Windows.

Currently, only 32 bit binary is tested. There seems to be several trials to produce 64 bit Windows .EXE of the Viewer. If you did, please write your experience on the discussion page (regardless it was successful or not!)

Choosing and preparing a compiler

Linden-supported compilers

Supported compiler: Visual Studio .NET 2005 Professional

You need to setup the compiler and Microsoft Development tools as follows:

Community experimental compilers

If you don't have Visual Studio .NET 2005 Professional, you may wish to try one of the following alternatives.

Warning!

Boost support with Visual Studio 2008 is problematic as of this writing. Check VWR-9541 before continuing on this path.


Getting other development tools

You will need to install the following tools to compile the Viewer:

  • CMake (download CMake)
    • As of this writing, the latest version is 2.6.2. Note: 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.
  • Cygwin (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. (If you missed one of these, the easiest thing to do is to re-run the entire installation.)
  • Python (download either Python.org Standard Python or ActivePython
    • If you are using a version of Python newer than v2.5, you may need to change the Python.cmake file. See the CMake discussion for details (this change was necessary as of 1.21-r99587 source branch). )
  • The Windows Platform SDK
  • DirectX 9.0 SDK

Verify that Cygwin, CMake, and Python are in the windows "PATH".

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 'Python.cmake' file)

Downloading source code

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".

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 develop.py 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.

WARNING:

  • If the directory path you keep the SL source in has a space in it, the batch file that copies message_template.msg will fail. So, if you unzip or checkout the source tree into, e.g., "C:\Projects\Dir with space in name\Etc\linden", it won't work!
  • You should also avoid using non-ASCII (national) characters in the paths, although some localized versions of the tool puts some as a default...
  • 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.

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 sl_1_21_6.

Installing libraries

SL Viewer depends on some third party libraries. Some of them are open source, some others are not.

Open source libraries

As of Viewer version 1.21, all open source libraries are automatically downloaded as part of the build process, unless you choose to configure a standalone build.

Proprietary libraries

Linden does not include the following proprietary libraries. You will need to follow the instructions to acquire below and copy them to the source path.

However, it probably is a good idea to build an empty directory tree for the files below and first copy the files there and once completed, copy the whole tree to the actual source folder (like XCOPY OLIB SL_1_16_0_5 /S). 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 it's own folder). If you do not want to do this, of course you can just copy the files directly into the linden source paths.

rem OLIBS.CMD to build a folder tree for 3rd party libraries and includes
md olibs
md olibs\linden\
md olibs\linden\libraries
md olibs\linden\libraries\include
md olibs\linden\libraries\i686-win32
md olibs\linden\libraries\i686-win32\lib_release
md olibs\linden\libraries\i686-win32\lib_debug
md olibs\linden\libraries\i686-win32\include
md olibs\linden\libraries\i686-win32\include\GL
md olibs\linden\libraries\i686-win32\include\quicktime
md olibs\linden\indra
md olibs\linden\indra\newview


Fmod

  • Download & extract fmod 3.75 api for win32, under section heading FMOD 3 Programmers API (later versions, like FMOD Ex, are incompatible).
  • Copy "fmodapi375win\api\inc\fmod.h" to "linden\libraries\include"
  • Copy "fmodapi375win\api\inc\fmod_errors.h" to "linden\libraries\include"
  • Copy "fmodapi375win\api\lib\fmodvc.lib" to "linden\libraries\i686-win32\lib_release" and to "linden\libraries\i686-win32\lib_debug"

(If using cmake, copy "fmodapi375win\api\lib\fmodvc.lib" to "linden\libraries\i686-win32\lib\release" and to "linden\libraries\i686-win32\lib\debug")

  • Copy "fmodapi375win\api\fmod.dll" to "linden\indra\newview"


Quicktime

Currently - as of version 1.21 - CMake requires Quicktime to be installed.

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 this for details. Remember that your Viewer can't play in-world movies if you do so.

  • Download & install the Quicktime SDK for Windows
  • Copy "QuicktimeSDK\Libraries\QTMLClient.lib" to "linden\libraries\i686-win32\lib_release" and to "linden\libraries\i686-win32\lib_debug".

(If using CMake, copy "QuicktimeSDK\Libraries\QTMLClient.lib" to "linden\libraries\i686-win32\lib\release" and to "linden\libraries\i686-win32\lib\debug" instead)

  • Copy the contents of "QuicktimeSDK\CIncludes" into "linden\libraries\i686-win32\include\quicktime".

Building with CMake

At this point, you should be ready to use CMake. NOTE: CMake is only supported for Viewer versions 1.21 and beyond. Before you first run a build, you'll need to configure things. There's a develop.py script that will create a reasonably sane default configuration for you.

From the command line, cd into the indra subdirectory and run one of the following commands (depending on your choice of platform and build environment):

    • VisualStudio 2005: "python develop.py -G VC80"
    • VisualStudio 2008: "python develop.py -G VC90"

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.

Finding your build directory

In the CMake world, we keep source and object files separate. The develop.py script will create and populate a build directory for you. It should be in one of the following locations:

  • VS 2005: 'build-vc80'
  • VS 2008: 'build-vc90'

Compiling

To start a build, do one of the following:

  • Run python develop.py build in the indra directory.
  • Load it into your IDE. For MSVS VC++:
    • Use "File -> Open -> Project/Solution", and navigate to linden/indra/build-VC80/Viewer.vcproj (or build-VC90, as appropriate).
    • 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.
    • 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".
    • Right-click on ALL_BUILD and choose "Properties". In "Configuration Properties -> Debugging", find "Working Directory" and navigate to "linden\indra\newview".
    • Build -> Build Solution (F7)
    • Debug -> "Start Debugging" or "Start without debugging".
    • MSVC might not be able to find the executable. If not, point it to "linden\indra\build-VC80\newview\relwithdebinfo\secondlife-bin.exe", and try again.
    • You may see an error due to not being able to find fmod.dll. If so, find a copy (remember, you copied this in a step above) and copy it into "indra\build-VC80\newview\relwithdebinfo". Try again.
    • You may see an error due to not finding llkdu.dll. If so, find it in the normal installed version (make sure it's the same version as your source) and copy it into "indra\build-VC80\newview\relwithdebinfo". Try again.
    • Good luck!

Where's the built Viewer?

On Windows, the built Viewer ought to run from VS2005.

To run outside MS VS, see Discussion tab: Talk:Microsoft_Windows_Builds#Running_Viewer_outside_of_MS_VC

Build instructions for 1.20 and earlier

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.


What to do if it doesn't work for you

Please also see the (user contributed) instructions at User:Michelle2_Zenovka/cmake