Changes between Version 68 and Version 69 of MacBuild


Ignore:
Timestamp:
Jan 26, 2012, 4:41:46 PM (13 years ago)
Author:
charlief
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MacBuild

    v68 v69  
    11= Building BOINC Client and Manager on Macintosh OS X =
    2 '''Last updated 10/11/10'''
     2'''Last updated 1/26/12'''
    33
    4 This document applies to BOINC version 6.11.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.
     4This 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.
    55
    66Note: 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:
     
    1616== Important requirements for building BOINC software for the Mac ==
    1717
    18 Building BOINC for Macintosh OS X is complicated by the fact that Mac OS X is actually 3 different platforms:
    19  * '''powerpc-apple-darwin''': PowerPC processors running OS 10.3.0 and above
    20  * '''i686-apple-darwin''': 32-bit Intel processors running OS 10.4.0 and above
    21  * '''x86_64-apple-darwin''': 64-bit Intel processors running OS 10.5.0 and above
    22 BOINC does not support 64-bit PowerPC applications for the Mac.
     18Building BOINC for Macintosh OS X is complicated by the fact that Mac OS X is actually 2 different platforms:
     19* '''i686-apple-darwin''': 32-bit Intel processors running OS 10.4.0 and above
     20* '''x86_64-apple-darwin''': 64-bit Intel processors running OS 10.5.0 and above
     21As of version 6.13.0, BOINC does not support Macintosh PowerPC processors.
    2322
    24 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.  The BOINC libraries also include a 64-bit build so that they can be linked with 64-bit project applications.
     23Although 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.
    2524
    26 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.6.x and cross-compile for the various platforms. The remainder of this document describes that process.
     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 and cross-compile for the various platforms. The remainder of this document describes that process.
    2726
    2827'''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.
     
    3736== Cross-Platform Development ==
    3837
    39 Apple provides the tools necessary to cross-compile for all three BOINC Mac platform on any Mac running OS 10.6.x.
     38Apple 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.
    4039
    41 You get these tools, including the GCC compilers and system library header files, by installing the XCode Tools package. Building BOINC and the library packages on which it depends requires XCode 3.2 or later running under OS 10.6.x or later. 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`.
     40You get these tools, including the GCC compilers and system library header files, by installing the XCode Tools package.
    4241
    43 Otherwise, you can download it 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:
     42'''Building BOINC now requires Xcode Tools version 3.2 or later but Xcode 4.2 or later is recommended.''' 
     43
     44If 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
     46You 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:
    4447http://connect.apple.com
    45 
    46 '''Building BOINC now requires XCode Tools version 3.2 or later.'''  Note that the MacOS10.4u SDK is not automatically included unless you customize the installation; click  the '''Customize''' button in the ''Installation type'' step when you run the XCode Tools installer.  The MacOS10.4u SDK is required to build wxWidgets (wxMac-2.8.10).
    4748
    4849Source 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/].
     
    5758== Building BOINC Manager with embedded Core Client ==
    5859
    59 BOINC depends on four third-party libraries: wxMac-2.8.10, c-ares-1.6.0, curl-7.19.7, and jpeg-6b. You can obtain these from the following URLs:
     60BOINC 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:
    6061
    6162wxMac-2.8.10 (needed only if you are building the BOINC Manager):
     
    6768[http://downloads.sourceforge.net/wxwindows/wxMac-2.8.10.tar.bz2]
    6869
    69 curl-7.19.7:
     70curl-7.21.7:
    7071
    7172[http://curl.haxx.se]
    7273
    73 [http://curl.haxx.se/download/curl-7.19.7.tar.gz]
     74[http://curl.haxx.se/download/curl-7.21.7.tar.gz]
    7475
    75 c-ares-1.6.0 (used by curl):
     76c-ares-1.7.4 (used by curl):
    7677
    7778[http://daniel.haxx.se/projects/c-ares/]
    7879
    79 [http://daniel.haxx.se/projects/c-ares/c-ares-1.6.0.tar.gz]
     80[http://c-ares.haxx.se/download/c-ares-1.7.4.tar.gz]
    8081
    81 jpeg-6b (needed only if you are building the BOINC libboinc_graphics2.a library):
     82(Don't forget to expand the tar files by double-clicking on them.)
    8283
    83 [http://www.ijg.org]
    84 
    85 [http://dir.filewatcher.com/d/GNU/Other/jpegsrc.v6b.tar.gz.613261.html]
    86 
    87 XCode will automatically check compatibility back to OS 10.3 if the following are defined during compilation:
     84XCode will automatically check compatibility back to OS 10.4 if the following are defined during compilation:
    8885{{{
    89 MAC_OS_X_VERSION_MAX_ALLOWED=1030
    90 MAC_OS_X_VERSION_MIN_REQUIRED=1030
     86MAC_OS_X_VERSION_MAX_ALLOWED=1040
     87MAC_OS_X_VERSION_MIN_REQUIRED=1040
    9188}}}
    92 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.6.0, curl-7.19.7, or jpeg-6b. So be sure to use our special scripts to build these packages.
     89These 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.
    9390
    9491   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.
    95    2. Put the following 4 directories inside the BOINC_dev folder (omit any you don't need):
     92   2. Put the following 3 directories inside the BOINC_dev folder (omit any you don't need):
    9693{{{
    97 c-ares-1.6.0
    98 curl-7.19.7
    99 jpeg-6b
     94c-ares-1.7.4
     95curl-7.21.7
    10096wxMac-2.8.10
    10197}}}
    102       Important: do not change the names of any of these 4 directories.
     98      Important: do not change the names of any of these 3 directories.
    10399   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:
    104100{{{
     
    116112      If you don't wish to force a full rebuild of everything, omit the -clean argument.
    117113
    118       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 need neither graphics nor the BOINC Manager, the script will build c-ares and curl before quitting.
     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.
    119115   5. Build BOINC as follows:
    120116
     
    135131
    136132      -dev::
    137           build the development (debug) version (native architecture only). default is deployment (release) version (universal binaries: ppc, i386 and x86_64).
     133          build the development (debug) version (native architecture only). default is deployment (release) version (universal binary: i386 and x86_64).
    138134      -noclean::
    139135          don't do a 'clean' of each target before building. default is to clean all first.
     
    144140          build all targets (i.e. target 'Build_All' -- this is the default)
    145141      -lib::
    146           build the three libraries: libboinc_api.a, libboinc_graphics2.a, libboinc.a
     142          build the five libraries: libboinc_api.a, libboinc_graphics_api.a, libboinc.a, libboinc_opencl.a, jpeglib.a
    147143      -client::
    148           build two targets: BOINC client and command-line utility [BoincCmd boinc_cmd] (also builds libboinc.a, since boinc_cmd requires it.)
     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.)
    149145
    150 Both -lib and -client may be specified to build five targets (no BOINC Manager.)
     146Both -lib and -client may be specified to build seven targets (no BOINC Manager or screensaver.)
    151147
    152148Note: You may find two XCode projects in the BOINC_dev/boinc/mac_build/ directory:
     
    154150    * '''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.
    155151
    156 The standard release of BOINC version 6.10.58 and later contains a universal binary of the BOINC Client containing builds for two architectures: ppc and i386.  The Mac OS automatically chooses the appropriate architecture as follows:
    157  * On a PowerPC Mac, it runs the ppc executable.
    158  * On an Intel Mac, it runs the i386 executable.
     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."
    159153
    160 Note: you may see the following warning when building the PowerPC executable.  You may safely ignore it:
    161 {{{
    162 ld: warning: object file compiled with -mlong-branch which is no longer needed.
    163 To remove this warning, recompile without -mlong-branch
    164 }}}
     154The 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
     158However, 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.
    165161
    166162
     
    176172}}}
    177173
    178 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.11.9, the command would be
     174Substitute 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
    179175
    180176{{{
    181 source {path}/BOINC_dev/boinc/mac_installer/release_boinc.sh 6 11 9
     177source {path}/BOINC_dev/boinc/mac_installer/release_boinc.sh 6 13 9
    182178}}}
    183179
    184 This will create a directory 'BOINC_Installer/New_Release_6_11_9' in the BOINC_dev directory, and the installer will be located in `{path}/BOINC_dev/BOINC_Installer/New_Release_6_11_9/boinc_6.11.9_macOSX_universal`.
     180This 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`.
    185181
    186182== Debugging and BOINC security ==
     
    190186The 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.
    191187
    192 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.
     188The ''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.)
    193189
    194190To restore the standard ownerships and permissions, run the installer.