Difference between revisions of "Build the Viewer on macOS"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 2: Line 2:
{{CompileNav}}
{{CompileNav}}
{{TOC}}
{{TOC}}
{{KBwarning|
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|custom=Attend Carefully|
{{KBcaution|custom=Attend Carefully|
The 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 (but feel free to share your results.}}
The 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 (but feel free to share your results.}}
Line 7: Line 14:
==Getting Development Tools==
==Getting Development Tools==


;Xcode 7
;OSX
:Download and install Xcode 7 from the Apple App Store
:These instructions assume that you are running OSX 10.12
;Xcode 8
:Download and install Xcode 8 from the Apple App Store
:Install the developer command line tools by running the command <tt>xcode-select --install</tt>
:Install the developer command line tools by running the command <tt>xcode-select --install</tt>
:Accept the xcode license by running the command <tt>sudo xcodebuild -license</tt> ; this diplays the license: page to the end and type <tt>agree</tt>
:Accept the xcode license by running the command <tt>sudo xcodebuild -license</tt> ; this diplays the license: page to the end and type <tt>agree</tt>
Line 18: Line 27:
:Install the current Mercurial from [http://mercurial.selenic.com/downloads Selenic]
:Install the current Mercurial from [http://mercurial.selenic.com/downloads Selenic]
::If you may be contributing code back to the viewer, install the [[Mercurial_Tools#Coding_Policy|Mercurial Coding Policy hooks]]
::If you may be contributing code back to the viewer, install the [[Mercurial_Tools#Coding_Policy|Mercurial Coding Policy hooks]]
;Autobuild 1.0
;Autobuild 1.1
:Install the new version of autobuild as described on [[Autobuild]]
:Install the new version of autobuild as described on [[Autobuild]]


==Downloading Source Code==
==Downloading Source Code==


The canonical repository is https://bitbucket.org/lindenlab/viewer-release
The canonical viewer repository is https://bitbucket.org/lindenlab/viewer-release '''but for these instructions use https://bitbucket.org/lindenlab/viewer64'''


==Installing Proprietary Libraries==
==Installing Proprietary Libraries==
Line 74: Line 83:
===Building within Xcode===
===Building within Xcode===


Once you have run the <tt>autobuild configure</tt> step, the directory ''build-darwin-i386'' will have been created in the root of your source distribution.  Inside that directory you will find the ''SecondLife.xcodeproj'' project file which can be used with Xcode.  When opened it should be configured correctly to build, so just '''Build and Run'''.  If it prompts you to automatically create schemes, let it do so.
Once you have run the <tt>autobuild configure</tt> step, the directory ''build-darwin-x86_64'' will have been created in the root of your source distribution.  Inside that directory you will find the ''SecondLife.xcodeproj'' project file which can be used with Xcode.  When opened it should be configured correctly to build, so just '''Build and Run'''.  If it prompts you to automatically create schemes, let it do so.


==Running your newly built viewer==
==Running your newly built viewer==
Line 80: Line 89:
===Command Line===
===Command Line===


In your source tree root directory, run:
To launch the viewer you build, from your source tree root directory, run:


build-darwin-i386/newview/''configuration-type''/Second\ Life.app/Contents/MacOS/Second\ Life
  open build-darwin-x86_64/newview/''configuration-type''/Second\ Life.app


where ''configuration-type'' depends on your built configuration ("DebugOS", "ReleaseOS" or "RelWithDebInfoOS").
where ''configuration-type'' depends on your built configuration ("DebugOS", "ReleaseOS" or "RelWithDebInfoOS").
Line 94: Line 103:
===Using Finder===
===Using Finder===


# Navigate to <tt>build-darwin-i386/newview/''configuration-type''</tt>.
# Navigate to <tt>build-darwin-x86_64/newview/''configuration-type''</tt>.
# Double click the application.
# Double click the application.
:You can create and put the alias wherever you find convenient.
:You can create and put the alias wherever you find convenient.
Line 100: Line 109:
==Running the Unit Tests==
==Running the Unit Tests==


From Xcode, open the project ''build-darwin-i386/test/test.xcodeproj'' and select "test" for scheme and run. ''SecondLife.xcodeproj'' project also has "test" scheme.
From Xcode, open the project ''build-darwin-x86_64/test/test.xcodeproj'' and select "test" for scheme and run. ''SecondLife.xcodeproj'' project also has "test" scheme.


==Handling Problems==
==Handling Problems==

Revision as of 10:12, 16 June 2017

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 Attend Carefully The 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 (but feel free to share your results.

Getting Development Tools

OSX
These instructions assume that you are running OSX 10.12
Xcode 8
Download and install Xcode 8 from the Apple App Store
Install the developer command line tools by running the command xcode-select --install
Accept the xcode license by running the command sudo xcodebuild -license ; this diplays the license: page to the end and type agree
CMake
Install CMake (at least version 3.1) from cmake.org
You will need to arrange for the cmake executable to be in your PATH.
The executable is '/Applications/CMake.app/Contents/bin/cmake'. Add that directory to your PATH, or create a symlink to the cmake executable in some directory that's in your PATH
Mercurial
Install the current Mercurial from Selenic
If you may be contributing code back to the viewer, install the Mercurial Coding Policy hooks
Autobuild 1.1
Install the new version of autobuild as described on Autobuild

Downloading Source Code

The canonical viewer repository is https://bitbucket.org/lindenlab/viewer-release but for these instructions use https://bitbucket.org/lindenlab/viewer64

Installing Proprietary Libraries

Some builds of the the Viewer depends on proprietary libraries (alternative open source libraries are also provided for developers who prefer or are not licensed to use the proprietary libraries). Lindens do not distribute these libraries, so you will need to fetch and install these even if you download the libraries packages. (This is due to licensing restrictions. Don't ask, Lindens already did, and can't get permission. So you do have to get them yourself.)

FMOD Ex

PIck somewhere to build your fmodex package:

hg clone https://bitbucket.org/lindenlab/3p-fmodex
cd 3p-fmodex
autobuild build 
autobuild package

If it works, it will produce a package archive file with a name like fmodex-4.44.31.201503051234-darwin-201503051234.tar.bz2

CD to your viewer repository root; you can either just override the configured archive with a --local install:

autobuild install --local path-to-your-fmodex-archive

That will cause autobuild to ignore the configured value and use your local package archive; if you delete your build directory, you'll need to repeat the override command.

To reconfigure your autobuild configuration file to use that archive:

autobuild installables edit fmodex url=file:///path-to-your-fmodex-archive

but be careful not to commit that change, since it will be useless to anyone who can't access the path you configured.

Configuring

Configuring your build with Autobuild

Configuring and building with autobuild works the same on all platforms. Full instructions may be found at Build_Viewer_With_Autobuild.

Example:

autobuild configure -c RelWithDebInfoOS 

if you built your own fmodex as above, add -- -DFMODEX:BOOL=TRUE

Building

Command Line Build

autobuild build --no-configure

you can omit the --no-configure option: if you do, autobuild will implicitly run the configuration step before building. That's harmless, it just takes some extra time, but be sure to include any configuration options such as that for fmodex above.

Building within Xcode

Once you have run the autobuild configure step, the directory build-darwin-x86_64 will have been created in the root of your source distribution. Inside that directory you will find the SecondLife.xcodeproj project file which can be used with Xcode. When opened it should be configured correctly to build, so just Build and Run. If it prompts you to automatically create schemes, let it do so.

Running your newly built viewer

Command Line

To launch the viewer you build, from your source tree root directory, run:

 open build-darwin-x86_64/newview/configuration-type/Second\ Life.app

where configuration-type depends on your built configuration ("DebugOS", "ReleaseOS" or "RelWithDebInfoOS").

Running within Xcode

"secondlife-bin" scheme is what you look for.

When running from the XCode IDE be sure to go to ProductSchemeEdit Scheme menu. Select the Run section and uncheck the box labeled "Allow debugging when using document Versions Browser" on the Options tab. (See this thread.)

Using Finder

  1. Navigate to build-darwin-x86_64/newview/configuration-type.
  2. Double click the application.
You can create and put the alias wherever you find convenient.

Running the Unit Tests

From Xcode, open the project build-darwin-x86_64/test/test.xcodeproj and select "test" for scheme and run. SecondLife.xcodeproj project also has "test" scheme.

Handling Problems

If you encounter errors or run into problems following the instructions above, please first check whether someone else already had the same issue. A solution might be known already.

You may find the solution in any of these resources:

Getting Help

Even when no description of your problem has been written down yet, someone might know about it, so get in touch with the community to get help.