Difference between revisions of "Compiling the viewer (Mac OS X)"
(the old information had said that 4.3.3 is needed, but from the Apple site the file is just selected as 4.3 (which I believe is actually 4.3.3) removed the extra .3 to prevent confusion) |
m |
||
Line 3: | Line 3: | ||
For recent information check the [[Project Snowstorm]] page. | For recent information check the [[Project Snowstorm]] page. | ||
= Getting Development Tools = | ==Getting Development Tools== | ||
* '''Xcode 4''': Xcode 4.6 is now supported for building, but involves also downloading Xcode 4.3 and following the steps explained below: [[Compiling_the_viewer_(Mac_OS_X)#Updating_Xcode_4.6]]. ''We hope to have eliminated this hack soon''. | |||
* '''Xcode 4''': Xcode 4.6 is now supported for building | * '''CMake''': Install CMake from [http://www.cmake.org cmake.org], or using [http://macports.org/ MacPorts] with 'port install cmake'. You will need at least CMake 2.8.8. | ||
* '''CMake''': Install CMake from [http://www.cmake.org cmake.org], or using [http://macports.org/ MacPorts] with 'port install cmake'. You will need at least CMake 2. | |||
*'''Command line Makefiles''': These are included in Apple's Xcode product. Download and install Xcode from Apple. | *'''Command line Makefiles''': These are included in Apple's Xcode product. Download and install Xcode from Apple. | ||
<!-- I think this is obsolete... Oz | |||
Note: I had to get ''bison'' and ''flex'' from MacPorts; strangely enough, the ones provided by Xcode didn't install properly. ''bison'' needs to be 2.3 (2.6 and 2.7 will throw an error), ''flex'' was tested with 2.5.35. | Note: I had to get ''bison'' and ''flex'' from MacPorts; strangely enough, the ones provided by Xcode didn't install properly. ''bison'' needs to be 2.3 (2.6 and 2.7 will throw an error), ''flex'' was tested with 2.5.35. | ||
--> | |||
= Downloading Source Code = | ==Downloading Source Code== | ||
Linden Lab [[ Project Snowstorm]] uses [http://mercurial.selenica.com Mercurial] and [http://bitbucket.org Bit Bucket] for the [[version control repository]]. | Linden Lab [[ Project Snowstorm]] uses [http://mercurial.selenica.com Mercurial] and [http://bitbucket.org Bit Bucket] for the [[version control repository]]. | ||
The repository is | The repository is http://hg.secondlife.com/viewer-release | ||
==Installing Proprietary Libraries== | |||
= 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.) | 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 == | ===Fmod=== | ||
=== Fmod method 1 (using autobuild) === | ==== Fmod method 1 (using autobuild) ==== | ||
CD to where you want to install the 3p-fmod repository and do: | CD to where you want to install the 3p-fmod repository and do: | ||
Line 60: | Line 47: | ||
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]. | 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]. | ||
=== Fmod method 2 (using system module) === | ==== Fmod method 2 (using system module) ==== | ||
(to be written) | (to be written) | ||
= Configuration and Building = | ==Configuration and Building== | ||
== With Autobuild == | ===With Autobuild=== | ||
This is the preferred method (the one the Lindens consider "normal"). | |||
Configuring and building with autobuild works the same on all platforms. Full instructions may be found at [[Build_Viewer_With_Autobuild]]. | Configuring and building with autobuild works the same on all platforms. Full instructions may be found at [[Build_Viewer_With_Autobuild]]. | ||
Example: | Example: | ||
== On Xcode == | autobuild configure -c RelWithDebInfoOS -- -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE | ||
autobuild build -c RelWithDebInfoOS --no-configure | |||
===On 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'''. | 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== | |||
= | ===On Console=== | ||
In your source tree root directory, run: | |||
$build-darwin-i386/newview/''configuration-type''/Second\ Life.app/Contents/MacOS/Second\ Life | |||
$build-darwin-i386/newview/ | where ''configuration-type'' depends on your built configuration ("DebugOS", "ReleaseOS" or "RelWithDebInfoOS"). | ||
where | |||
== On Xcode == | ===On Xcode=== | ||
"secondlife-bin" scheme is what you look for. | "secondlife-bin" scheme is what you look for. | ||
== Using Finder == | ===Using Finder=== | ||
# Navigate to | # Navigate to <tt>build-darwin-i386/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. | ||
==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-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. | 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. | ||
Line 122: | Line 107: | ||
* Fix it: [[Modifying CMake Files]] and please, submit a patch! | * Fix it: [[Modifying CMake Files]] and please, submit a patch! | ||
== Getting Help == | ===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. | 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. | ||
Line 128: | Line 113: | ||
* 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 | ===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]]. | 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]]. | ||
---- | |||
== Updating Xcode 4.6 == | |||
If you use Xcode 4.6, you need to do these additional steps to succeed in building: | |||
# Download Xcode 4.6.x, install and run - install command line tools via Preferences->Downloads and anything else it ask for then quit. | |||
# Download Xcode 4.3 from the Apple Developer site | |||
# Mount xcode_4.3_for_lion.dmg | |||
# Pull down the xcode_fix script from: https://bitbucket.org/jj_linden/build-scripts | |||
# Run the script in a folder you have write permissions for. You will need to enter your password for the sudo commands in the script. | |||
The script will pull the MacOSX 10.6 SDK from the 4.3 installer into a temporary folder ('temp') that it creates and will unpack the SDK to be used by Xcode 4.6. Then the temporary folder will be deleted. | |||
[[Category:Compiling viewer]] | [[Category:Compiling viewer]] |
Revision as of 09:05, 9 August 2013
For recent information check the Project Snowstorm page.
Getting Development Tools
- Xcode 4: Xcode 4.6 is now supported for building, but involves also downloading Xcode 4.3 and following the steps explained below: Compiling_the_viewer_(Mac_OS_X)#Updating_Xcode_4.6. We hope to have eliminated this hack soon.
- CMake: Install CMake from cmake.org, or using MacPorts with 'port install cmake'. You will need at least CMake 2.8.8.
- Command line Makefiles: These are included in Apple's Xcode product. Download and install Xcode from Apple.
Downloading Source Code
Linden Lab Project Snowstorm uses Mercurial and Bit Bucket for the version control repository. The repository is http://hg.secondlife.com/viewer-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.)
Fmod
Fmod method 1 (using autobuild)
CD to where you want to install the 3p-fmod repository and do:
$ hg clone https://bitbucket.org/lindenlab/3p-fmod $ cd 3p-fmod $ autobuild build --all $ autobuild package
You will see the result looks like:
packing fmod wrote /3p-fmod/fmod-3.75-darwin-20120614.tar.bz2 md5 527422281dbe49abac29380996d41230
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 fmod platform=darwin hash=527422281dbe49abac29380996d41230 url=file:///3p-fmod/fmod-3.75-darwin-20120614.tar.bz2
Note: FMOD does not host the appropriate version any longer. You will need fmodapi375mac.zip from elsewhere; currently, Kittin Ninetails is hosting it on her SkyDrive.
Fmod method 2 (using system module)
(to be written)
Configuration and Building
With Autobuild
This is the preferred method (the one the Lindens consider "normal").
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 -- -DPACKAGE:BOOL=FALSE -DFMOD:BOOL=TRUE autobuild build -c RelWithDebInfoOS --no-configure
On 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
On Console
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").
On Xcode
"secondlife-bin" scheme is what you look for.
Using Finder
- Navigate to build-darwin-i386/newview/configuration-type.
- 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:
- This talk page (Report useful experiences there)
- Issue list below (If new issues, please add it to talk page above instead of there)
- Old talk page
- Common compilation problems (Rather old)
- Issue tracker
- Fix it: Modifying CMake Files and please, submit a patch!
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.
- Subscribe to OpenSource-Dev Mailing List (subscribe) and post your question there.
- For faster response, join the general open source viewer discussion and development IRC channel #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.
Updating Xcode 4.6
If you use Xcode 4.6, you need to do these additional steps to succeed in building:
- Download Xcode 4.6.x, install and run - install command line tools via Preferences->Downloads and anything else it ask for then quit.
- Download Xcode 4.3 from the Apple Developer site
- Mount xcode_4.3_for_lion.dmg
- Pull down the xcode_fix script from: https://bitbucket.org/jj_linden/build-scripts
- Run the script in a folder you have write permissions for. You will need to enter your password for the sudo commands in the script.
The script will pull the MacOSX 10.6 SDK from the 4.3 installer into a temporary folder ('temp') that it creates and will unpack the SDK to be used by Xcode 4.6. Then the temporary folder will be deleted.