This document applies to BOINC version 6.1.0 and later. It has instructions for building BOINC for Macintosh OSX, plus information for building science project applications to run under BOINC on Macintosh OSX. \
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:\
\cf0 BOINC version 6.1.0 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. \
\b \cf0 The above requirements apply not only BOINC itself, but also the WxWidgets, JPEG, c-ares and cURL libraries, as well as all project applications
\b0 . The BOINC Client does not use WxWidgets or JPEG, so only the c-ares and cURL libraries must be built for the x86_64 architecture.\
\cf0 BOINC version 6.1.0 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. However, to ensure that science projects are compatible with older versions of BOINC running under OS 10.3.0 through 10.3.8, the PowerPC builds of the libraries and science applications are still built using GCC 3.3.\
\i \cf0 If your application must support versions of Mac OS X prior to 10.3.9, you must not use the GCC 4.0 compiler. Instead, build your project using the GCC 3.3 compiler\
\i \cf0 Do not link C++ modules compiled with one of these compilers against modules compiled with the other. Even if the modules appear to link correctly, C++ ABI differences may still cause problems that will not manifest themselves until run time.
If you are building a project application to be run by BOINC, you only need to build the boinc libraries libboinc_api.a, ibboinc.a, and (if you want graphics) either libboinc_graphics_api.a or libboinc_graphics2.a. (libboinc_graphics2.a is used for version 6 graphics, which is the method recommended for all applications.) There are two ways to do this:\
(1) Use the BOINC autoconf / automake scripts to build these libraries and any libraries on which they depend. You must do all of this twice: once on a PowerPC Mac running OS 10.3.x (do
(If you wish, you can combine separate Intel and PowerPC builds in a single Universal Binary mach-O file using the command-line utility lipo. For details on lipo, type "man lipo" in Terminal; it is available on all Macs running OS10.4.x or later.)\
At the time this is written, the BOINC autoconf / automake scripts do not build 64-bit binaries.\
\
(2) Use scripts setupForBOINC.sh and BuildMacBOINC.sh. You do this once on any Macintosh (PowerPC or Intel) running either OS 10.4.x and XCode 2.4.1, or OS 10.5.x and XCode 3.0 (or later) installed. This will produce Universal Binaries of all the libraries. These can then be linked with PowerPC, 32-bit Intel and 64-bit Intel Mac applications.\
After building the libraries as Universal Binaries using the second method, you may still want to build your actual application separately on the two architectures: on a PowerPC Mac running OS 10.3.x (do NOT use OS 10.4), and also on an Intel Mac running OS 10.4.x. To build for the x86_64 architecture, use a Mac running either OS 10.4 or OS 10.5 and specify the -arch x86_64 option to the compiler and linker.\
XCode installed these utilities in the /usr/bin/ directory, but the upgrades by default will install in /usr/local/bin/. If you install there, you must also set your PATH environment variable to include that location. The scripts referenced below do this automatically.\
\cf0 As stated above, all BOINC software for Power PC Macs must be built using MacOS10.3.9 SDK and (for libraries) GCC 3.3 to assure backward compatibility with OS 10.3. All 32-bit BOINC software for Intel Macs must be built using GCC 4.0 and MacOS10.4.u SDK to allow cross-compiling. And all 64-bit BOINC software for Intel Macs must be built using GCC 4.0 and MacOS10.5 SDK. \
These are not done by either the XCode projects which come with wxMac-2.8.7, nor the AutoMake scripts supplied with wxMac-2.8.7, c-ares-1.5.1, curl-7.18.0, or jpeg-6b. So be sure to use our special scripts to build these packages.\
Building BOINC and the library packages on which it depends requires OS 10.4.4 (or later) and XCode 2.4.1 (or later). It may be possible to use XCode 2.3 and/or versions of OS X earlier than 10.4.4, but this has not been tested by the authors.\
The command above retrieves the source code from the HEAD (TRUNK) or development branch of the CVS repository. For more information on getting the BOINC source code, see:\
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.\
\b0 You may find three XCode projects in the BOINC_dev/boinc/mac_build/ directory: \
\'95
\b boinc.pbproj
\b0 is obsolete and should no longer be used.\
\'95
\b wxMac-BOINC.xcodeproj
\b0 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. \
\b0 builds BOINC. It can be used either with the BuildMacBOINC.sh script or as a stand-alone project. It has three extra build configurations, i386-Deployment and ppc-Deployment, which can be used for testing only to build for just one architecture, and Deployment-no64 which builds only 32-bit products. 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.\
The standard release of BOINC version 6.1.0 and later contains a universal binary of the BOINC Client containing builds for three architectures: ppc, i386 and x86_64. The Mac OS automatically chooses the appropriate architecture as follows:\
\'95 On a PowerPC Mac, it runs the ppc executable.\
* On a Mac with a 64-bit Intel processor running OS 10.5 or later, it runs the x86_64 executable.\
* On any other Intel Mac, it runs the i386 executable.\
To 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:\
\cf0 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 5.5.4, the command would be\
\cf0 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 {\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/sandbox.php"}}{\fldrslt http://boinc.berkeley.edu/sandbox.php}} and {\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/trac/wiki/SandboxUser"}}{\fldrslt
\cf0 \CocoaLigature0 The GDB debugger can't attach to applications which are running as a diferent user or group so it ignores the S_ISUID and S_ISGID permisison bits when launching an application. To work around this, BOINC does not use the special boinc_master or boinc_project users or groups when run from XCode. \
\i0 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.\
\cf0 Apple converted all its lines of computers to Intel processors during 2006. The early Intel Macs used the Core Duo processor, which is a 32-bit CPU. Later Intel processors, including the Core 2 Duo, can run both 32-bit and 64-bit applications. However, BOINC will run in 64-bit mode only under OS 10.5 and later.\
All current releases of BOINC include "universal binary" builds for the Macintosh of BOINC Manager, command-line BOINC Client and the boinc_cmd command-line tool. (Universal binaries contain both PowerPC and Intel executables in one file; the Macintosh OS automatically selects the appropriate one for that computer.) Beginning with version 6.1, the BOINC Client and libraries also include the 64-bit Intel architecture as part of the universal binaries.\
The advantage of "universal binaries" is that you only need to have one copy of the application, and it will run on either PowerPC, 32-bit Intel or 64-bit Intel Macs, so users don't need to choose between three options. Since BOINC participants manually download BOINC from the web site, we will be providing BOINC in "universal binary" form.\
However, participants do not manually download project applications; this is done automatically by BOINC. So there would be no advantage to combining the 32-bit Intel, 64-bit Intel and PowerPC versions in a single "universal binary" file, but doing so would triple the size of the download.\
\
So BOINC treats Intel Macs as 2 new, separate platforms:
\f1\fs26 i686-apple-darwin
\f0\fs24 and
\f1\fs26 x86_64-apple-darwin
\f0\fs24 , in addition to the PowerPC Mac platform (
\f1\fs26 powerpc-apple-darwin
\f0\fs24 ). \
\
Starting with BOINC 5.9.7, the Intel BOINC Client accepts
\f1\fs26 powerpc-apple-darwin
\f0\fs24 applications if no
\f1\fs26 i686-apple-darwin
\f0\fs24 is available. The OS will run it in compatibility mode, emulating a PowerPC. (Apple calls this compatibility mode Rosetta, which of course has nothing to do with the Rosetta BOINC project.) \
\
The x86_64 BOINC Client requests
\f1\fs26 x86_64-apple-darwin
\f0\fs24 applications from BOINC servers as its first choice,
\b0 measure, projects can set their servers to deliver a copy of their current PowerPC application (renamed for the new platform) under the i686-apple-darwin platform for older BOINC Clients. \
(2) Since it is running under emulation, your application will run at reduced efficiency. But the benchmarks are based on running native Intel applications. This may cause scheduler problems, such as missed deadlines and inadequate credit for participants. \
BOINC 6.1 supports all PowerPC Macs running OS 10.3.9 or later, and all Intel Macs, but older versions of BOINC supported OS 10.3.0 or later for PowerPC Macs. (The Intel Macs themselves require OS 10.4.4 or later.) \
The easiest way to build your application for these two platforms is to build each one on its native platform. In other words, do your powerpc-apple-darwin build on a PowerPC Mac running OS 10.3.9, and your i686-apple-darwin build on an Intel Mac.\
All BOINC project applications for Power PC Macs must be built using GCC 3.3 and MacOS10.3.9 SDK to assure backward compatibility with OS 10.3. If building a PowerPC application on an Intel Mac, you must also specify
All 32-bit BOINC software for Intel Macs must be built using GCC 4.0 and MacOS10.4.u SDK to allow cross-compiling. If building an Intel application on a PowerPC Mac, you must also specify
All 64-bit BOINC software for Intel Macs must be built using GCC 4.0 and MacOS10.5 SDK. To build for the x86_64 architecture, use a Mac running either OS 10.4 or OS 10.5 and specify the
If you prefer, you can cross-compile on one Mac running OS 10.4.x or OS 10.5.x. You can find examples of how to do this for two different kinds of configure / make scripts in the HEAD branch of the BOINC CVS tree at boinc/mac_build/buildcurl.sh and boinc/mac_build/buildjpeg.sh. \
\
The lipo utility is used at the end of each of these scripts to combine the two binaries into a single "Universal Binary" file. You won't need to do that with you project applications, since you will be distributing them separately under the two platforms. But if you prefer, you can create a Universal Binary and distribute the same file for both i686-apple-darwin and powerpc-apple-darwin platforms (and also the x86_64-apple-darwin platform if you wish).\
Note that the BOINC libraries (and any third-party libraries) which you link with your applications must be built with the same configuration as the application itself. Follow the instructions earlier in this document to build the needed libraries.\
One of the major changes in BOINC for version 6 is that applications are now expected to generate graphics in a separate executable. The graphics application typically communicates with the worker application using shared memory.\
There is an optional api setMacIcon() in the libboinc_api.a library. This allows science applications to \CocoaLigature0 display an application icon in the Dock) and in the Finder. (The icon does not appear in the Dock until the application displays graphics.) To implement this, do the following:\
\f0 \cf0 (The MakeAppIcon_h command-line utility is built by the Mac boinc XCode project in the "boinc/mac_build/build/" directory.) Add the app_icon.h file to your science application's project.\