This document applies to BOINC version 7.7.3 and later. It has instructions for building the BOINC Client and Manager for Macintosh OSX. Information for building science project applications to run under BOINC on Macintosh OSX can be found {\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/trac/wiki/BuildMacApp"}}{\fldrslt here}}. \
\b0 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 As of version 6.13.0, BOINC does not support Macintosh PowerPC processors.Although BOINC supports 64-bit Intel project applications on Mac OS 10.6.0 and above, the only parts of the BOINC client package built as 64-bit executables are the screensaver coordinator 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.\
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.8.x or later and cross-compile for the various platforms. The remainder of this document describes that process.\
\b \cf0 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
\cf0 You can download Xcode 4.6 or later from Apple's App Store (it is large: about 4 GB). If you are a member of Apple's Mac Developer Program, you can also download it from Apple's web site: {\field{\*\fldinst{HYPERLINK "http://developer.apple.com"}}{\fldrslt
\cf0 BOINC depends on seven third-party libraries: wxWidgets-3.0.0, c-ares-1.11.0, curl-7.50.2, openssl-1.1.0, freetype-2.6.2, ftgl-2.1.3~rc5 and sqlite-3.11.0. You can obtain the source files from the following URLs. Clicking on the first URL of each pair will download the tar file. The second URL will open the third party\'92s home web page. On Mac OS X the tar file will usually be downloaded into the Downloads folder. You will need to expand the tar files by double-clicking on them, which will create a folder and place the appropriate files into that folder. You will need to move these folders later.\
\cf0 These are not done automatically by either the Xcode projects which come with wxWidgets-3.0.0, nor the AutoMake scripts supplied with wxWidgets-3.0.0, c-ares-1.11.0, curl-7.50.2, openssl-1.1.0, freetype-2.6.2, ftgl-2.1.3~rc5 and sqlite-3.11.0. So be sure to use our special scripts to build these packages.\
\cf0 [1] Make sure you are logged into the Mac using an account with administrator privileges. 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.\
[3] If you have not yet done so, install Xcode and launch it once to accept the license agreement and complete the installation.\
\
[4] 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 (if you have problems, you may need to enter
\cf0 The command above retrieves the source code from the HEAD / MASTER (TRUNK) or development branch of the git repository. For more information on getting the BOINC source code, see:\
\b0 This script tries to build all seven third-party libraries: wxWidgets-3.0.0, c-ares-1.11.0, curl-7.50.2, openssl-1.1.0, freetype-2.6.2, ftgl-2.1.3~rc5 and sqlite-3.11.0. 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.) To make it easier to find the error messages, clear the Terminal display and run the script again without
\b0 You don't need to type the path to a file or folder into Terminal; just drag the file or folder icon from a Finder window onto the Terminal window.\
\b0 To be compatible with OS 10.6 and OS 10.7, the screensaver must be built with Garbage Collection (GC) supported (and without Automatic Reference Counting) , but Xcode versions later than 5.0.2 do not allow building with GC. To allow building with newer versions of Xcode while keeping backward compatibility to OS 10.6, the GIT repository includes the screensaver executable built with GC, while the Xcode project builds the screensaver with ARC (for newer versions of OS X.) The
\f1\fs26 release_boinc.sh
\f0\fs24 script (described later in this document) adds both the GC and ARC builds of the screensaver to the installer; the installer code selects the correct screensaver for the target version of OS X at install time.\
\i0 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. \
\b0 To perform a release build under Xcode 4.6 when not using the
\f1 BuildMacBOINC.sh
\f0 script, select "Build for archiving" or "Build for Profiling" from Xcode's Product menu. Under Xcode 5.0 or later, select "Build for Profiling." To save disk space, do
\f0\fs24 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. \
\b0 By default, BOINC is built using libstdc++ for compatibility with older versions of OS X, unless
\f1\fs26 BuildMacBOINC.sh
\f0\fs24 is called with the -libc argument. Newer versions of Xcode build using libc++ by default. Project applications built for libc++ with newer versions of Xcode will not link properly with BOINC libraries built for libstdc++. However, libc++ is not available before OS 10.7, so project applications will fail to run under earlier versions of OS X unless built for libstdc++. To build project applications that will run on older versions of OS X, pass the following option to the LLVM compiler:
\f1 -stdlib=libstdc++
\f0 and avoid using any c++11 specific constructs in your code. If you are building your application using Xcode, you can select the C++ Standard Library in the build settings under "Apple LLVM - Language - C++" or by setting the "OS X Deployment Target" earlier than OS 10.7.\
\b0 You can install multiple versions of Xcode on the same Mac, either by putting them in different directories or by renaming Xcode.app of different versions. You can then specify which version the
\f1\fs26 BuildMacBOINC.sh
\f0\fs24 script should use by setting the
\f1\fs26 DEVELOPER_DIR
\f0\fs24 environment variable using the
\f1\fs26 env
\f0\fs24 command. For example, if you have installed Xcode 5.0.2 in the Applications directory and renamed
\f1\fs26 Xcode.app
\f0\fs24 to
\f1\fs26 Xcode_5_0_2.app
\f0\fs24 , you can invoke the script with:\
\pard\pardeftab720
\f1\fs26 \cf0 env DEVELOPER_DIR=/Applications/Xcode_5_0_2.app/Contents/Developer sh BuildMacBOINC.sh
\f0\fs24 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.\
The standard release of BOINC version 7.4.42 and 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.\
In order to execute BOINC Manager, you must install it using BOINC Manager Installer. Otherwise, you will encounter an error prompting for proper installation.\
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 7.5.0, the command would be\
\f0 \cf0 Mac 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
\f0\fs24 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
\f0\fs24 file, then the script will not sign the installer or uninstaller. Code signing is not necessary if you won't be transferring the built software over the Internet. For more information on code signing identities see the documentation for the {\field{\*\fldinst{HYPERLINK "https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/codesign.1.html"}}{\fldrslt
\f0\fs24 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 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
\i0 \CocoaLigature0 build does not use the special boinc_master or boinc_project users or groups, and so can be run under the debugger from Xcode. 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.)\
\cf0 \cb5 \CocoaLigature1 For information on interpreting crash dumps and backtraces, see {\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/trac/wiki/MacBacktrace"}}{\fldrslt \cf2 Mac Backtrace}}.\cb1 \
\cf0 \CocoaLigature0 The BOINC Xcode project links the BOINC Manager with the non-debugging (Deployment) build of wxWidgets for the Deployment build configuration of the Manager, and with the debugging (Development) build of wxWidgets for the Development build configuration of the Manager. You should use the Development build of the Manager and wxWidgets for debugging; this allows you to step into internal wxWidgets code. With the Development build, you can even put breakpoints in wxWidgets; this is most easily done after stepping into a function in wxWidgets source file containing the code where you wish to put the breakpoint.\
If Xcode is obtained from the Apple Store then it will be installed automatically into the Applications folder. 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.)\