SPY HILL Research
Spy-Hill.com

Poughkeepsie, New York [DIR] [UP]

How to create BOINC Applications


(abstract here)

Last modified: 12 September 2011
See also: Creating and Configuring a BOINC Project

These notes tell you how to set up the build environment and build several sample applications:

If you have your build environment setup and working on Linux or Mac you can verify that everything is working well using a script I've written to automatically check out the latest code and build BOINC:

You'll likely only want to try this after you have your build machine properly configured.

BOINC Applications

The easiest way to learn to write your own BOINC application is to work your way through the examples listed below. Two of the examples come with the BOINC distribution, concat and upper_case. I have written the others as I have myself learned more and more about creating BOINC applications. I hope the notes are useful, at least for getting someone started.

Spy Hill examples: The source code for many of the example programs is availible either as a tarball (here), or via CVS:

cvs -d :pserver:anonymous@spy-hill.net/usr/local/cvsroot/boinc checkout src/apps

BOINC examples: The source code for the BOINC sample application "concat" is in the BOINC source distribtuion in boinc/apps, while 'uppercase' is in the separate "boinc_samples" collection, in boinc_samples/uppercase. The "upper_case" program in boinc/apps (not the slight name difference) is for elementary testing of a project installation and is not a full working application. [No longer true! boinc_samples has been merged back into the main boinc SVN. This needs to be updated.]

BOINC Graphics

BOINC graphics are programmed in OpenGL, and use GLUT (the GL Utilities Toolkit), at least on on Linux and Mac. You can easily test your graphics running the graphics application in "standalone" mode.

BOINC

OpenGL Graphics

GLUT (GL Utility Toolkit)

BOINC does not use the full GLUT API, but it does borrow some functionality and functions. The amount of GLUT in BOINC is different on different platforms. On Windows GLUT is used just for fonts. On Linux GLUT is also used to open windows and so the Linux version of BOINC is more dependent on GLUT than the Windows version. (I will try to fill in more details later...)

Here are some useful links for GLUT:

JPEG Library

There are various versions of the JPEG code or at least headers available on the net or through different software distributions. You cannot go wrong by building the libraries yourself from the canonical sources, though it may take some extra effort. The library may be either static or dynamic, and you can now also build BOINC with SANS_JPEG to exclude dependence on the JPEG library (I've not yet tested this).

On Windows I built the JPEG library from the source here, and I created Solution and Project files for this which others can use:

On Linux you may already have the JPEG library installed on your system, though you need to use the "developer" package, which includes the proper headers. That is, you need the libjpeg-devel package, not just libjpeg. The library installed by this package may be either static or dynamic. I found that in Fedora Core 4 the library is static (libjpeg.a) while in Fedora Core 5 it is dynamic (libjpeg.so). Either will do, but you may have to adjust the Makefile for your application to use a dynamic library.

The one problem with using a dynamic library is that the executable will fail on a client computer where the dynamic library is unavailable. To avoid this you can build the static library from source if it is not available on your build machine. Doing so is easy:

I see no compelling reason to prefer use of a dynamic version of the JPEG library, while there is a good reason to link statically.

On Mac you can get a pre-built version of the JPEG library via Fink, or you can build the static library from source, as just described above. (It may also be included as Framework in XCode, but I'm not yet sure of that.)


Please send corrections or suggestions for improvement to
myers@spy-hill.net
http:// www.Spy-Hill.com /~myers/help/boinc/BOINC_Apps.html Last modified: 12 September 2011