This tutorial is now somewhat out of date. Whilst I have no specific plans to update it at the current time, the information contained herein is still generally applicable, and as such, I will leave it here in the hope that it remains useful.
One of the main differences between SETI@Home classic and BOINC is that the BOINC project is open source, hence the source code is freely available. This means we can download and compile the source code with optimizations specifically tailored for our own individual hardware.To compile the BOINC source code you will need to have all the appropriate development packages installed on your system. A list of required development packages is available here (as we are only going to be compiling the client applications, we do not need to have MySQL installed). I initially used Fedora Core 2 with gcc-3.3.3-7 and make-3.80-3 for this tutorial. More recently I have found gcc-3.4.2 as included with Fedora Core 3 gives significantly faster benchmark results.
The reason why the Windows BOINC client returns much faster benchmark results than the Linux client is due to the different compilers used and their relative efficiency (see here for a more detailed discussion on this).
The first thing we need to do is download the source code for BOINC from here. Nightly builds are available in 4 flavours and we need a recent boinc_public-cvs.tar.gz version (I used the nightly builds from October 16, 2004 which are for version 4.13). The non _public versions are test versions and the zip files are Windows sources. Once downloaded, place the tar.gz file in /usr/src and extract:
tar xvzf boinc_public-cvs-2004-10-16.tar.gz
Now change to the source directory (boinc_public) and build the BOINC client:
export CFLAGS="-march=athlon-xp -O3 -fomit-frame-pointer -funroll-loops -fforce-addr -ffast-math -ftracer"
The two export commands set the optimizations to be used. -march=athlon-xp is specific for Athlon XP processors (replace with -march=i686 for Intel processors) and -O3 uses level 3 optimizations (the highest available). For a detailed analysis of the optimizations used and their effect, see the discussion thread here. The configure command runs a configuration script and the --disable-server switch tells it we only want to compile the client, not the server software (this allows us to configure and compile the source without having MySQL installed). The make command actually does the compiling.
If you want to optimize for other processors, try -march=k8 for 64-bit AMD processors, or try -march=pentium3 or -march=pentium4 for 32-bit Intel processors. Some experimentation may be useful here as some unexpected results have been noted. Some good information on different gcc compiler flags can be found here or in the gcc online manual available here.
The configure and final make commands may take a few minutes and lots of output will scroll to the screen, but if all went well you will now have a newly compiled copy of the BOINC client (boinc_4.13_i686-pc-linux.gnu) located in the /usr/src/boinc_public/client directory. Simply copy this file to your boinc directory replacing the original BOINC client. At this point it might be a good idea to rerun the benchmarks using the -run_cpu_benchmarks switch.
When compiling some later versions of the BOINC client (for example, V4.43) on Red Hat or Fedora systems, the --build=i686-pc-linux-gnu switch should be added to the configure script otherwise the build system is incorrectly identified as i686-redhat-linux-gnu causing the client to fail to connect to the project server. This bug has been fixed in subsequent releases (for example, V4.72).