Changes between Version 8 and Version 9 of MacBuild
- Timestamp:
- Jul 21, 2007, 10:57:53 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MacBuild
v8 v9 1 1 = Building BOINC Clients and Applications on Macintosh OS X = 2 === Last updated 7/21/07 === 3 2 '''Last updated 7/21/07''' 3 4 4 This document applies to BOINC version 5.10.14 and later. It has instructions for building BOINC for Macintosh OS X, plus information for building science project applications to run under BOINC on Macintosh OS X. 5 5 … … 12 12 Contents of this document: 13 13 14 * Important requirements for building BOINC software for the Mac. 15 * Building BOINC libraries to link with project applications. 16 * Building BOINC Manager, BOINC Client and BOINC libraries. 17 * Building BOINC Manager Installer. 18 * Debugging and BOINC security. 19 * Building project applications. 20 * Upgrading applications for Macs with Intel processors. 21 * Adding a Finder icon to your application 14 [[PageOutline(1-9,,inline)]] 22 15 23 16 == Important requirements for building BOINC software for the Mac == 24 17 25 All BOINC software for Power PC Macs must be built using GCC 3.3 and MacOS10.3.9 SDK to assure backward compatibility with OS 10.3. All BOINC software for Intel Macs must be built using GCC 4.0 and MacOS 10.4.u SDK to allow cross-compiling. '''This includes not only BOINC itself, but also the !WxWidgets, JPEG and cURL libraries, as well as all project applications.'''18 All BOINC software for Power PC Macs must be built using GCC 3.3 and MacOS10.3.9 SDK to assure backward compatibility with OS 10.3. All BOINC software for Intel Macs must be built using GCC 4.0 and MacOS 10.4.u SDK to allow cross-compiling. '''This includes not only BOINC itself, but also the !WxWidgets, JPEG and cURL libraries, as well as all project applications.''' 26 19 27 20 Beware of using the wrong compiler! Apple's release notes for GCC 4.0 say: … … 43 36 == Building BOINC libraries to link with project applications == 44 37 45 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) libboinc_graphics_api.a. There are two ways to do this:38 If you are building a project application to be run by BOINC, you only need to build the BOINC libraries `libboinc_api.a`, `libboinc.a`, and (if you want graphics) `libboinc_graphics_api.a`. There are two ways to do this: 46 39 47 40 1. Use the BOINC autoconf / automake scripts to build these libraries and the jpeg and curl libraries on which they depend. You must do all of this twice: once on a PowerPC Mac running OS 10.3.x (do NOT use OS 10.4), and once on an Intel Mac running OS 10.4.x. … … 56 49 == Building BOINC Manager with embedded Core Client plus libraries libboinc.a and libboinc_graphics_api.a == 57 50 58 BOINC depends on three third-party libraries: wxMac-2.8.0, curl-7.16.4, and jpeg-6b. (We have reverted to using wxMac-2.8.0 because we have found several bugs in later versions of wxMac.)You can obtain these from the following URLs:51 BOINC depends on three third-party libraries: wxMac-2.8.0, curl-7.16.4, and jpeg-6b. (We have reverted to using wxMac-2.8.0 because we have found several bugs in later versions of wxMac.) You can obtain these from the following URLs: 59 52 60 53 wxMac-2.8.0 (needed only if you are building the BOINC Manager): … … 86 79 http://ftp.gnu.org/gnu/automake/automake-1.9.3.tar.gz 87 80 88 ''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.''81 ''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.'' 89 82 90 83 As stated above, all BOINC software for Power PC Macs must be built using GCC 3.3 and MacOS10.3.9 SDK to assure backward compatibility with OS 10.3. All BOINC software for Intel Macs must be built using GCC 4.0 and MacOS10.4.u SDK to allow cross-compiling. … … 98 91 99 92 {{{ 100 101 102 93 curl-7.16.4 94 jpeg-6b 95 wxMac-2.8.0 103 96 }}} 104 97 … … 107 100 108 101 {{{ 109 110 102 cd {path}/BOINC_dev/ 103 svn co http://boinc.berkeley.edu/svn/trunk/boinc 111 104 }}} 112 105 … … 117 110 118 111 {{{ 119 120 112 cd {path}/BOINC_dev/boinc/mac_build/ 113 source setupForBoinc.sh -clean 121 114 }}} 122 115 … … 127 120 128 121 {{{ 129 130 122 cd {path}/BOINC_dev/boinc/mac_build/ 123 source BuildMacBOINC.sh 131 124 }}} 132 125 … … 134 127 135 128 {{{ 136 129 source BuildMacBOINC.sh [-dev] [-noclean] [-all] [-lib] [-client] 137 130 }}} 138 131 139 132 The options for BuildMacBOINC.sh are: 140 133 141 -dev 134 -dev:: 142 135 build the development (debug) version (native architecture only). default is deployment (release) version (universal binaries: ppc and i386). 143 -noclean 136 -noclean:: 144 137 don't do a 'clean' of each target before building. default is to clean all first. 145 138 146 139 The following arguments determine which targets to build 147 140 148 -all 141 -all:: 149 142 build all targets (i.e. target 'Build_All' -- this is the default) 150 -lib 143 -lib:: 151 144 build the three libraries: libboinc_api.a, libboinc_graphics_api.a, libboinc.a 152 -client 153 build two targets: boinc client and command-line utility boinc_cmd(also builds libboinc.a, since boinc_cmd requires it.)145 -client:: 146 build two targets: BOINC client and command-line utility [BoincCmd boinc_cmd] (also builds libboinc.a, since boinc_cmd requires it.) 154 147 155 148 Both -lib and -client may be specified to build five targets (no BOINC Manager.) … … 189 182 == Debugging and BOINC security == 190 183 191 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.rtfand web pages [http://boinc.berkeley.edu/sandbox.php Sandbox Design] and [SandboxUser Sandbox User].192 193 The GDB debugger can't attach to applications which are running as a dif erent 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.184 Version 5.5.4 of BOINC Manager for the Macintosh introduced new, stricter security measures. For details, please see the file [source:trunk/boinc/mac_installer/Readme.rtf Readme.rtf] and web pages [http://boinc.berkeley.edu/sandbox.php Sandbox Design] and [SandboxUser Sandbox User]. 185 186 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, BOINC does not use the special boinc_master or boinc_project users or groups when run from XCode. 194 187 195 188 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. … … 203 196 Apple began shipping Macs with Intel processors on January 10, and Apple expects to convert all its lines of computers to Intel by the end of 2006. 204 197 205 All future releases of BOINC will include 'universal binary' builds for the Macintosh of BOINC Manager, command-line BOINC client and the boinc_cmdcommand-line tool. (Universal binaries contain both PowerPC and Intel executables in one file; the Macintosh OS automatically selects the appropriate one for that computer.)198 All future releases of BOINC will include 'universal binary' builds for the Macintosh of BOINC Manager, command-line BOINC client and the [BoincCmd 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.) 206 199 207 200 The advantage of 'universal binaries' is that you only need to have one copy of the application, and it will run on either PowerPC or Intel Macs, so users don't need to choose between two options. Since BOINC participants manually download BOINC from the web site, we will be providing BOINC in 'universal binary' form. … … 209 202 However, participants do not manually download project applications; this is done automatically by BOINC. So there would be no advantage to combining the Intel and PowerPC versions in a single 'universal binary' file, but doing so would double the size of the download. 210 203 211 So BOINC treats Intel Macs as a new, separate platform. BOINC previously directly supported four platforms: PowerPC Macs ( powerpc-apple-darwin), Intel Linux (i686-pc-linux-gnu), Windows (windows-intelx86) and Solaris (sparc-sun-solaris2.7).204 So BOINC treats Intel Macs as a new, separate platform. BOINC previously directly supported four platforms: PowerPC Macs (`powerpc-apple-darwin`), Intel Linux (`i686-pc-linux-gnu`), Windows (`windows_intelx86`) and Solaris (`sparc-sun-solaris2.7`). 212 205 213 206 '''We have now added a fifth platform for Intel Macs (i686-apple-darwin).''' 214 207 215 As a '''temporary''' measure, projects can set their servers to deliver a copy of their current PowerPC application (renamed for the new platform) under the new i686-apple-darwin platform. 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.)208 As a '''temporary''' measure, projects can set their servers to deliver a copy of their current PowerPC application (renamed for the new platform) under the new `i686-apple-darwin platform`. 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.) 216 209 217 210 If you do this, be sure to give your native Intel application a higher version number when you do release it, so that clients will download it. … … 220 213 221 214 * Screensaver graphics do not work. 222 * 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 uncompleted deadlines and inadequate credit for participants. 223 224 So it is important to make a native Intel application available as soon as possible. 225 226 It is very easy to add a new platform to your server with the xadd utility. For directions on how to do this, see these web pages: 227 [BoincPlatforms Boinc Platforms] and [XaddTool Xadd Tool] 215 * 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 uncompleted deadlines and inadequate credit for participants. 216 217 So it is important to make a native Intel application available as soon as possible. It is very easy to add a new [BoincPlatforms platform] to your server with the [XaddTool xadd utility]. 228 218 229 219 BOINC supports all PowerPC Macs running OS 10.3.0 or later, and all Intel Macs. (The Intel Macs themselves require OS 10.4.4 or later.) 230 220 231 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-darwinbuild on a PowerPC Mac running OS 10.3.9, and your i686-apple-darwin build on an Intel Mac.221 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. 232 222 233 223 But Apple provides the tools to allow you to cross-compile your application on any Mac (PowerPC or Intel) running OS 10.4 or later. Here is how: 234 224 235 All BOINC software for Power PC Macs must be built using GCC 3.3 and MacOS 10.3.9 SDK to assure backward compatibility with OS 10.3. If building a PowerPC application on an Intel Mac, you must also specify '-arch ppc' in the compiler and linker flags.236 237 All BOINC software for Intel Macs must be built using GCC 4.0 and MacOS 10.4.u SDK to allow cross-compiling. If building an Intel application on a PowerPC Mac, you must also specify '-arch i386' in the compiler and linker flags.238 239 You can find examples of how to do this for two different kinds of configure / make scripts in the HEAD branch of the BOINC SVN tree at boinc/mac_build/buildcurl.sh and boinc/mac_build/buildjpeg.sh.240 241 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-darwinplatforms.225 All BOINC software for Power PC Macs must be built using GCC 3.3 and MacOS 10.3.9 SDK to assure backward compatibility with OS 10.3. If building a PowerPC application on an Intel Mac, you must also specify '-arch ppc' in the compiler and linker flags. 226 227 All BOINC software for Intel Macs must be built using GCC 4.0 and MacOS 10.4.u SDK to allow cross-compiling. If building an Intel application on a PowerPC Mac, you must also specify '-arch i386' in the compiler and linker flags. 228 229 You can find examples of how to do this for two different kinds of configure / make scripts in the HEAD branch of the BOINC SVN tree at [source:trunk/boinc/mac_build/buildcurl.sh boinc/mac_build/buildcurl.sh] and [source:trunk/boinc/mac_build/buildjpeg.sh boinc/mac_build/buildjpeg.sh]. 230 231 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. 242 232 243 233 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. … … 254 244 === Adding a Finder icon to your application === 255 245 256 There is an optional api setMacIcon() in the libboinc_api.alibrary. This allows science applications to 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:246 There is an optional API `setMacIcon()` in the `libboinc_api.a` library. This allows science applications to 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: 257 247 258 248 * Use '/Developer/Applications/utilities/Icon Composer.app' to create a xxx.icns file. (Use any name you wish instead of xxx.) … … 260 250 261 251 {{{ 262 252 {path}/MakeAppIcon_h {source_file_path}/xxx.icns {dest_file_path}/app_icon.h 263 253 }}} 264 254 … … 267 257 268 258 {{{ 269 259 #include "app_icon.h" 270 260 }}} 271 261 … … 273 263 274 264 {{{ 275 265 setMacIcon(argv[0], MacAppIconData, sizeof(MacAppIconData)); 276 266 }}} 277 267 * The science application must link with Carbon.framework to use setMacIcon().