= Compiling BOINC client software = [[PageOutline(1-3)]] The BOINC client software includes: * The core client * The [userw:The_BOINC_Manager BOINC Manager] * [userw:Boinccmd_tool boinc_cmd] (!Unix/Linux only) * The BOINC [userw:The_BOINC_screensaver screensaver] (Windows and Mac only) == 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 " 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 [VmCompatibility 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 [BuildSystem 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 == * Download and install [SoftwarePrereqsUnix prerequisites] * [SourceCode Download current source code] * [BuildSystem Configure (with --disable_server) and make] 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 == If you want to build the BOINC client and wxWidgets by hand, or are still building BOINC 5.10 and below, please follow [CompileWithWxWidgets CompileWithWxWidgets] === Building the client with Visual Studio 2005 and Visual Studio 2005 Express Edition. === '''Supported Operating Systems''': Windows 2000; Windows Server 2003; Windows XP 64-bit; Windows XP Professional Edition ; Windows XP Service Pack 1 and above. This support is mostly for the Windows Platform Server 2003 R2 Platform SDK, which will not install on Windows Vista and Windows 7. If you want to build BOINC on these operating systems, see the build instructions for building BOINC with [http://boinc.berkeley.edu/trac/wiki/CompileClient#BuildingtheclientwithVisualStudio2008andVisualStudio2008ExpressEdition. Visual Studio 2008 (Express Edition)], or follow the VS2005 + Windows Vista/7 [http://boinc.berkeley.edu/trac/wiki/CompileClient#InstallingVS2005onWindowsVistaandWindows7 instructions below]. Software Prerequisites: * Download the [http://go.microsoft.com/fwlink/?linkid=57034 C++ 2005 Express Edition ISO file] (part of Visual Studio 8 Express). * You will need some program to burn the ISO file to CD or DVD, e.g. Nero Essentials. * After you burnt it to disk, reinsert the CD or DVD in the CD/DVD writer and Autostart will take care of the installation start. Follow that through. * Update to [http://www.microsoft.com/downloads/details.aspx?FamilyId=7B0B0339-613A-46E6-AB4D-080D4D4A8C4E&displaylang=en Visual Studio Service 2005 Express Edition Service Pack 1] * When using the full version of Visual Studio 2005, update to [http://www.microsoft.com/downloads/details.aspx?FamilyId=BB4A75AB-E2D4-4C96-B39D-37BAF6B5B1DC&displaylang=en Visual Studio 2005 Team Suite Service Pack 1] * When using Visual C++ 2005 Express Edition, you will also need to download and install [http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB Windows Platform Server 2003 R2 Platform SDK]. * See this [http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx article] for further details. * Update Visual Studio 2005 SP1 with the security update available from Windows Update. * [SourceCode Download the current BOINC source code] (126MB) * Download the [http://boinc.berkeley.edu/trac/browser/trunk/boinc_depends_win_vs2005 VS2005 Additional Dependencies] (approx. 1GB) * See [http://boinc.berkeley.edu/trac/wiki/SourceCode#UsingSubversion Using Subversion] on how to download the additional dependencies. * In Windows, Start->(Settings)->Control Panel->System, select Advanced; click Environment Variables. Under 'User variables' click New. Create a variable named 'wxwin' with value as in the example below. || 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 || {{{ Example Environment Variables: WXWIN=C:\Src\boinc_depends_win_vs2005\wxwidgets\mswin\Win32 WXWINX64=C:\Src\boinc_depends_win_vs2005\wxwidgets\mswin\x64 }}} The above are examples. If you saved the boinc_depends_win_vs2005 directory elsewhere, adjust the path. * Start Visual Studio 2005 -> Visual C++ 2005 (Express Edition) * First we set up VS 2005 to use the Platform SDKs: * Tools->Options. * Open Projects and Solutions->VC++ Directories. * Make sure your Platform is correctly set (Win32 for instance). * Now from the drop down menu in the top right corner, select Include files and point it to the Win Platform Server 2k3 R2 Platform SDK\Include directory. * Then select Library files from the drop down menu and point it to Win Platform Server 2k3 R2 Platform SDK\Lib * OK out of there. * Then go File->Open Solution->\win_build\boinc.sln and click 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 (right click the project name, properties, Linker, Input, double click the ... box on Additional Dependencies and add those missing). * boinc_dll * advapi32.lib * user32.lib * kernel32.lib * boinc * advapi32.lib * gdi32.lib * user32.lib * kernel32.lib * boincmgr * ole32.lib * oleaut32.lib * Go to the Build menu, Build Solution. All files will be built to \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 \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. === Installing VS2005 on Windows Vista and Windows 7 === To apply Visual Studio 2005 (Express Edition) on Windows Vista and Windows 7, please check the following points step by step: * Download the [http://go.microsoft.com/fwlink/?linkid=57034 C++ 2005 Express Edition ISO file] (part of Visual Studio 8 Express). * You will need some program to burn the ISO file to CD or DVD, e.g. Nero Essentials. * After you burnt it to disk, reinsert the CD or DVD in the CD/DVD writer and Autostart will take care of the installation start. Follow that through. * Update to [http://www.microsoft.com/downloads/details.aspx?familyid=7b0b0339-613a-46e6-ab4d-080d4d4a8c4e&displaylang=en Visual Studio 2005 Express Edition Service Pack 1]. Please run it with administrator privileges (Right-click the icon >> "Run as Administrator") * When using the full version of Visual Studio 2005, update to [http://www.microsoft.com/downloads/details.aspx?FamilyId=BB4A75AB-E2D4-4C96-B39D-37BAF6B5B1DC&displaylang=en Visual Studio 2005 Team Suite Service Pack 1] * Update to [http://www.microsoft.com/downloads/details.aspx?FamilyID=90E2942D-3AD1-4873-A2EE-4ACC0AACE5B6&displaylang=en Visual Studio 2005 Service Pack 1 For Windows Vista And Windows 7]. Please run it with administrator privileges (Right-click the icon >> "Run as Administrator") * You will need this update on the full version of Visual Studio 2005 as well. Instead of using the Windows Platform Server 2003 R2 Platform SDK, which cannot be installed on Windows 7, we choose to use the [http://www.microsoft.com/downloads/details.aspx?familyid=C17BA869-9671-4330-A63E-1FD44E0E2505&displaylang=en Windows SDK for Windows 7 and .NET Framework 3.5 SP1] instead. Please run it with administrator privileges (Right-click the icon >> "Run as Administrator") * Update Visual Studio 2005 SP1 with the security update available from Windows Update. (Visual Studio 2005 update (KB971090) (249.1MB) and a CAPICOM update (349KB). Now continue with downloading the source code and setting up the environment variables as [http://boinc.berkeley.edu/trac/wiki/CompileClient#BuildingtheclientwithVisualStudio2005andVisualStudio2005ExpressEdition. shown above]. === Fixing Visual Studio 2005 object files after having them compiled with VS2008 === If you ever built BOINC with Visual Studio 2008, then your object files will have been converted to VS2008 style. When building the source code in VS2005, you'll find Fatal error LNK1103: debugging information corrupt errors. This can be fixed by downloading and installing the hotfix for VS2005 in [http://support.microsoft.com/kb/949009/ this Microsoft Knowledgebase article]. === Building the client with Visual Studio 2008 and Visual Studio 2008 Express Edition. === Building project using Visual Studio 2008 has become much simpler since it was first posted. Software Prerequisites: Visual Studio 2008 with at least C++ package included. For example C++ 2008 Express Edition, Developer Edition or Team Suite (contains all available packages). * Download and install [http://www.microsoft.com/express/download/default.aspx C++ 2008 Express Edition] (part of Visual Studio 9 Express). * Update it to [http://www.microsoft.com/downloads/details.aspx?FamilyId=F3FBB04E-92C2-4701-B4BA-92E26E408569&displaylang=en Service Pack 1]. * When using the full version of Visual Studio 2008, use [http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E this link] to update to Service Pack 1. * Download and install the [http://www.microsoft.com/downloads/details.aspx?familyid=C17BA869-9671-4330-A63E-1FD44E0E2505 Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1] * Download and install [http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en the Microsoft Visual C++ 2008 Redistributable Package]. * Update that to [http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en Service Pack 1] (Watch out, it uses the same file name as the original one!) * [http://www.microsoft.com/downloads/details.aspx?familyid=8b29655e-9da4-4b6b-9ac5-687ca0770f93&displaylang=en 64bit versions] of Microsoft Visual C++ Redistributable Packages are also available. See [http://support.microsoft.com/kb/973551/ this entry in the MSKB] for more information. * Update Visual Studio 2008 SP1 with the security update available from Windows Update. Preparing project source code: I would advise you to create single, short named directory at the root of windows drive, for example "C:/Boinc". Inside of this directory you will download and create two directories with source codes coming from two separate projects: "Boinc" and "boinc_depends_win_vs2005". Here is how you get them: * [SourceCode Download the current BOINC source code] [http://boinc.berkeley.edu/svn/trunk/boinc Boinc] (126MB) * Download the [http://boinc.berkeley.edu/trac/browser/trunk/boinc_depends_win_vs2005 VS2005 Additional Dependencies] (approx. 830MB) * See [http://boinc.berkeley.edu/trac/wiki/SourceCode#UsingSubversion Using Subversion] on how to download the additional dependencies. * Yes, even for building with VS2008, you will need the Additional Dependency download, as the source code points to it. * 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' as in the example below. || 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 || {{{ Example Environment Variables: WXWIN=C:\Src\boinc_depends_win_vs2005\wxwidgets\mswin\Win32 WXWINX64=C:\Src\boinc_depends_win_vs2005\wxwidgets\mswin\x64 }}} The above are examples. If you saved the boinc_depends_win_vs2005 directory elsewhere, adjust the path. * Go File->Open Solution->\win_build\boinc.sln and click 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. Correct small error in the project "boincsvcctrl". Go to properties of the project (Right click, properties), Configuration Properties/Manifest Tool/Input and output - clean the "Additional Manifest Files" field. This will remove the conflict, that would otherwise give compilation error: Error 96 manifest authoring error. * Go to the Build menu, Build Solution. All files will be built to \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 \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. To run the resulting projects, you will need the copy of the MSVCR80.dll, msvcp80.dll and msvcm80.dll. You can find them in Microsoft SDK products installed on your PC === 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. Download the source code for [[br]] * [http://www.openssl.org/source/openssl-0.9.8k.tar.gz OpenSSL];[[br]] * [http://www.zlib.net/zlib-1.2.3.tar.gz Zlib];[[br]] * [http://curl.haxx.se/download/curl-7.19.4.tar.gz libCurl];[[br]] * [http://www.sqlite.org/sqlite-amalgamation-3_6_14_2.zip Sqlite3][[br]] '''WARNING:''' Do not use the OpenSSL, zlib1, libCurl and sqlite3 versions from the additional_dependency_VS2005 download, these are prepped for VS2005 only and will not work in BOINC compiled with VS2008! You will need to build these files by hand for VS2008 compatibility. Unzip the files to easy to reach directories. In the next examples I'll use c:\openssl\, c:\zlib\, c:\curl\ and c:\sqlite3 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. It should be copied to your BOINC binary directory. ==== 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. It should be copied to your BOINC binary directory. ==== 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 [http://www.activestate.com/activeperl/ ActivePerl]. It'll install by default to your C:\ drive (C:\Perl) 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. These should be copied to your BOINC binary directory. ==== Sqlite3 ==== Open the c:\sqlite3\sqlite3.zip file that you downloaded, but do not unzip the contents yet. (Preferably use an external program such as 7zip, Winzip or WinRAR) Start Visual Studio 2008. [[br]] * File->New->Project [[br]] * Choose CLR plus Class Library. [[br]] * For Name fill in '''sqlite3''' [[br]] * For Location point to a new directory called sqlite3. Do '''not''' use the original directory. [[br]] * Uncheck "Create directory for solution". [[br]] * Click OK.[[br]] This will create the solution files (sqlite3.sln, sqlite3.suo, and sqlite3.ncb) and project files (sqlite3.vcproj, etc).[[br]] Now go to back the opened zip file for sqlite3 and extract the files in it to the new sqlite3 directory that was made by VS2008, the one containing the solution files. Click Yes to overwrite files. Visual Studio will tell you that the source code files have changed and should it reload them? Click Yes to all. In the Resource Files project there is a file called ''sqlite3.cpp'', right click on it and choose Remove. Click Remove again on the warning screen. * From the menu bar, make sure your Solution Configuration Shows Release and the platform you are building for (32bit or 64bit)[[br]] * Now click Build->Build Solution. [[br]] That's it. The sqlite3.dll file can be found in your \sqlite3\Release\ directory. It should be copied to your BOINC binary directory. TODO: - instructions for creating an installer with Installshield X.[[br]] OLD: Before, the following steps must have been performed. As of 2009-12-01 they are not needed anymore Packages used in past: [http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB Windows Platform Server 2003 R2 Platform SDK]. MSDN: * Update it with the [http://www.microsoft.com/express/download/default.aspx MSDN Express Library] for the Express Edition. * Use the [http://www.microsoft.com/downloads/details.aspx?FamilyID=7bbe5eda-5062-4ebb-83c7-d3c5ff92a373&DisplayLang=en MSDN Library for Visual Studio 2008 SP1] for the full version (DVD ISO file). This step will be performed automatically, so just verify: * Start Visual Studio 2008 -> Visual C++ 2008 (Express Edition) * First we set up VS 2008 to use the Platform SDK: * Tools->Options. * Open Projects and Solutions->VC++ Directories. * Make sure your Platform is correctly set (Win32 for X86 code generation, Win64 for X64 code generation). * Now from the drop down menu in the top right corner, select Include files and point it to the Win Platform Server 2k3 R2 Platform SDK\Include directory. * Also point it to use ..\Program Files\Microsoft SDKs\Windows\V6.0a\Include * Then select Library files from the drop down menu and point it to Win Platform Server 2k3 R2 Platform SDK\Lib * And point this to use ..\Program Files\Microsoft SDKs\Windows\V6.0a\Lib as well. * OK out of there. * Additional linker dependencies for Visual C++ Express (right click the project name, properties, Librarian, Input, double click the ... box on Additional Dependencies and add those missing). * boinc_dll * advapi32.lib * user32.lib * kernel32.lib * boinc * advapi32.lib * gdi32.lib * user32.lib * kernel32.lib * boincmgr * ole32.lib * oleaut32.lib == Mac OS X == Instructions for [MacBuild building the BOINC client on Mac OS X] are on a separate page.