| 1 | = Building BOINC applications = |
| 2 | |
| 3 | When building a BOINC application, you typically |
| 4 | |
| 5 | * want versions for several platforms (Windows, Mac OS X, Linux); |
| 6 | * want each version to run on a wide range of volunteered computers (e.g. the Linux/x86 version should run on Linux systems of many ages and types). |
| 7 | |
| 8 | Achieving these goals can be challenging. However, BOINC provides tools and example files that simplify the task. |
| 9 | |
| 10 | Whether you're creating a new application or adapting an existing application to BOINC, we recommend that you start by building the BOINC sample application '''upper_case''' on all the platforms you want to support. When this is done, you can use the sample application and its associated project files as a basis for your own application. |
| 11 | |
| 12 | The first step in building the sample application on a given host is to check out the boinc and boinc_samples modules on that host. Put them in the same parent directory. |
| 13 | |
| 14 | == Windows == |
| 15 | We use Windows XP for builds (other Windows versions may work too). |
| 16 | |
| 17 | === Microsoft Visual Studio === |
| 18 | Go to boinc_samples/win_build. If you're using Visual Studio 2005, open samples.sln. If you're using Visual Studio 2003, open samples_2003.sln. Select 'Build/Build Solution', or hit F7. That's it! |
| 19 | |
| 20 | There is a free version, [http://msdn.microsoft.com/vstudio/express/ Visual C++ 2005 Express Edition]; we think (but haven't verified) that it works with the BOINC project file. |
| 21 | |
| 22 | If you use your own project file: |
| 23 | |
| 24 | * It must compile BOINC .C files as C++. To do this: in Properties, see C/C++ -> Advanced -> Compile As. |
| 25 | * If your application uses graphics, go to Properties -> Linker -> Input. In Delay Loaded DLLs add |
| 26 | {{{ |
| 27 | GDI32.DLL;OPENGL32.DLL;GLU32.DLL |
| 28 | }}} |
| 29 | and in Additional Dependencies add |
| 30 | {{{ |
| 31 | delayimp.lib |
| 32 | }}} |
| 33 | * Configure your project to use ANSI strings rather than Unicode. |
| 34 | |
| 35 | === Cygwin === |
| 36 | |
| 37 | TODO: links to required software? |
| 38 | |
| 39 | TODO: develop a Makefile for building uppercase under Cygwin. It can assume that the libraries in boinc/lib and boinc/api have already been built. Verify that _autosetup/configure/make work in boinc/. |
| 40 | |
| 41 | Information from CERN is [https://uimon.cern.ch/twiki/bin/view/LHCAtHome/BoincPort#WinInstr here]. |
| 42 | |
| 43 | === Dev-C++ === |
| 44 | |
| 45 | [http://www.bloodshed.net/devcpp.html Dev-C++] is an open-source development environment based on the GCC compilers. |
| 46 | |
| 47 | TODO: develop a project file for Dev-C++. It should be similar to the Visual Studio project file (i.e. it should include what it needs from boinc/). |
| 48 | |
| 49 | SETI@home uses Dev-C++ for its Windows build; the project file is [http://setiathome.berkeley.edu/~korpela/build/sparc-solaris/seti_boinc/client/win_build/seti_boinc.dev here]. |
| 50 | |
| 51 | == Mac OS X == |
| 52 | Instructions for building applications on Mac OS X are [http://boinc.berkeley.edu/mac_build.php here]. |
| 53 | |
| 54 | == Linux/x86 == |
| 55 | |
| 56 | If you build an application on a recent Linux distribution, it won't run on older Linux distributions because of library incompatibilities. The only solution we've discovered is to build applications on a host with an old Linux and an old gcc. Setting up such a host, however, is a giant pain. |
| 57 | |
| 58 | Our recommended approach is not to build directly on a Linux host, but rather: |
| 59 | |
| 60 | * Install [http://www.microsoft.com/windows/virtualpc/ Microsoft Virtual PC 2004] on a Windows XP machine (preferably one that's fast and has lots of disk). |
| 61 | * Download the [http://boinc.berkeley.edu/vms.php Compatibility] virtual machine module. This is a Debian Linux system with the appropriate (old) version of gcc. |
| 62 | * Run this system under Virtual PC. |
| 63 | * Install the boinc and boinc_samples modules in the same parent directory on the virtual host. |
| 64 | * Build the BOINC libraries: go to the boinc/directory and type |
| 65 | {{{ |
| 66 | _autosetup |
| 67 | ./configure --disable-client --disable_server |
| 68 | make |
| 69 | }}} |
| 70 | Do not 'make install'. |
| 71 | * go to the boinc_samples/uppercase directory and type |
| 72 | {{{ |
| 73 | ln -s `g++ -print-file-name=libstdc++.a` |
| 74 | make |
| 75 | }}} |
| 76 | |
| 77 | == Other UNIX systems == |
| 78 | |
| 79 | * [SoftwarePrereqsUnix Software prerequisites] |
| 80 | * [http://boinc.berkeley.edu/build_system.php configure/build] |
| 81 | |
| 82 | === GLUT notes === |
| 83 | |
| 84 | Freeglut 2.2, freeglut 2.4 and OpenGL Utility Toolkit (GLUT) libraries are supported. |
| 85 | |
| 86 | === X11 notes === |
| 87 | |
| 88 | To get the X11 support, select the relevant options when you're installing Linux, or (Redhat) go to System Settings/Add Software. |