How to: Building PC Binaries for Boinc (C/C++) June 19, 2008
Posted by genetical in Techincal Support, boinc.Tags: binary, boinc, build, c, glaux, pc
1 comment so far
This first paragraph’s steps are necessary in full if you have no previously installed libraries, otherwise, only some of these steps may be necessary based on your computer’s preexisting libraries. After obtaining and installing Visual Studio 9.0 Professional Edition from Microsoft’s website (90-day trial recommended, do a full install that includes the .NET 3.5 Framework), I had to download Microsoft’s latest SDK here, as well as the Feature Pack, followed by a rollback to Microsoft’s old SDK, found here. Even at this point, two more header files must be downloaded and added to Visual Studio’s “./VC/include/” folder: “version.h” and “config.h“. Just google them and copy the code into notepad, saving them with their respective file names (save as “All Files” and not as “*.txt“!) in the aforementioned include folder.
Using an SVN client, such as Tortoise, I downloaded both the” /boinc” and “/boinc_samples” repositories located at “http://boinc.berkeley.edu/svn/trunk/“. Make sure both folders share the same parent directory.
This site, which describes how to build an app for Boinc, recommends you also install Microsoft’s debugging tools, here.
Once all of this is completed, go to “./boinc_samples/win_build/” and open “samples“. All projects must be updated to exclude the “glaux.lib” library and you must append “kernel32.lib user32.lib gdi32.lib advapi32.lib” to the list of additional dependencies found in Project->References->Linker->Input. This is because the newest version of Microsoft’s SDK deprecated the glaux library into 4 separate libraries – apparently it’s more stable now.
One other change must be made:in line 191 of “stackwalker_win.cpp“, which can be found in the “libboinc” project under “source files”, change “LPSTR” to “PCSTR” so that the line reads:
BOOL CALLBACK SymEnumerateModulesProc(PCSTR /* ModuleName */, DWORD64 BaseOfDll, PVOID /* UserContext */)
Now you should be ready to build the entire solution. You can select whether you want to build debug or release versions for either 32- or 64-bit platforms, or you can do a batch build which allows you to do multiple builds. Once this is done the binaries are made but you must create a “job.xml” file before you can run your executable, otherwise it will not read your input file properly.
The “job.xml” template as well and instructions for it can be found here. Be sure to have this file in the same directory as your binary and input file.
-Chris