Howto Compile Boinc Server

If you are planning to compile the source of Boinc Server, this howto could be usefull.


First of all, I suppose you are going to use Scientific Linux 4.0.4 or a later one. You will need to install the following packages:

  • autoconf
  • automake
  • openssl
  • curl (you will need a newer version than the one that SL has, so you have to search for it in
  • php 4.0+
  • apache 2
  • mysql 4.1+ server and client

Important Notes

If you have enable SElinux in your machine the Boinc Server will not work. To avoid that problem the best (and easy) way is to disable it. You can do that by modifying the file /etc/selinux/config and change the behavior to Permissive.

If you are planning to use the stable version of Boinc from the CVS server you will have a problem. When I have tried to compile that software I get the following error and I cannot build it:

make[2]: Entering directory `/usr/local/src/boinc-stable/apps'
if g++ -DHAVE_CONFIG_H -I. -I. -I..  -fPIC -DPIC -I../lib -I../api -I../db -I../client -I../tools -I../sched -I/usr/include/mysql -g -pipe -m32
-march=i386 -mtune=pentium4 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -pthread  -fPIC
-DPIC -I../lib -I../api -I../db -I../client -I../tools -I../sched -I/usr/include/mysql -g -pipe -m32 -march=i386 -mtune=pentium4
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -pthread -g -O2 -I/usr/include
-I/usr/include/openssl -pthread -MT upper_case.o -MD -MP -MF ".deps/upper_case.Tpo" -c -o upper_case.o upper_case.C; \
then mv -f ".deps/upper_case.Tpo" ".deps/upper_case.Po"; else rm -f ".deps/upper_case.Tpo"; exit 1; fi
upper_case.C:251: error: `GLuint' no nombra a un tipo
upper_case.C: In function `bool app_render(int, int, double)':
upper_case.C:256: error: `GL_COLOR_BUFFER_BIT' no se declaró en este ámbito
upper_case.C:256: error: `GL_DEPTH_BUFFER_BIT' no se declaró en este ámbito
upper_case.C:256: error: `glClear' no se declaró en este ámbito
upper_case.C:257: error: `glLoadIdentity' no se declaró en este ámbito
upper_case.C:258: error: `glColor3f' no se declaró en este ámbito
upper_case.C:260: error: `glRasterPos2f' no se declaró en este ámbito
make[2]: *** [upper_case.o] Error 1
make[2]: Leaving directory `/usr/local/src/boinc-stable/apps'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/boinc-stable'
make: *** [all] Error 2
The solution to my problem was to use the development version that works perfectly well.

Getting the source code

Normally you will have the source code in /usr/local/src, so go there and execute the next command:

cvs -d checkout boinc

Note: there are a little "bug" with the shared memory. To solve it you have to modify some part of the code. Do the next steps and you will fix it:

cd /usr/local/src/boinc/lib
vi shmem.C
and change now the line:

id = shmget(key, size, IPC_CREAT|0660);

by this one:

id = shmget(key, size, IPC_CREAT|0666);

After that you only have to do the next steps:

make && make install

If you don't experience any kind of problem you will have your BoincServer installed.

Creating a Test for Boinc

Well, at this point you will want to try if your Boinc Server is working, so we need to create a new project. The project that we are going to use is a simple "Hello World".

You can download the source code of this program from here. Again you will save that code in /usr/local/src. Unpack it and modify the Makefile to fit your installation. After that execute make and you will have a binary called hello.

The binary is the program that we are going to use with the Boinc Server. In the same folder you will have all necessary files for create the project in the Boinc Server.

Setting up MySQL

First of all we are going to check that the server is running and you can access as root. To know it you only have to type mysql in the command line. After that you will have a MySQL prompt, if you don't have that prompt you must check that the server is installed in the system and running.

Well, now it's time to add the boinc and apache users and passwords. For doing this you have to get again the MySQL prompt and type:

mysql> grant all on *.* to boincadm@localhost identified by 'password';
mysql> grant all on *.* to boincadm identified by 'password';
mysql> grant all on *.* to apache@localhost identified by 'password';
mysql> grant all on *.* to apache identified by 'password';
mysql> exit

Create the Hello World Project

Now we can create the project. You have to choose a folder that will holds the project. I use normally /opt/BoincProjects, choose what you want.

So now you have to execute these commands:

cd /usr/local/src/boinc/tools/
./make_project --delete_prev_inst --drop_db_first --db_user boincadm --db_passwd passwd  --project_root /opt/BoincProjects/hello hello  "Hello World"

Answer Yes to all the question and if you have set up all correctly you will have a new folder called hello in /opt/BoincProjects/.

Now we have to set the proper permissions in that folder. We will need first to create the user and group for Boinc. So type:

/usr/sbin/useradd boincadm
/usr/sbin/groupadd boinc

Now we have to add the user of the apache server to the group of boinc:

vi /etc/group

Change the line:




And now restart the web server.

Finally go the hello project and execute this:

cd /opt/BoincProjects/hello
chown -R apache:boinc *

Modifying the preferences

Now we can modify the preferences of our project. You will have to check the next files:

  • config.xml
  • project.xml
  • html/project/


In this file you will have to modify only one thing, you have to change the option: disable_account_creation from 1 to 0


In this file you will have to modify the app section. The app section will be like this one:

 <user_friendly_name>Hello World</user_friendly_name>

In this file you only have to modify the tag with the url of your server. Normally will be http://server/hello. Server is the name of your server or the IP.

Adding the application Hello

Now we are going to add the application that the boinc clients will use. You have to go to the folder apps in your project folder, and create the next structure: (the name of the folder must be the same as the one you have write in project.xml)

cd /opt/BoincProjects/hello/apps/
mkdir -p hello/hello_1.0_i686-pc-linux-gnu
cp /usr/local/src/hello.d/hello /opt/BoincProjects/hello/apps/hello/hello_1.0_i686-pc-linux-gnu/

Now we have to sign every file that we have in the folder hello_1.0_i686-pc-linux-gnu:

cd /opt/BoincProjects/hello/
crypt_prog -sign apps/hello/hello_1.0_i686-pc-linux-gnu/hello keys/code_sign_private > apps/hello/hello_1.0_i686-pc-linux-gnu/hello.sig

The signature file must have the same name as the original file plus the extension .sig.

After that we can add the project to the Boinc Server:

cd /opt/BoincProjects/hello/

If all went well you are ready to create a work unit.

Creating the Work Unit

To create the work unit we must have first the templates for the work unit. The program hello has that templates, so we have to copy it in the folder templates:

cp /usr/local/src/hello.d/hello_re.xml /opt/BoincProjects/hello/templates
cp /usr/local/src/hello.d/world_wu.xml /opt/BoincProjects/hello/templates
Now we can create the work unit:

cd /opt/BoincProjects/hello/
bin/create_work -appname hello -wu_name helloWU -wu_template templates/world_wu.xml -result_template templates/hello_re.xml
Now we have to add a daemon that could check that boinc clients have done correctly the work:
cd /opt/BoincProjects/hello/
vi config.xml

You have to add the next text to the end of the section daemons:

        sample_trivial_validator -d 3  -app hello

Finally steps

Now you have set up the project, you will only need to test it. To start the server you have to run as root:

cd /opt/BoincProjects/hello/

If you want to know the status of the server you have inside the bin folder a command called status. To stop it, again in bin you have a command called stop.

Now you have to download a Boinc Client for GNU/Linux and run it, attach to the project and then see if all is working. You can check the status of the participants in http://server/hello_ops/.

That's all.

-- Daniel Lombraña González - 08 Nov 2006

Topic attachments
I Attachment History Action Size Date Who Comment
Compressed Zip archivetgz hello-5.08.tgz r1 manage 562.0 K 2006-12-07 - 17:11 UnknownUser Hello World for Boinc
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2006-12-07 - DanielLombrana
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    EGEE All webs login

This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Ask a support question or Send feedback