SPY
HILL
Research
|
Spy-Hill.net
|
| Poughkeepsie, New York | [DIR] [UP] |
BOINC Developers' Notes
This page contains notes, tips and links for those interested in developing BOINC applications. One way to get up to speed quickly with BOINC is to work your way through the applications, from the "Hello World" program for BOINC through Sextant, the screensaver for Einstein@Home.
Last modified: Sunday, 27-Jan-2008 14:46:32 EST BOINC is complicated, especially when you are first introduced to it. The notes and links below collect together much of what I have learned about BOINC from setting up a BOINC project and creating several BOINC applications.
Topics BOINC Client Building BOINC Applications Graphics Project Managment Developers Links A quick overview of terminology might be helpful. The BOINC "client" is the software you download from Berkeley and install and run on your own computer. The client will in turn download BOINC "applications", which are programs which perform scientific calculations (and optionally display screensaver graphics). A BOINC "project" is a server which provides applications to BOINC clients and allows participants to monitor their participation, as well as talk to each other via disucssion forums and a help desk.
If you just want to run BOINC on your home computer and contribute computer time to one or more projects, then read below about the BOINC client.
If you want to set up your own BOINC project then you might start by reading about how to create and manage BOINC applications, and then read about BOINC project managment.
Other useful sources of information about creating BOINC projects or applications are
The BOINC "Client"
The BOINC "client" (sometimes also called the "core client", though I think "client core" is a more accurate description) is a program which runs on your computer and manages the BOINC "applications" which come from the various projects to which you are "attched" (participating in). The BOINC "Manager" is a graphical program which lets you monitor and manage the core client.You can download the BOINC client and manager from the main BOINC site:
Installation is easy on both Windows and Mac.Installation of the client and manager is not so well developed on Linux, though it is not difficult. These notes may help, though they may be a little bit out of date:
Test versions of the core client, which may not be ready for public consumption but interesting to play with, may be obtained from
- Installing and Running the BOINC client on Unix (including but not limited to Linux).
- Unix start/stop script for BOINC daemon on Linux (Red Hat/Fedora/Mandrake/SuSe). (If someone gets this to work on Debian please send me the diffs and I will update it. It's not clear that it won't run on Debian, it's just I don't have any reports that it does, and no way to test it myself.
Building BOINC and applications
If you want to create your own BOINC project then you will need to get the BOINC source code and create your own BOINC application. These notes tell you how to set up the build environment and build the sample applications:(These three pages are slowly being converted into a larger number of smaller pages on more specific topics. It's a work in progress, so please bear with me.)
- Building BOINC applications on Windows
- Building BOINC and BOINC Applications on Linux
- Building BOINC and BOINC applications on MacOS X
If you have your build environment setup and working 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.
- Hello, World -- the simplest BOINC program
concat - concatenates two or more input files into one output file (from BOINC, no graphics) See boinc/apps.
- Yello, World -- the simplest graphics program for BOINC,
- cube - simplest non-trivial 3D graphics application for BOINC
uppercase - reads text from a file, converting it to upper case. (from BOINC, with graphics) See boinc_samples/uppercase. (Do not confuse this with boinc/apps/upper_case, which is a bare-bones application which is used by the test_uc.py script.)
- The Jack LaLanne program - an API Exerciser
- The 'scroll' application for Pirates@Home - a pathological but interesting example of what not to do. You could skip over this and perhaps come out the better for it.
- The "Sicilian Roulette" application for BOINC - a test of error codes. Skip this too unless you find it interesting.
- Sextant - the Einstein@Home screensaver graphics thread, with some fancy additional features
- Starboard! - xscreensaver GL graphics suite
BOINC examples: The source code for "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.
Spy Hill examples: A collection of at least the last few versions of the source code and build files for my own sample applications is available as tarballs here.
The source code for some of the applications is now also available via CVS, via
cvs -d :pserver:anonymous@spy-hill.net/usr/local/cvsroot/boinc checkout src/appsPlease note however that not all of these applications are up to date.
BOINC Graphics
BOINC graphics are programmed in OpenGL, and use GLUT (the GL Utilities Toolkit), at least on on Linux and Mac. You can quickly test your graphics without BOINC using the 'boinclet', an interface between the BOINC graphics API and GLUT. You can also test your graphics with the science code by running the application in "standalone" mode. Just be sure that the input and output files already exist -- output files are not automatically created in standalone mode.BOINC:
- BOINC Application Graphics
- The "boinclet" - a BOINC graphics API test stand boinclet.C, boinclet.h
- Notes on developing a Unix Screensaver for BOINC
OpenGL Graphics
- The Red Book: OpenGL Programming Guide (Fourth Edition) - The Official Guide to Learning OpenGL, version 1.4, by Dave Shreiner, Mason Woo, Jackie Neider, and Tom Davis (Addison Wesley, 2004).
OpenGL Code Samples from opengl.org Insights on OpenGL for MacOS X. Porting to OpenGL for Windows (from MSDN) OpenGL FAQ 5: Microsoft Windows Specifics 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:
- GLUT API (in HTML form)
- Source code and documentation for freeglut from SourceForge. I've used freeglut with good success on Windows. It should also work for Linux.
- GLUT 3.7 source code for Windows (from Nate Robins)
- Apple GLUT basics for MacOS X.
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.
- Source code zip file for JPEG library for Windows: ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/jpegsr6.zip
- "Solution" and "Project" files to build the JPEG library version 6b using MS Visual C++ 7:
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.
- Obtain the source code tarball for JPEG libary for Unix from the Independent JPEG Group. Go to http://www.ijg.org/files and get the file jpegsrc.v6b.tar.gz
- Unpack the tarball, `cd` into the subdirectory, and give the commands `./configure` and `make`.
- To install the library in /usr/local/bin (the default location) give the command `make install-lib`. (Just saying `make install` installs supporting programs and man pages, but not the library.)
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.)
BOINC developers links
(from the BOINC site)
| http:// www.spy-hill.net /~myers/help/boinc/index.html | Last modified: Sunday, 27-Jan-2008 14:46:32 EST |