This document applies to BOINC version 7.19.0 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 \cf2 here}}. \
\f1\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. As of 7.15.0, BOINC is built entirely for 64-bit Intel, including the BOINC libraries. As of 7.16.14, BOINC is built as Universal2 Binaries which can run on both 64-bit Intel and Apple Silicon (arm64) hardware. \
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.\
\f0\b \cf0 The above requirements apply not only to BOINC itself, but also to the WxWidgets, c-ares, cURL, openSSL, freetype and ftgl libraries, as well as all project applications
\cf0 You can download Xcode from Apple's App Store (it is large: over 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.1.5, c-ares-1.17.2, curl-7.79.1, openssl-3.0.0, freetype-2.11.0 and ftgl-2.1.3~rc5. 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.1.5, nor the AutoMake scripts supplied with wxWidgets-3.1.5, c-ares-1.17.2, curl-7.79.1, openssl-3.0.0, freetype-2.11.0 and ftgl-2.1.3~rc5. 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:\
\f1\fs24 command. Do not double-click on the scripts or use the
\f2\fs26 sh
\f1\fs24 command to run them.\
\f0\b Note 2:
\f1\b0 This script tries to build all seven third-party libraries: wxWidgets-3.1.5, c-ares-1.17.2, curl-7.79.1, openssl-3.0.0, freetype-2.11.0 and ftgl-2.1.3~rc5. 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
\f2 -clean
\f1 .\
\f0\b Note 3:
\f1\b0
\f2\fs26 setupForBoinc.sh
\f1\fs24 runs
\f2\fs26 buildWxMac.sh
\f1\fs24 to build the wxWidgets library used by BOINC Manager. If you built the wxWidgets library with an earlier version of
\f2\fs26 buildWxMac.sh
\f1\fs24 , then you must rebuild it with the
\f2\fs26 buildWxMac.sh
\f1\fs24 included in the newer source tree. Otherwise, the BOINC Manager build will fail with linker (
\f2\fs26 ld
\f1\fs24 ) errors.\
\f0\b Note 4:
\f1\b0 The \{path\} must not contain any space characters.\
\f1\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.\
\f1\b0 To be compatible with OS 10.7 or earlier, 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.7, 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
\f2\fs26 release_boinc.sh
\f1\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.\
\f1\b0 in the BOINC_dev/boinc/mac_build/ directory builds BOINC. It can be used either with the
\f2 BuildMacBOINC.sh
\f1 script or as a stand-alone project. The
\f5\i Development
\f1\i0 build configuration builds only the native architecture and is used for debugging. The
\f5\i Deployment
\f1\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. \
\
\f0\b Note 2:
\f1\b0 To perform a release build under Xcode 6 or later when not using the
\f2 BuildMacBOINC.sh
\f1 script, select "Build for Profiling" from Xcode's Product menu. To save disk space, do
\f0\b not
\f1\b0 select "Archive."\
\
\f0\b Note 3:
\f1\b0 Using the
\f2\fs26 BuildMacBOINC.sh
\f1\fs24 script is generally easier than building directly in Xcode. The script will place the built products in the directory
\f1\fs24 where they are easy to find. Building directly in Xcode places the built products in a somewhat obscure location. To determine this location, control-click on
\f5\i Products
\f1\i0 in Xcode's Project Navigator and select "Show in Finder." \
\
\f0\b Note 4:
\f1\b0 As of version 7.15.0, BOINC is always built using libc++. Project applications built for libstdc ++ with newer versions of Xcode will not link properly with BOINC libraries built for libc++. \
\
\f0\b Hint:
\f1\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
\f2\fs26 BuildMacBOINC.sh
\f1\fs24 script should use by setting the
\f2\fs26 DEVELOPER_DIR
\f1\fs24 environment variable using the
\f2\fs26 env
\f1\fs24 command. For example, if you have installed Xcode 6.2 in the Applications directory and renamed
\f1\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.15.0 and later builds only for Macintosh computers with 64-bit Intel processors. The executables and libraries are built only for the x86_64 architecture.\
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.9.0, the command would be\
\f1 \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
\f2\fs26 release_boinc.sh
\f1\fs24 script looks for a file
\f2\fs26 ~/BOINCCodeSignIdentities.txt
\f1\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
\f1\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
\f1\b0 Code signed under MacOS 11.0 or later is not compatible with MacOS 10.11.6 or earlier and will be rejected with "Signature invalid." If backward compatibility is desired to allow installing and running on systems prior to MacOS 10.12.0, run the
\f2\fs26 release_boinc.sh
\f1\fs24 script under MacOS 10.15.7 or earlier. You can do this even if you performed the previous steps under MacOS 11.0 or later.\
\cf0 \CocoaLigature0 The LLDB 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
\f1\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, choose "Build" from the product menu, or enter command-B on the keyboard.)\
To restore the standard ownerships and permissions, run the installer or run the {\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/mac_build/Mac_SA_Secure.sh"}}{\fldrslt
\f2 \cf2 Mac_SA_Secure.sh}} shell script in Terminal (the comments in this script have instructions for running it.)\
\cf0 \cb9 \CocoaLigature1 For information on interpreting crash dumps and backtraces, see {\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/trac/wiki/MacBacktrace"}}{\fldrslt
\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.)\
The general instructions in the mac_build folder in the file HowToBuildBOINC_XCode.pdf should also note that if you want to build using XCode in it's GUI implementation - not command line - alone, you need to put all the downloaded libraries in the folder directly above the build folder. For EG:\
Need to go into the top GitHub directory on your system and be unpacked there. Otherwise XCode as the project is currently set up, will not find the libraries. They need to be unzipped there of course.\
\
/Users/<your name>/GitHub/\
\
So that when you build in XCode, they can be found in the existing setup, which looks for them in - for example - \
I found the existing how-to-build pdf slightly misleading. It could be that to command line build would benefit from having the external libraries in this folder directly above the 'boinc' folder.\