Difference between revisions of "Viewer 2 Microsoft Windows Builds"

From Second Life Wiki
Jump to navigation Jump to search
(Add instructions for Snowstorm users)
m (Redirected page to Visual Studio 2013 Viewer Builds)
 
(411 intermediate revisions by 25 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 18 April 2010.}}
 
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 (2005, 2008, 2010) (Express is OK)
** [http://www.microsoft.com/express/download/ Click here to download Visual C++ Express - current version is VS2010]
** Note: LL still uses VS2005 internally, which uses the VC80 libraries.  VS2008 uses the VC90 libraries. VS2010 TBD (test with the VC90 libraries new ones for VC100 may need to be made).
* Install Microsoft Platform & DirectX SDKs
** Download and install [http://www.microsoft.com/downloads/details.aspx?FamilyID=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en Windows SDK for Windows Server 2008 and .NET Framework 3.5]
** Download and install [http://www.microsoft.com/downloads/details.aspx?FamilyID=ea4894b5-e98d-44f6-842d-e32147237638&DisplayLang=en DirectX SDK (August 2008)]
 
* Install other development tools
** '''UniCode NSIS'''([http://www.scratchpaper.com/home/downloads download Unicode NSIS])
***  This is the package installer used to build Setup.exe. <b>Note</b>: As of this writing the file is downloaded with an *.exec extension that needs renamed *.exe.--[[User:Nicky Perian|Nicky Perian]] 16:22, 30 March 2010 (UTC)
** '''CMake''' ([http://www.cmake.org/HTML/Download.html download CMake])
*** must be version 2.6.2 or higher (and ensure any older 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.
** '''Python''' (download either [http://www.python.org/download/ Python.org Standard Python] or  [http://www.activestate.com/Products/ActivePython/?mp=1 ActivePython]) Note: build scripts support Python 2.6, not 2.7 yet.
 
*'''SVN software:'''(added by [[User:WolfPup Lowenhar|WolfPup Lowenhar]] 02:16, 19 April 2010 (UTC) )
**'''TortoiseSVN:''' http://tortoisesvn.net/
***'''Download Page:'''
****[http://tortoisesvn.net/downloads TortoiseSVN Downloads](contains link to 32-bit and 64-bit intsallers)
 
 
If you use SVN software I suggest actually using the same file tree as LL does that way it will be easier to talk about some thing in a particular folder or file with your fellow builders.
 
== Download and compile libraries that must be manually added to each LL source release ==
 
It is probably 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. Then, if you obtain a new batch of source code, you can save some steps.
 
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
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
 
SVN folder tree - for simplicity of copying files to your build folder
  trunk\indra\newview
  trunk\libraries\i686-win32\include\GL
  trunk\libraries\i686-win32\include\quicktime
  trunk\libraries\i686-win32\lib\debug
  trunk\libraries\i686-win32\lib\release
           
 
=== Quicktime ===
 
* Download & install the [http://developer.apple.com/quicktime/download/ Quicktime SDK for Windows] (login may be necessary).
* copy "QuicktimeSDK\Libraries\QTMLClient.lib" to "olibs\linden\libraries\i686-win32\lib\release" and to "olibs\linden\libraries\i686-win32\lib\debug"
* Copy the contents of "QuicktimeSDK\CIncludes" into "olibs\linden\libraries\i686-win32\include\quicktime".
 
=== Fmod ===
* Download & extract [http://www.fmod.org/files/fmod3/fmodapi375win.zip FMOD3.75 API for Windows]. (later versions, like FMOD Ex, are incompatible).
* Copy "fmodapi375win\api\inc\fmod.h" to "olibs\linden\libraries\include"
* Copy "fmodapi375win\api\inc\fmod_errors.h" to "olibs\linden\libraries\include"
* Copy "fmodapi375win\api\inc\fmoddyn.h" to "olibs\linden\libraries\include"
* Copy "fmodapi375win\api\lib\fmodvc.lib" to "olibs\linden\libraries\i686-win32\lib\release" and to "olibs\linden\libraries\i686-win32\lib\debug"
* Copy "fmodapi375win\api\fmod.dll" to "olibs\linden\indra\newview"
 
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 linden\indra anymore, all the files are under linden\libraries like for other 3rd party libraries. The fmodvc.lib however needs to be renamed fmod.lib. The new instructions are:
* Download & extract [http://www.fmod.org/files/fmod3/fmodapi375win.zip FMOD3.75 API for Windows]
* From <code>fmodapi375win\api\inc\</code>, copy <code>fmod.h</code> and <code>fmod_errors.h</code> to <code>linden\libraries\include</code>
* From <code>fmodapi375win\api\lib</code>, choose the relevant .lib 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>
* 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>
 
=== Boost ===
 
Only needed if not using VS2005.
 
* Grab the files that Robin Cornelius has precompiled at
http://www.byteme.org.uk/downloads/boost_1_39_VC90_no_scl_shared_crt_static_link.zip
* If you get the zip file from Robin Cornelius copy the libraries folder into the the tree you made above for  fmod and QuickTime files that way you have a ready back up of those files for if you update your build directory from the SVN server.
* or alternatively follow the instructions from the 25/Feb/10 and 15/Apr/10 entries of http://jira.secondlife.com/browse/VWR-9541
 
((TBD: verify, simplify, fix))
 
=== cares ===
TBD
 
== Set up your source code tree ==
 
LL distributes the source code in three parts: the source package, the artwork package, and the library package.  You should choose whether to use a snapshot or SVN checkout.  You'll need art and libraries from a snapshot if you use the SVN method.
 
* Unzip or checkout your source tree into a directory that has as short full pathname as possible, with NO SPACES in it, to avoid trouble in the build scripts. A sugestion would be to use the same dev tree as LL as all folder names are short and do not have any spaces.
 
* Example:  ((specific snapshot example TBD; SVN example also ))
 
* Copy your "olibs" from above into the source tree.
 
== Fix known problems with the source code tree ==
 
TBD - edits to scripts that must be made for windows VC90 builds to succeed?
 
Known Problems:
* /indra/cmake/Boost.cmake file has to be edited as shown in [http://jira.secondlife.com/browse/VWR-9541?focusedCommentId=168967&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_168967 VWR-9541] in order to use the boost files in VS2008.
 
== Initial build steps using develop.py and CMake ==
 
You may notice that there's no Visual Studio project file as part of the distributed source tree.  That's because it is GENERATED in this step using command-line tools.  Only after this step can you begin using the IDE.
 
* open a Command Prompt window
 
* Run develop.py --
** From the command line, '''cd into the indra subdirectory'''
** Run <code>"develop.py -G VC90"</code> or <code>"python develop.py -G VC90"</code> NOTE: use <code> -G VC80 </code> if you are using VS2005
NOTE: Some resources may be downloaded automatically at this point if they do not yet exist.
 
** The <code>develop.py</code> script will create and populate a build directory for you.  It should be in <code>'build-vc90'</code> or <code>'build-vc80'</code> if using VS2005
 
When it completes you will get your command prompt back and it should say something like:
 
Trying to set active config to "RelWithDebInfo"
  Success!
Trying to set "secondlife-bin" to the startup project
  Success!
got ret 0 from tools\vstool\VSTool.exe --solution build-VC80\SecondLife.sln --config RelWithDebInfo --startup secondlife-bin
 
== Compile using the IDE ==
 
* Run Visual Studio.
* Configure Visual Studio.
**Use Tools>Options to get the Options window open.
**Goto Projects and Solutions>VC++ Directories and set the following:
Executable Files:
$(SystemRoot)
$(SystemRoot)\System32
$(SystemRoot)\System32\wbem
$(VCInstallDir)bin
$(VCInstallDir)PlatformSDK\bin
$(VCInstallDir)PlatformSDK\common\bin
$(VSInstallDir)Common7\Tools\bin
$(VSInstallDir)Common7\tools
$(VSInstallDir)Common7\ide
$(ProgramFiles)\HTML Help Workshop
$(FrameworkSDKDir)bin
$(FrameworkDir)$(FrameworkVersion)
$(VSInstallDir)
C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin
C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin
C:\Python26
C:\Program Files\NSIS
$(SystemRoot)\SysWow64  (needed in Vista and 7 64-bit version)
$(FxCopDir)
$(PATH)
C:\cygwin\bin
 
Included Files:
$(VCInstallDir)include
$(VCInstallDir)atlmfc\include
$(VCInstallDir)PlatformSDK\include
$(VCInstallDir)PlatformSDK\common\include
$(FrameworkSDKDir)include
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\gl
C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\winui\TSF\tsfapp
C:\Program Files\Microsoft SDKs\Windows\v6.1\Include
C:\Program Files\Microsoft SDKs\Windows\v6.1\Include\gl
C:\Program Files\Microsoft SDKs\Windows\v6.1\Samples\winui\TSF\tsfapp
C:\Program Files\Microsoft DirectX SDK (February 2010)\Include
 
Library Files:
$(VCInstallDir)lib
$(VCInstallDir)atlmfc\lib
$(VCInstallDir)atlmfc\lib\i386
$(VCInstallDir)PlatformSDK\lib
$(VCInstallDir)PlatformSDK\common\lib
$(FrameworkSDKDir)lib
$(VSInstallDir)
$(VSInstallDir)lib
C:\Program Files\Microsoft SDKs\Windows\v7.0\Lib
C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib
C:\Program Files\Microsoft DirectX SDK (February 2010)\Lib\x86
 
* Use "File -> Open -> Project/Solution", navigate to linden/indra/build-VC90/Viewer.vcproj, and open it.
** if you can't find this file, perhaps your previous run of develop.py failed.
* 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)
 
== Iteratively fix things until the compile succeeds ==
 
((TBD - add any fixup steps here.  e.g. does fmod375.dll need to be moved into RelWithDbgInfo at this step?))
 
* report your experiences, if useful, on the talk page, https://wiki.secondlife.com/wiki/Talk:Viewer_2_Microsoft_Windows_Builds
* ask for help on the SL "Snowglobe" group or the opensource-dev mailing list.
 
== Common Issues/Bugs/Glitches And Solutions ==
Applies to Visual C++ 2005 Express:
<br/><br/>
If you run into an issue when running develop.py similar to this:
<br/><br/>
1>Linking...<br/>
1>link: extra operand `/ERRORREPORT:QUEUE'<br/>
1>Try `link --help' for more information.<br/>
1>Project : error PRJ0002 : Error result 1 returned from 'C:\cygwin\bin\link.exe'.<br/>
<br/>
You may have not configured Visual Studio properly. The articles in this wiki in regards to the setup of executable paths do not specify an order or priority, but you must make sure that the CYGWIN executable path is set lower in the list than the VC++ paths, otherwise develop.py winds up executing the CygWin Link.exe which won't work.<br/><br/>
This issue has also been seen when using the Windows Command Prompt instead of the command prompt within VC++ (Visual Studio 2010?).
 
== 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 11:26, 23 April 2015