Changes between Version 78 and Version 79 of MacBuild


Ignore:
Timestamp:
Mar 23, 2015, 1:50:58 AM (9 years ago)
Author:
charlief
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MacBuild

    v78 v79  
    11= Building BOINC Client and Manager on Macintosh OS X =
    2 '''Last updated 7/31/13'''
    3 
    4 This document applies to BOINC version 7.2.8 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.
     2'''Last updated 3/23/15'''
     3
     4This document applies to BOINC version 7.4.42and 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.
    55
    66'''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:
     
    2121As of version 6.13.0, BOINC does not support Macintosh PowerPC processors.
    2222
    23 Although 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.
    24 
    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 or OS 10.8.x and cross-compile for the various platforms. The remainder of this document describes that process.
     23Although BOINC supports 64-bit Intel project applications on Mac OS 10.5.0 and above, the only parts of the BOINC client package built as 64-bit executables are the portion of the screensaver coordinator for OS 10.6.x and later, and  the BOINC client itself.  The BOINC libraries also include a 64-bit build so that they can be linked with 64-bit project applications.
     24
     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.8.x or later and cross-compile for the various platforms. The remainder of this document describes that process.
    2626
    2727'''The above requirements apply not only to BOINC itself, but also to the !WxWidgets, c-ares, cURL, openSSL,  freetype, ftgl and SQLite3 libraries, as well as all project applications.'''
     
    2929Be sure to follow the directions in this document to ensure that these requirements are met.
    3030
    31 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 and later, which do not support the Mac OS 10.3.9 SDK.
     31Starting with version 7.3.0, the BOINC Client supports only Mac OS X 10.5.0 and later.
    3232
    3333
    3434== Cross-Platform Development ==
    3535
    36 Apple 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.
     36Apple provides the tools necessary to cross-compile for both BOINC Mac platforms on any Mac running OS 10.8.x or later.
    3737
    3838You get these tools, including the GCC compilers and system library header files, by installing the XCode Tools package.
    3939
    40 '''Building BOINC now requires Xcode Tools version 3.2 or later but Xcode 4.3 or later is recommended.''' 
    41 
    42 You 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.  You can also register for free access to Apple developer tools at: https://developer.apple.com/programs/register/.
    43 
    44 Source files are now archived within the [SourceCodeGit BOINC repository] ([source:boinc/mac_build mac_build]).
     40'''Building BOINC now requires Xcode Tools version 4.6 or later.''' Build with Xcode 5.1.1 or earlier to fully support OS X back to OS 10.5.  Xcode 6 or later will build a screensaver which requires OS 10.6 or later, but all other built components will work with OS 10.5 or later.  Note also that you cannot build wxWidgets 3.0 using Xcode 6 (this has not been fixed as of wxWidgets 3.0.2.)
     41
     42You can download Xcode 4.6 or later 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.
     43
     44Source files are now archived within the [SourceCodeGit BOINC repository].
    4545
    4646== Building BOINC Manager with embedded BOINC Client ==
    4747
    48 BOINC depends on six third-party libraries: wxMac-2.8.10, c-ares-1.9.1, curl-7.26.0, openssl-1.0.1e, freetype-2.4.10, ftgl-2.1.3~rc5 and sqlite3.7.14.1. You can obtain the source files from the following URLs:
    49 
    50 wxMac-2.8.10 (needed only if you are building the BOINC Manager):
     48Note: building BOINC Manager 7.3.0 and later requires the OS 10.8 SDK or later.
     49
     50BOINC depends on six third-party libraries: wxWidgets-3.0, c-ares-1.10.0, curl-7.39.0, openssl-1.0.1j,  freetype-2.4.10, ftgl-2.1.3~rc5 and sqlite-3.8.3. You can obtain the source files from the following URLs:
     51
     52wxWidgets-3.0 (needed only if you are building the BOINC Manager):
    5153
    5254[http://www.wxwidgets.org]
    5355
    54 [http://prdownloads.sourceforge.net/wxwindows/wxMac-2.8.10.tar.gz]
    55 
    56 [http://downloads.sourceforge.net/wxwindows/wxMac-2.8.10.tar.bz2]
    57 
    58 sqlite3.7.14.1 (needed  only if you are building the BOINC Manager):
     56[http://sourceforge.net/projects/wxwindows/files/3.0.0/wxWidgets-3.0.0.tar.bz2/]
     57
     58sqlite-3.8.3 (needed  only if you are building the BOINC Manager):
    5959
    6060[http://www.sqlite.org/]
    6161
    62 [http://www.sqlite.org/sqlite-autoconf-3071401.tar.gz]
    63 
    64 curl-7.26.0:
     62[http://www.sqlite.org/2014/sqlite-autoconf-3080300.tar.gz]
     63
     64curl-7.39.0:
    6565
    6666[http://curl.haxx.se]
    6767
    68 [http://curl.haxx.se/download/curl-7.26.0.tar.gz]
    69 
    70 c-ares-1.9.1 (used by curl):
     68[http://curl.haxx.se/download/curl-7.39.0.tar.gz]
     69
     70c-ares-1.10.0 (used by curl):
    7171
    7272[http://daniel.haxx.se/projects/c-ares/]
    7373
    74 [http://c-ares.haxx.se/download/c-ares-1.9.1.tar.gz]
    75 
    76 openssl-1.0.1e:
     74[http://c-ares.haxx.se/download/c-ares-1.10.0.tar.gz]
     75
     76openssl-1.0.1j:
    7777
    7878[http://www.openssl.org/]
    7979
    80 [http://www.openssl.org/source/openssl-1.0.1e.tar.gz]
     80[http://www.openssl.org/source/openssl-1.0.1j.tar.gz]
    8181
    8282freetype-2.4.10 (needed  only if you are building the BOINC default screensaver or a project screensaver):
     
    9494(Don't forget to expand the tar files by double-clicking on them.)
    9595
    96 XCode will automatically check compatibility back to OS 10.4 if the following are defined during compilation:
    97 {{{
    98 MAC_OS_X_VERSION_MAX_ALLOWED=1040
    99 MAC_OS_X_VERSION_MIN_REQUIRED=1040
    100 }}}
    101 These 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, openssl-1.0.1e, freetype-2.4.10, ftgl-2.1.3~rc5 and sqlite3.7.14.1.  So be sure to use our special scripts to build these packages.
     96XCode will automatically check compatibility back to OS 10.5 if the following are defined during compilation:
     97{{{
     98MAC_OS_X_VERSION_MAX_ALLOWED=1050
     99MAC_OS_X_VERSION_MIN_REQUIRED=1050
     100}}}
     101These are not done automatically by either the Xcode projects which come with wxWidgets-3.0, nor  the !AutoMake scripts supplied with wxWidgets-3.0, c-ares-1.10.0, curl-7.39.0, openssl-1.0.1j, freetype-2.4.10, ftgl-2.1.3~rc5 and sqlite-3.8.3.  So be sure to use our special scripts to build these packages.
    102102
    103103 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.
     
    105105 2. Put the following 3 directories inside the BOINC_dev folder (omit any you don't need):
    106106{{{
    107 c-ares-1.9.1
    108 curl-7.26.0
    109 openssl-1.0.1e
    110 wxMac-2.8.10
     107c-ares-1.10.0
     108curl-7.39.0
     109openssl-1.0.1j
     110wxWidgets-3.0
    111111freetype-2.4.10
    112112ftgl-2.1.3~rc5
    113 sqlite3.7.14.1
     113sqlite-3.8.3
    114114}}}
    115115 Important: do not change the names of any of these 6 directories.
    116116
    117  '''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.
    118 
    119117 3. Get the BOINC source tree from the repository, and put it in the same BOINC_dev folder. To do this, type the following in Terminal:
    120118{{{
    121119cd {path}/BOINC_dev/
    122 git clone git://boinc.berkeley.edu/boinc-v2.git boinc
     120git clone http://boinc.berkeley.edu/git/boinc-v2.git boinc
    123121}}}
    124122 (You may change the name of the `boinc` directory to anything you wish.) See more information on [SourceCodeGit getting the BOINC source code].
    125123
    126  4. Run the script to build the c-ares, curl, openssl, wxMac, freetype, ftgl and sqlite3 libraries as follows:
     124 4. Run the script to build the c-ares, curl, openssl, wxWidgets, freetype, ftgl and sqlite3 libraries as follows:
    127125{{{
    128126cd {path}/BOINC_dev/boinc/mac_build/
     
    133131 '''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.
    134132
    135  '''Note 2:''' this script tries to build all six third-party libraries: wxMac-2.8.10, c-ares-1.9.1, curl-7.26.0, openssl-1.0.1e, freetype-2.4.10, ftgl-2.1.3~rc5 and sqlite3.7.14.1.  when the script finishes, it will display a warning about any libraries was unable to build (for example, if you have not downloaded them.)
     133 '''Note 2:''' this script tries to build all six third-party libraries: wxWidgets-3.0, c-ares-1.10.0, curl-7.39.0, openssl-1.0.1j,  freetype-2.4.10, ftgl-2.1.3~rc5 and sqlite-3.8.3.  when the script finishes, it will display a warning about any libraries it was unable to build (for example, if you have not downloaded them.)
    136134
    137135 5. Build BOINC as follows:
     
    168166Both -lib and -client may be specified to build seven targets (no BOINC Manager or screensaver.)
    169167
    170 '''Note:''' You may find two XCode projects in the BOINC_dev/boinc/mac_build/ directory:
    171     * '''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.
    172     * '''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.
    173 
    174 '''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."
    175 
    176 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 BOINC libraries and the screensaver are built as universal binaries containing builds for two architectures: i386 and x86_64.
     168'''Note 1: boinc.xcodeproj''' in the `BOINC_dev/boinc/mac_build/` directory 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.
     169
     170'''Note 2:''' To perform a release build under Xcode 4.6 when not using the BuildMacBOINC.sh script, select "Build for archiving" or "Build for Profiling" from Xcode's Product menu.  Under Xcode 5.0, select "Build for Profiling."  To save disk space, do '''not''' select "Archive."
     171
     172'''Note 3:'''Using the BuildMacBOINC.sh script is generally easier than building directly in Xcode.  The script will place the built products in the directory `BOINC_dev/boinc/mac_build/build/Deployment/` or `BOINC_dev/boinc/mac_build/build/Development/` where they are easy to find.  Building directly in Xcode places the built products in a somewhat obscure location; you would normally need to determine this location using Xcode's Organizer window. 
     173
     174The BOINC Xcode project has built-in scripts which create a text file with the path to the built products at either `BOINC_dev/boinc/mac_build/Build_Deployment_Dir` or `BOINC_dev/boinc/mac_build/Build_Development_Dir`.  These files are used by the release_boinc.sh script, but you can also use them to access the built products directly as follows; open the file with !TextEdit and copy the path, then enter command-shift-G in the Finder and paste the path into the Finder's  dialog.
     175
     176The standard release of BOINC version 7.4.42and later builds only for Macintosh computers with Intel processors.  Most of the executables are built only for the i386 architecture, except the BOINC client which is built only for the x86_64 architecture.  The BOINC libraries and the screensaver are built as universal binaries containing builds for two architectures: i386 and x86_64.
    177177
    178178
    179179== Building BOINC Manager Installer ==
    180180
    181 In order to execute BOINC Manager, you have to install it using BOINC Manager Installer. Otherwise, you will encounter an error prompting for proper installation.
     181In order to execute BOINC Manager, you must install it using BOINC Manager Installer. Otherwise, you will encounter an error prompting for proper installation.
    182182
    183183To build the Installer for the BOINC Manager, you must be logged in as an administrator.  If you are building BOINC version number x.y.z, type the following in Terminal, then enter your administrator password when prompted by the script:
     
    188188}}}
    189189
    190 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 7.0.32, the command would be
    191 
    192 {{{
    193 source {path}/BOINC_dev/boinc/mac_installer/release_boinc.sh 7 0 32
    194 }}}
    195 
    196 This 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`.
     190Substitute 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.4.42, the command would be
     191
     192{{{
     193source {path}/BOINC_dev/boinc/mac_installer/release_boinc.sh 7 4 42
     194}}}
     195
     196This will create a directory `BOINC_Installer/New_Release_7_4_42` in the `BOINC_dev` directory, and the installer will be located in `{path}/BOINC_dev/BOINC_Installer/New_Release_7_4_42/boinc_7.4.42_macOSX_x86_64`.
    197197
    198198
     
    209209== Debugging and BOINC security ==
    210210
    211 Version 5.5.4 of BOINC Manager for the Macintosh introduced new, stricter security measures. For details, please see the file `boinc/mac_installer/Readme.rtf` and web pages [//sandbox.php Sandbox Design] and [SandboxUser Sandbox User].
     211Version 5.5.4 of BOINC Manager for the Macintosh introduced new, stricter security measures. For details, please see the file `BOINC_dev/boinc/mac_installer/Readme.rtf` and web pages [//sandbox.php Sandbox Design] and [SandboxUser Sandbox User].
    212212
    213213The 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.
    214214
    215 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.3, choose "Build" from the product menu, or enter command-B on the keyboard.)
     215The ''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.6, choose "Build" from the product menu, or enter command-B on the keyboard.)
    216216
    217217To restore the standard ownerships and permissions, run the installer.
     
    224224The BOINC XCode project normally links the BOINC Manager with the non-debugging (Deployment) build of wxWidgets, even for the Development build configuration of the Manager.  However, there may be times when you wish to link the Development build of the Manager to the Development build of wxWidgets for debugging, as when you want to step into internal wxWidgets code or put breakpoints in wxWidgets.
    225225
    226 You can find instructions for doing this in the comments in the file `boinc/clientgui/mac/MacGUI.pch`.
     226You can find instructions for doing this in the comments in the file `BOINC_dev/boinc/clientgui/mac/MacGUI.pch`.
    227227
    228228
     
    232232
    233233Starting 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.)
    234 
    235 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, you must install the OS 10.6 SDK as follows:
    236  1. Download a version of Xcode for OS 10.7 Lion (such as Xcode 4.3.3.)
    237 
    238  2. Mount the disk image file by double-clicking on it.  Do '''not''' drag-install this older version of Xcode.
    239 
    240  3. On the disk image, control-click on the Xcode icon and select `Show Package Contents`.
    241 
    242  4. On the older Xcode disk image, browse to the directory:
    243 {{{
    244 /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
    245 }}}
    246  You should see a folder named `MacOSX10.6.sdk`.
    247 
    248  5. Control-click on your newer Xcode icon (which you previously installed on your hard drive) and select `Show Package Contents`.
    249 
    250  6. In your newer Xcode Browse to the directory:
    251 {{{
    252 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/`
    253 }}}
    254  (or the equivalent if you installed it somewhere other than your `/Applications/` folder.)
    255 
    256  7. Copy the `MacOSX10.6.sdk` folder from the SDKs folder on the older disk image to the SDKs folder in the newer Xcode.
    257 
    258  8. Unmount the disk image by dragging it to the trash.