Changes between Version 69 and Version 70 of MacBuild


Ignore:
Timestamp:
Jul 17, 2012, 12:57:26 AM (12 years ago)
Author:
charlief
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MacBuild

    v69 v70  
    11= Building BOINC Client and Manager on Macintosh OS X =
    2 '''Last updated 1/26/12'''
    3 
    4 This document applies to BOINC version 6.13.9 and later.  It has instructions for building the BOINC Client and Manager for Macintosh OS X. For information on building science project applications to run under BOINC on Macintosh OSX, see BuildMacApp.
    5 
    6 Note: the information in this document changes from time to time for different versions of BOINC. For any version of BOINC source files, the corresponding version of this document can be found in the source tree at:
     2'''Last updated 7/17/12'''
     3
     4This document applies to BOINC version 7.0.32 and later.  It has instructions for building the BOINC Client and Manager for Macintosh OS X. For information on building science project applications to run under BOINC on Macintosh OSX, see BuildMacApp.
     5
     6'''Note''': the information in this document changes from time to time for different versions of BOINC. For any version of BOINC source files, the corresponding version of this document can be found in the source tree at:
    77
    88{{{
     
    2323Although BOINC supports 64-bit Intel project applications on Mac OS 10.5.0 and above, the only part of the BOINC client package built as a 64-bit executable is the screensaver coordinator for OS 10.6.x and later.  The BOINC libraries also include a 64-bit build so that they can be linked with 64-bit project applications.
    2424
    25 You need to take certain steps to ensure that you use only APIs that are available in all the OS versions BOINC supports for each architecture. The best way to accomplish this is to use a single development system running OS 10.7.x and cross-compile for the various platforms. The remainder of this document describes that process.
    26 
    27 '''The above requirements apply not only to BOINC itself, but also to the !WxWidgets, JPEG, c-ares and cURL libraries, as well as all project applications.''' Note: only the JPEG library must be built for  the x86_64 architecture, since it is used by the libboinc_graphics_api library.
     25You need to take certain steps to ensure that you use only APIs that are available in all the OS versions BOINC supports for each architecture. The best way to accomplish this is to use a single development system running OS 10.7.x or OS 10.8.x and cross-compile for the various platforms. The remainder of this document describes that process.
     26
     27'''The above requirements apply not only to BOINC itself, but also to the !WxWidgets, c-ares, cURL and openSSL libraries, as well as all project applications.'''
    2828
    2929Be sure to follow the directions in this document to ensure that these requirements are met.
    3030
    31 Starting with version 6.1.0, the BOINC Client supports only Mac OS X 10.3.9 and later; support for OS 10.3.0 through 10.3.8 has been discontinued.  This allows us to build the BOINC Client and Manager using only GCC 4.0, which offers a number of advantages.
    32 
    33 Starting with version 6.10.58,  the BOINC Client supports only Mac OS X 10.4.0 and later.  This allows it to be built with XCode 3.2 under OS 10.6.x, which does not support the Mac OS 10.3.9 SDK.
     31Starting with version 6.10.58,  the BOINC Client supports only Mac OS X 10.4.0 and later.  This allows it to be built with XCode 3.2 and later, which do not support the Mac OS 10.3.9 SDK.
    3432
    3533
    3634== Cross-Platform Development ==
    3735
    38 Apple provides the tools necessary to cross-compile for both BOINC Mac platforms on any Mac running OS 10.6.x or OS 10.7.x.
     36Apple provides the tools necessary to cross-compile for both BOINC Mac platforms on any Mac running OS 10.7.x or OS 10.8.x.
    3937
    4038You get these tools, including the GCC compilers and system library header files, by installing the XCode Tools package.
    4139
    42 '''Building BOINC now requires Xcode Tools version 3.2 or later but Xcode 4.2 or later is recommended.''' 
    43 
    44 If you have the OS 10.6 installation DVD for your system, you can install XCode Tools at the time you install the OS, or you can install it later by opening the file `Optional Installs/XCode Tools/XCodeTools.mpkg`.
    45 
    46 You can download Xcode 3.2 or 4.2 from Apple's web site (it is large: 1.1 GB).  You must be a member of the Apple Developer Connection to download the software, but you can join for free at:
    47 http://connect.apple.com
     40'''Building BOINC now requires Xcode Tools version 3.2 or later but Xcode 4.3 or later is recommended.''' 
     41
     42You can download Xcode 4.3 or Xcode 4.4 from Apple's App Store (it is large: about 2 GB).  If you are a member of Apple's Mac Developer Program, you can also download it from Apple's web site: http://developer.apple.com.
    4843
    4944Source files are now archived using Subversion. You can download svnX, a free GUI application for running Subversion from either [http://www.apple.com/downloads/macosx/development_tools/svnx.html] or [http://www.lachoseinteractive.net/en/community/subversion/svnx/].
     
    5651Enter your administrator password when prompted to do so.
    5752
    58 == Building BOINC Manager with embedded Core Client ==
    59 
    60 BOINC depends on four third-party libraries: wxMac-2.8.10, c-ares-1.7.4, curl-7.21.7, and jpeg-6b. The source files for jpeg-6b are included with the BOINC sources.  You can obtain the other three from the following URLs:
     53== Building BOINC Manager with embedded BOINC Client ==
     54
     55BOINC depends on four third-party libraries: wxMac-2.8.10, c-ares-1.9.1, curl-7.26.0 and openssl-1.0.1c. You can obtain the source files from the following URLs:
    6156
    6257wxMac-2.8.10 (needed only if you are building the BOINC Manager):
     
    6863[http://downloads.sourceforge.net/wxwindows/wxMac-2.8.10.tar.bz2]
    6964
    70 curl-7.21.7:
     65curl-7.26.0:
    7166
    7267[http://curl.haxx.se]
    7368
    74 [http://curl.haxx.se/download/curl-7.21.7.tar.gz]
    75 
    76 c-ares-1.7.4 (used by curl):
     69[http://curl.haxx.se/download/curl-7.26.0.tar.gz]
     70
     71c-ares-1.9.1 (used by curl):
    7772
    7873[http://daniel.haxx.se/projects/c-ares/]
    7974
    80 [http://c-ares.haxx.se/download/c-ares-1.7.4.tar.gz]
     75[http://c-ares.haxx.se/download/c-ares-1.9.1.tar.gz]
     76
     77openssl-1.0.1c:
     78
     79[http://www.openssl.org/]
     80
     81[http://www.openssl.org/source/openssl-1.0.1c.tar.gz]
    8182
    8283(Don't forget to expand the tar files by double-clicking on them.)
     
    8788MAC_OS_X_VERSION_MIN_REQUIRED=1040
    8889}}}
    89 These are not done by either the XCode projects which come with wxMac-2.8.10, nor the !AutoMake scripts supplied with wxMac-2.8.10, c-ares-1.7.4, curl-7.21.7, or jpeg-6b. So be sure to use our special scripts to build these packages.
    90 
    91    1. Create a parent directory within which to work. In this description , we will call it BOINC_dev, but you can name it anything you wish.
    92    2. Put the following 3 directories inside the BOINC_dev folder (omit any you don't need):
    93 {{{
    94 c-ares-1.7.4
    95 curl-7.21.7
     90These are not done automatically by either the Xcode projects which come with wxMac-2.8.10, nor  the AutoMake scripts supplied with wxMac-2.8.10, c-ares-1.9.1, curl-7.26.0 and openssl-1.0.1c.  So be sure to use our special scripts to build these packages.
     91
     92 1. Create a parent directory within which to work. In this description , we will call it BOINC_dev, but you can name it anything you wish.
     93
     94 2. Put the following 3 directories inside the BOINC_dev folder (omit any you don't need):
     95{{{
     96c-ares-1.9.1
     97curl-7.26.0
     98openssl-1.0.1c
    9699wxMac-2.8.10
    97100}}}
    98       Important: do not change the names of any of these 3 directories.
    99    3. Get the BOINC source tree from SVN, and put it in the same BOINC_dev folder. To do this, type the following in Terminal:
     101 Important: do not change the names of any of these 4 directories.
     102
     103 '''Note:''' Building wxMac-2.8.10 requires the MacOSX10.6.sdk, which is not included in Xcode 4.4 and later.  If you are building wxMac-2.8.10 with Xcode 4.4, see the section [#InstallingandsettingupXcode Installing and setting up Xcode] for further information.
     104
     105 3. Get the BOINC source tree from SVN, and put it in the same BOINC_dev folder. To do this, type the following in Terminal:
    100106{{{
    101107cd {path}/BOINC_dev/
    102108svn co http://boinc.berkeley.edu/svn/trunk/boinc
    103109}}}
    104       (You may change the name of the `boinc` directory to anything you wish.)  Hint: if you have trouble getting this to work, try using `https` instead of `http`.
    105 
    106 The command above retrieves the source code from the HEAD (TRUNK) or development branch of the SVN repository. See more information on [SourceCode getting the BOINC source code].
    107    4. Run the script to build the c-ares, curl, jpeg and wxMac libraries as follows:
     110 (You may change the name of the `boinc` directory to anything you wish.)  Hint: if you have trouble getting this to work, try using `https` instead of `http`.
     111
     112 The command above retrieves the source code from the HEAD (TRUNK) or development branch of the SVN repository. See more information on [SourceCode getting the BOINC source code].
     113
     114 4. Run the script to build the c-ares, curl, openssl and wxMac libraries as follows:
    108115{{{
    109116cd {path}/BOINC_dev/boinc/mac_build/
    110117source setupForBoinc.sh -clean
    111118}}}
    112       If you don't wish to force a full rebuild of everything, omit the -clean argument.
    113 
    114       Note: this script builds c-ares and curl first, followed by jpeg and finally wxMac. If you haven't downloaded wxMac because you aren't building the BOINC Manager, the script will build c-ares, curl and jpeg. Likewise, if you downloaded only c-ares and curl because you aren't building the BOINC Manager, the script will build c-ares, curl and jpeg before quitting.
    115    5. Build BOINC as follows:
    116 
    117 BOINC itself is built using the '''boinc.xcodeproj''' file.  You can either build directly in XCode (more information below) or run the '''BuildMacBOINC.sh''' script:
     119 If you don't wish to force a full rebuild of everything, omit the -clean argument.
     120
     121 '''Note 1:''' Be sure to run the script using the source command.  Do not double-click on the scripts or use the sh command to run them.
     122
     123 '''Note 2:''' this script builds c-ares and curl first, followed by openssl and finally wxMac. If you haven't downloaded wxMac because you aren't building the BOINC Manager, the script will build c-ares, curl and openssl before quitting.
     124
     125 5. Build BOINC as follows:
     126
     127 BOINC itself is built using the '''boinc.xcodeproj''' file.  You can either build directly in XCode (more information below) or run the '''BuildMacBOINC.sh''' script:
    118128
    119129{{{
     
    142152          build the five libraries: libboinc_api.a, libboinc_graphics_api.a, libboinc.a, libboinc_opencl.a, jpeglib.a
    143153      -client::
    144           build two targets: BOINC client and command-line utility [http://boinc.berkeley.edu/wiki/Boinccmd_tool boinc_cmd] (also builds libboinc.a, since boinc_cmd requires it.)
     154          build two targets: BOINC client and command-line utility [http://boinc.berkeley.edu/wiki/Boinccmd_tool boinccmd] (also builds libboinc.a, since boinc_cmd requires it.)
    145155
    146156Both -lib and -client may be specified to build seven targets (no BOINC Manager or screensaver.)
    147157
    148 Note: You may find two XCode projects in the BOINC_dev/boinc/mac_build/ directory:
     158'''Note:''' You may find two XCode projects in the BOINC_dev/boinc/mac_build/ directory:
    149159    * '''wxMac-BOINC.xcodeproj''' was needed for building older versions of the wxMac library in conjunction with the older versions of the setupForBoinc.sh or buildWxMac.sh scripts. It is not used for BOINC 5.9.2 or later.
    150160    * '''boinc.xcodeproj''' builds BOINC. It can be used either with the BuildMacBOINC.sh script or as a stand-alone project. The ''Development'' build configuration builds only the native architecture and is used for debugging. The ''Deployment'' build configuration builds a universal binary and is suitable for release builds.  If there are any other build configurations, they should not be used as they are obsolete.
    151161
    152 '''Note:''' To perform a release build under Xcode 4.2 when not using the BuildMacBOINC.sh script, select "Build for archiving" from Xcode's Product menu.  Do '''not''' select "Archive."
    153 
    154 The standard release of BOINC version 6.13.0 and later builds only for Macintosh computers with Intel processors.  Most of the executables are built only for the i386 architecture.  The libraries and the screensaver are built as universal binaries containing builds for two architectures: i386 and x86_64.
    155 
    156 '''Important compatibility note:''' Xcode 4.x comes with only two Mac SDKs: MacOSX10.6.sdk and MacOSX10.7.sdk.  The BOINC Xcode project uses MacOSX10.6.sdk so that it can build with either Xcode 4.x or Xcode 3.2.  However, a couple of the libraries in MacOSX10.6.sdk require OS 10.6 or later to run.  If you are building only to run on OS 10.6 or later, you don't need to do anything else.
    157 
    158 However, if you want to build BOINC so it will run on OS 10.4 and OS 10.5, you must either:
    159  * build with Xcode 3.2, or
    160  * build with Xcode 4.x after copying the MacOSX10.5.sdk from an older version of Xcode to your /Developer/SDKs/ folder.  The BOINC Xcode project will automatically detect the presence of that SDK and use the two older libraries needed for backward compatibility.
     162'''Note:''' To perform a release build under Xcode 4.3 when not using the BuildMacBOINC.sh script, select "Build for archiving" from Xcode's Product menu.  Do '''not''' select "Archive."
     163
     164The standard release of BOINC version 6.13.0 and later builds only for Macintosh computers with Intel processors.  Most of the executables are built only for the i386 architecture.  The BOINC libraries and the screensaver are built as universal binaries containing builds for two architectures: i386 and x86_64.
    161165
    162166
     
    172176}}}
    173177
    174 Substitute the 3 parts of the BOINC version number for x y and z in the above. For example, to build the installer for BOINC version 6.13.9, the command would be
    175 
    176 {{{
    177 source {path}/BOINC_dev/boinc/mac_installer/release_boinc.sh 6 13 9
    178 }}}
    179 
    180 This will create a directory 'BOINC_Installer/New_Release_6_13_9' in the BOINC_dev directory, and the installer will be located in `{path}/BOINC_dev/BOINC_Installer/New_Release_6_13_9/boinc_6.13.9_macOSX_universal`.
     178Substitute the 3 parts of the BOINC version number for x y and z in the above. For example, to build the installer for BOINC version 7.0.32, the command would be
     179
     180{{{
     181source {path}/BOINC_dev/boinc/mac_installer/release_boinc.sh 7 0 32
     182}}}
     183
     184This will create a directory 'BOINC_Installer/New_Release_7_0_32' in the BOINC_dev directory, and the installer will be located in `{path}/BOINC_dev/BOINC_Installer/New_Release_7_0_32/boinc_7.0.32_macOSX_i686`.
     185
     186
     187== Code Signing the BOINC Manager Installer and Uninstaller ==
     188
     189Mac OS 10.8 introduces a security feature called Gatekeeper, whose default settings won't allow a user to run applications or installers downloaded from the Internet unless they are signed by a registered Apple Developer.  The `release_boinc.sh` script looks for a file `~/BOINCCodeSignIdentity.txt` containing the name of a valid code signing identity stored in the user's Keychain.  If this is found, the script will automatically sign the BOINC installer and BOINC uninstaller using that identity.  For example, if your user name is John Smith, the first line of `~/BOINCCodeSignIdentity.txt` would be something like the following:
     190{{{
     191Developer ID Application: John Smith
     192}}}
     193
     194If there is no `~/BOINCCodeSignIdentity.txt` file, then the script will not sign the installer or uninstaller.  For more information on code signing identities see the documentation for the  [https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/codesign.1.html `codesign`] utility and Apple's [https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/ Code Signing Guide]. 
     195
    181196
    182197== Debugging and BOINC security ==
     
    186201The GDB debugger can't attach to applications which are running as a different user or group so it ignores the S_ISUID and S_ISGID permission bits when launching an application. To work around this, the BOINC ''Development'' build does not use the special boinc_master or boinc_project users or groups, and so can be run under the debugger from XCode.
    187202
    188 The ''Development'' build ''only'' of the BOINC Manager allows you to change the ownership and permission settings of the BOINC Data and executables by entering an administrator user name and password. This also streamlines the development cycle by avoiding the need to run the installer for every change.  (To generate the development build under Xcode 4.2, choose "Build" from the product menu, or enter command-B on the keyboard.)
     203The ''Development'' build ''only'' of the BOINC Manager allows you to change the ownership and permission settings of the BOINC Data and executables by entering an administrator user name and password. This also streamlines the development cycle by avoiding the need to run the installer for every change.  (To generate the development build under Xcode 4.3, choose "Build" from the product menu, or enter command-B on the keyboard.)
    189204
    190205To restore the standard ownerships and permissions, run the installer.
     
    192207For information on interpreting crash dumps and backtraces, see [MacBacktrace Mac Backtrace].
    193208
     209
    194210== Debugging into wxWidgets ==
    195211
     
    198214You can find instructions for doing this in the comments in the file `boinc/clientgui/mac/MacGUI.pch`.
    199215
     216
     217== Installing and setting up Xcode ==
     218
     219Versions of Xcode prior to Xcode 4.3 have an installer package. After downloading Xcode, mount the disk image file by double-clicking on it, then double-click the installer package.
     220
     221Starting with Xcode 4.3, the disk image contains a copy of Xcode itself.  After mounting the disk image, drag the Xcode icon to the folder where you wish it to reside.  In most cases, this will be the `/Applications/` folder.  Unmount the disk image by dragging it to the trash.  Finally, double-click on the installed Xcode icon to run Xcode.  Xcode will display a dialog allowing you to finish the installation; you must do this before running BOINC's build scripts.  (Some versions of Xcode may not display this dialog until you open a file with Xcode.)
     222
     223Building wxMac-2.8.10 requires the MacOSX10.6.sdk, which is not included in Xcode 4.4 and later.  If you are building wxMac-2.8.10 with Xcode 4.4, you must install the OS 10.6 SDK as follows:
     224 1. Download a version of Xcode for OS 10.7 Lion (such as Xcode 4.3.3.)
     225
     226 2. Mount the disk image file by double-clicking on it.  Do '''not''' drag-install this older version of Xcode.
     227
     228 3. On the disk image, control-click on the Xcode icon and select `Show Package Contents`.
     229
     230 4. On the older Xcode disk image, browse to the directory:
     231{{{
     232/Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
     233}}}
     234 You should see a folder named `MacOSX10.6.sdk`.
     235
     236 5. Control-click on your newer Xcode icon (which you previously installed on your hard drive) and select `Show Package Contents`.
     237
     238 6. In your newer Xcode Browse to the directory:
     239{{{
     240/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/`
     241}}}
     242 (or the equivalent if you installed it somewhere other than your `/Applications/` folder.)
     243
     244 7. Copy the `MacOSX10.6.sdk` folder from the SDKs folder on the older disk image to the SDKs folder in the newer Xcode.
     245
     246 8. Unmount the disk image by dragging it to the trash.