Difference between revisions of "Build the Viewer on macOS"

From Second Life Wiki
Jump to navigation Jump to search
m
m (fix instructions for local package builds (and a few other minor cleanups))
Line 1: Line 1:
{{Multi-lang}}
{{Multi-lang}}
{{CompileNav}}
{{CompileNav}}
 
{{TOC}}
{{KBwarning|This page is new and still under construction. Please note problems on the talk page, or send email to Oz}}
{{KBwarning|This page is new and still under construction. Please note problems on the talk page, or send email to Oz}}


Line 21: Line 21:


{{KBnote|Because using the new tools required source code changes, these instructions '''do not work with the canonical viewer-release repository'''.
{{KBnote|Because using the new tools required source code changes, these instructions '''do not work with the canonical viewer-release repository'''.
Use
https://bitbucket.org/lindenlab/viewer-tools-update
when those changes are moved to viewer-release, these instructions will work for release.
}}
==Installing Proprietary Libraries==


Use https://bitbucket.org/lindenlab/viewer-tools-update}}
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.)


==Installing Proprietary Libraries==
===Fmodex===
 
PIck somewhere to build your fmodex package:


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.)
  hg clone <nowiki>https://bitbucket.org/lindenlab/3p-update-fmodex</nowiki>
  cd 3p-update-fmodex
  autobuild build --all
  autobuild package


===Fmod===
If it works, it will produce a package archive file with a name like <tt>fmodex-4.44.31.201503051234-darwin-201503051234.tar.bz2</tt>


{{KBwarning|this section is probably wrong}}
CD to your viewer repository root; you can either just override the configured archive with a --local install:


==== Fmod method 1 (using autobuild) ====
autobuild install --local ''path-to-your-fmodex-archive''


CD to where you want to install the 3p-fmod repository and do:
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.
<pre>
$ hg clone <nowiki>https://bitbucket.org/lindenlab/3p-fmod</nowiki>
$ cd 3p-fmod
$ autobuild build --all
$ autobuild package
</pre>


You will see the result looks like:
To reconfigure your autobuild configuration file to use that archive:
<pre>
packing fmod
wrote  /3p-fmod/fmod-3.75-darwin-20120614.tar.bz2
md5    527422281dbe49abac29380996d41230
</pre>


CD to your repository root and update autobuild configulation file with the filename and hash just displayed. For the example above, run:
autobuild installables edit fmodex url=file:///''path-to-your-fmodex-archive''
<pre>
$ autobuild installables edit fmod platform=darwin hash=527422281dbe49abac29380996d41230 url=file:///3p-fmod/fmod-3.75-darwin-20120614.tar.bz2
</pre>


Note: FMOD does not host the appropriate version any longer. You will need fmodapi375mac.zip from elsewhere; currently, [https://my.secondlife.com/kittin.ninetails Kittin Ninetails] is hosting it on her [http://cid-6a2f42d7b470f408.office.live.com/browse.aspx/Public/Second%20Life SkyDrive].
but be careful not to commit that change, since it will be useless to anyone who can't access the path you configured.


==Configuration and Building==
==Configuration and Building==
Line 64: Line 60:
Example:
Example:


  autobuild configure -c RelWithDebInfoOS -- -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE
  autobuild configure -c RelWithDebInfoOS  
 
if you built your own fmodex as above, add <tt>-- -DFMOD:BOOL=TRUE</tt>


===Command Line Build===
===Command Line Build===
Line 70: Line 68:
  autobuild build --no-configure
  autobuild build --no-configure


you can omit the --no-configure option, if you do autobuild will implicitly run the configuration step
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.


===Building within Xcode===
===Building within Xcode===
Line 82: Line 80:
In your source tree root directory, run:
In your source tree root directory, run:


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


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 119: Line 117:
* Subscribe to [[OpenSource-Dev|OpenSource-Dev Mailing List]] ([https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev subscribe]) and post your question there.
* Subscribe to [[OpenSource-Dev|OpenSource-Dev Mailing List]] ([https://lists.secondlife.com/cgi-bin/mailman/listinfo/opensource-dev subscribe]) and post your question there.
* For faster response, join the general open source viewer discussion and development [[IRC]] channel [irc://irc.freenode.org/opensl #opensl on freenode].  Hopefully a helpful person is online when you ask your question.
* For faster response, join the general open source viewer discussion and development [[IRC]] channel [irc://irc.freenode.org/opensl #opensl on freenode].  Hopefully a helpful person is online when you ask your question.
===Submitting Changes===
This is probably far down the road, but if you make changes to the source and want to submit them, see the page about [[Submitting patches|submitting patches]].


----
----
[[Category:Compiling viewer]]
[[Category:Compiling viewer]]

Revision as of 16:27, 4 March 2015

KBwarning.png Warning: This page is new and still under construction. Please note problems on the talk page, or send email to Oz

Getting Development Tools

Xcode 6.1
download Xcode 6.1 from Apple, and install the developer command line tools
CMake
Install CMake version 3.1 from cmake.org
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.0
Install the new version of autobuild as described on Autobuild Improvements

Downloading Source Code

The canonical repository is https://hg.secondlife.com/viewer-release

KBnote.png Note: Because using the new tools required source code changes, these instructions do not work with the canonical viewer-release repository.

Use

https://bitbucket.org/lindenlab/viewer-tools-update

when those changes are moved to viewer-release, these instructions will work for release.

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

Fmodex

PIck somewhere to build your fmodex package:

hg clone https://bitbucket.org/lindenlab/3p-update-fmodex
cd 3p-update-fmodex
autobuild build --all
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.

Configuration and Building

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 -- -DFMOD:BOOL=TRUE

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.

Building within Xcode

If you have followed the configure instructions from Build_Viewer_With_Autobuild, 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.

Running your newly built viewer

Command Line

In your source tree root directory, run:

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

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

Running within Xcode

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

Using Finder

  1. Navigate to build-darwin-i386/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-i386/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.