wiki:CompileClient

Version 40 (modified by Nicolas, 15 years ago) (diff)

Put library names in real headings

Compiling BOINC client software

The BOINC client software includes:

Linux

If you want to build the client software for local use on your machine only, it is enough to simply build it using

./_autosetup
./configure --disable-server --enable-client CXXFLAGS="-O3 -funroll-loops -fforce-addr -ffast-math"
make
cd packages/generic/sea/
make

The executables are located under the folder BOINC.

If instead you intend to build portable binaries of the client software that should run on a wide variety of GNU/Linux platforms, it is recommended to build the client software using a virtual machine (e.g. running under Microsoft Virtual PC, download the Compatibility virtual machine image). In this case you should build using:

./_autosetup
./configure --disable-server --enable-client-release --build=i686-pc-linux-gnu \
    CXXFLAGS="-O3 -funroll-loops -fforce-addr -ffast-math"
make

See details of the build system.

The result (in the sea/ directory) will be a self-extracting archive (boinc_x.y.z_i686-pc-linux-gnu.sh) containing the BOINC client software.

Other Unix

The result (in the sea/ directory) will be a self-extracting archive (boinc_x.y.z_PLATFORM.sh) containing the BOINC client software. If you have old versions of libraries (curl, openssl etc.) in /usr/lib, and newer versions somewhere else (like /usr/local/lib) you may need to tell the linker where to find the newer versions, as in:

./configure LDFLAGS=-L/usr/local/lib

Here is the list of packages that are needed to compile the BOINC graphics libs on Debian (the same packages should also be available on Ubuntu):

freeglut3-dev libsm-dev libice-dev libxmu-dev libxi-dev libx11-dev libjpeg62-dev

Windows

Building the client with Visual Studio 2005 and Visual Studio 2005 Express Edition.

You can download and install Visual C++ 2005 Express Edition (part of Visual Studio 8 Express). After it downloaded and "installed", go to your local \Visual Studio 8\Microsoft Visual C++ 2005 Express Edition - ENU\ directory and click setup.exe, which will install VC++ 2005 Express Edition in earnest.

Do not forget to update to Visual Studio 2005 Service Pack 1

NOTE: When using Visual C++ 2005 Express Edition, you will also need to download and install the Windows Platform SDK. See this article for further details.

Build Target Build Platform wxWidget Version Environment Variable
Release Win32 2.8.x WXWIN
Release x64 2.8.x WXWINX64
Debug Win32 2.8.x WXWIN
Debug x64 2.8.x WXWINX64
ReleaseSigned Win32 2.6.x WXWINPROD
ReleaseSigned x64 2.6.x WXWINPRODX64
  • In Windows, Start->(Settings)->Control Panel->System, select Advanced; click Environment Variables. Under 'User variables' click New. Create a variable named 'wxwin' with value 'c:\wx' (or wherever you installed it). Then restart Visual Studio.
Example Environment Variables:
WXWIN=C:\Src\SDKs\wx28
WXWINPROD=C:\Src\SDKs\wx26
WXWINPRODX64=C:\Src\SDKs\wx26x64
WXWINX64=C:\Src\SDKs\wx28x64
  • Build wxWidgets. See Compiling wxWidgets for details. You'll need to compile both the Debug and Release targets.
  • When done, go File->Close Solution.
  • Then go File->Open Solution-><BOINCSRCDIR/>\win_build\boinc.sln and press Open.
  • Set up Visual Studio to use the correct platform. From the drop-down menu choose either Win32 (for 32 bit platforms) or x64 (for 64 bit platforms) and choose to make it a Release/Debug? version.
  • Additional linker dependencies for Visual C++ Express
    • boinc_dll
      • advapi32.lib
      • user32.lib
    • boinc
      • advapi32.lib
      • gdi32.lib
      • user32.lib
    • boincmgr
      • oleaut32.lib
  • Go to the Build menu, Build Solution.

All files will be built to <BOINCSRCDIR/>\win_build\Build\Win32\Release (or Build\x64\Release for 64 bit versions). Versions compiled with Visual C++ 2005 Express use the optimizing compiler. Benchmarks are the same as on versions released by Berkeley. The above steps will always build a development version, if you want to change this, edit <BOINCSCRDIR/>\version.h

Building the client with Visual Studio 2008 and Visual Studio 2008 Express Edition.

You can download and install C++ 2008 Express Edition (part of Visual Studio 9 Express). Update it to Service Pack 1. When using the full version of Visual Studio 2008, use this link to update to Service Pack 1.

To be backward compatible with VS 2005 versions and be able to build BOINC for older than Windows XP versions, you will need to download and install the Windows Platform Server 2003 R2 Platform SDK. Next update it with the MSDN Express Library for the Express Edition, or the MSDN Library for Visual Studio 2008 SP1 for the full version (DVD ISO file).

Next download and install the Microsoft Visual C++ 2008 Redistributable Package. When done, update that to Service Pack 1 (Watch out, it uses the same file name as the original one!)

All the service packs for Visual Studio Express Edition cannot be downloaded through Windows Update.

Build Target Build Platform wxWidget Version Environment Variable
Release Win32 2.8.x WXWIN
Release x64 2.8.x WXWINX64
Debug Win32 2.8.x WXWIN
Debug x64 2.8.x WXWINX64
ReleaseSigned Win32 2.6.x WXWINPROD
ReleaseSigned x64 2.6.x WXWINPRODX64
  • In Windows, Start->(Settings)->Control Panel->System, select Advanced; click Environment Variables. Under 'User variables' click New. Create a variable named 'wxwin' with value 'c:\wx' (or wherever you installed it). Then restart Visual Studio.
Example Environment Variables:
WXWIN=C:\Src\SDKs\wx28
WXWINPROD=C:\Src\SDKs\wx26
WXWINPRODX64=C:\Src\SDKs\wx26x64
WXWINX64=C:\Src\SDKs\wx28x64
  • Build wxWidgets. See Compiling wxWidgets for details. You'll need to compile both the Debug and Release targets.
  • When done, go File->Close Solution.
  • Then go File->Open Solution-><BOINCSRCDIR/>\win_build\boinc.sln and press Open.
  • Set up Visual Studio to use the correct platform. From the drop-down menu choose either Win32 (for 32 bit platforms) or x64 (for 64 bit platforms) and choose to make it a Release/Debug? version.
  • For Visual C++ 2008 Express Edition it is necessary to include preprocessor macros to direct the compiler to build for the correct Windows version (this was apparently introduced for Windows Vista). E.g. in Project -> <project_name> Properties, I needed to add these entries to Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions: _WIN32_WINNT=0x0501 and NTDDI_VERSION=0x05010200 -- see sdkddkver.h in the SDK include directory for macro values.
  • Additional linker dependencies for Visual C++ Express
    • boinc_dll
      • advapi32.lib
      • user32.lib
    • boinc
      • advapi32.lib
      • gdi32.lib
      • user32.lib
    • boincmgr
      • oleaut32.lib
  • Go to the Build menu, Build Solution.

All files will be built to <BOINCSRCDIR/>\win_build\Build\Win32\Release (or Build\x64\Release for 64 bit versions). Versions compiled with Visual C++ 2008 Express use the optimizing compiler. Benchmarks are the same as on versions released by Berkeley. The above steps will always build a development version, if you want to change this, edit <BOINCSCRDIR/>\version.h

You can easily ignore all of the warnings that you get when building. Most of them are for the eyes of the developers.

Building library files for use with BOINC built on VS 2008

Next we're building the library files so they work with your compiled client. For this, we need to download the source code for OpenSSL, Zlib and libCurl (direct links to latest stable versions. If a link doesn't work, go to its homepage and choose a mirror).

Unzip the files to easy to reach directories. In the next examples I'll use c:\openssl\, c:\zlib\ and c:\curl\ as the directories of choice. Especially for the OpenSSL directory, make sure you have no spaces anywhere in the path, use hyphens or underscores if need be or else the command line build will break. For the write up I am assuming to use the 32bit option only. If you want to use the 64bit option, make sure you substitute Win32 with Win64 wherever mentioned.

zlib

In Visual C++ go File->Open->Project/Solution?, navigate to c:\zlib\projects\visualc6\ and choose zlib.dsw If it asks to save to the sln file or to convert the present files, answer yes to everything.

In the class view list choose zlib, then click Build->Project configuration. Set Active solution configuration to DLL Release. Make sure at least zlib is selected. Make sure the Platform is set to Win32. Click Close.

Click Project->Properties. Make sure that the Configuration shows DLL Release or (Active)DLL Release. Click OK

Click Build->Clean solution.

Next click Build->Batch build. Click the Project column so all zlib options are at the top, select only the DLL Release|Win32 option in the Build column. Check that the rest of the Build options are not selected. click Build.

When done click File->Close solution. File->Exit to exit the program.

The output files will be in the c:\zlib\projects\visualc6\Win32_DLL_Release\ directory, you will need the zlib1.dll file.

Curl

In Visual C++ go File->Open->Project/Solution?, navigate to c:\curl\ and choose vc6curl.dsw If it asks to convert the present files, answer yes to everything.

In the class view list choose libcurl, then click Build->Project configuration. Set Active solution configuration to using libcurl DLL Release. Make sure libcurl is selected in the Build column. click close.

Click Project->Properties. Make sure that the Configuration shows Release or (Active)Release. Make sure the Platform is set to Win32. Click Apply, click OK

Click Build->Clean solution.

Next click Build->Batch build. Click the Projects column header so all libcurl options are at the top. Select only the libcurl with DLL Release|Win32 in the Build column. Check that the rest of the Build options are not selected. Click Build.

When done click File->Close solution. File->Exit to exit the program.

The output files will be in the c:\curl\lib\DLL-Release\ directory, you will need the libcurl.dll file.

OpenSSL

Lots of command line prompt work here. First off, read c:\openssl\INSTALL.W32 (for Windows 32bit) or \INSTALL.W64 (for Windows 64bit). It'll be explained in there as well how to do this, but in a more rudimentary form.

You will need to get Perl to build OpenSSL. Any Perl will do, but if not sure, then use Strawberry Perl. It's about 15Mb in download and not that much bigger when installed on disk. It'll install by default to your C:\ drive (C:\strawberry)

You now need the Visual C++ command prompt, so start up Visual C++ 2008 (Express Edition). Go Tools->Visual Studio 2008 Command Prompt.

If the line before the blinking cursor shows another drive than c:, we'll have to go to c: first:

  • Type c: in the command line window and press Enter.

Else continue from here.

  • Type cd\openssl and press Enter.
  • Type perl Configure VC-WIN32 --prefix=c:/openssl/ and press Enter. (make sure to use the forward slashes '/', not the backslashes '\' in this path, as the next script is using Unix paths, not Windows paths.)
  • Type ms\do_masm and press Enter.
  • Type nmake -f ms\ntdll.mak and press Enter.

Although the perl Configure script and the do_masm batchfile will work from a normal command line window, the nmake script will not! Hence why you best run all from the VC++ command line window.

The output files will be in the c:\openssl\out32dll\ directory, you will need the libeay32.dll and ssleay32.dll files.

TODO: instructions for creating an installer with Installshield X.

Mac OS X

Instructions for building the BOINC client on Mac OS X are on a separate page.