Windows 7 Build Setup

From Cryptohaze Project Wiki
Jump to: navigation, search

This guide goes from a stock Windows 7 box to a box capable of doing Cryptohaze dev, both CUDA and OpenCL. It assumes the same system used for Linux, with an ATI card driving the display, and one or more other GPUs to include nVidia GPUs present in the system.

Contents

Basic Setup

Install Windows 7 64-bit and update it. This should take a bunch of reboots & a good long while, annoyingly.

When done, you'll want to download the following items:

  • ATI Catalyst drivers for Windows (currently 12.4)
  • ATI OpenCL SDK for Windows (currently 2.6)
  • nVidia GPU driver for Windows (currently the 4.2 devdriver)
  • nVidia CUDA toolkit for Windows (currently 4.2)
  • nVidia CUDA SDK/code samples for Windows (currently, surprise, 4.2!)

Install the ATI Driver

This should be easier than on Linux.

Install the ATI driver.

I did a custom install to make sure absolutely everything got installed.

Install the nVidia driver

Install the nVidia driver next.

I did a custom install with the clean install option, despite not having former nVidia drivers around.

Curse

Now, you should have both devices working. Wasn't that easy? Why do I code on Linux again as a primary OS? This was painless!

Install the SDKs and toolkits

For all the downloads above, install the proper SDK/toolkit/etc. Pick your locations, though I'd suggest putting the CUDA SDK in your home directory, not in the weird default location (this matches Linux, which puts it in ~/NVIDIA_GPU_Computing_SDK or such). You don't technically have to install the AMD APP SDK if you don't want to - but it's nice to have the kernel analyzer available.

Download VS 2010 and Windows SDK 7.1

(I'm doing this for the first time, so... apologies if steps are slightly out of order)

Step 1 is to download Visual Studio Express 2010.

http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express is a good place to start. Download the installer, and run it (vc_web.exe). You don't need the SQL 2008 additional download.

You'll also need the Windows SDK (currently 7.1) for the 64-bit compilers - unless you want to do 32-bit only builds, which are not fully supported...

http://www.microsoft.com/en-us/download/details.aspx?id=8279 is a good starting point to download this - you'll want to run winsdk_web.exe when downloaded!

The default install here is just fine.

Finally, download and install the Windows SDK 7.1 SP1 update: http://www.microsoft.com/en-us/download/details.aspx?id=4422

And, to fix missing header file, VS2010 SP1. http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=75568aa6-8107-475d-948a-ef22627e57a5

And, bloody hell, fix the missing batch file for VS2010 Express. This is getting downright absurd.

In C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64, create "vcvars64.bat" with the following (you will need to be running as administrator):

CALL setenv /x64

SVN Client

You'll need a SVN client to check out the Cryptohaze tools. I use RapidSVN on Windows - http://rapidsvn.tigris.org/ Download & install the latest version.

To check out the repository:

It'll take a while, and you should get the source downloaded nicely into your home dir.

Great - now you have the source. Unfortunately, you're missing some prerequisites... like Boost.

Install Boost

Download Boost from boost.org - I normally download the zip version on Windows. Anything newer than 1.47 *should* work. I'd suggest extracting it with 7zip or winzip or something - it takes FOREVER with the stock Windows zip extractor!

Start up your VS command shell - Start->All Programs->MS VS Express->Command Prompt

Change to the directory you've extracted boost in - perhaps "cd \Users\[your username]\Downloads\boost_1_49_0" ?

Run "bootstrap.bat" to build the builder.

If it completes, you should have a "b2.exe" in the directory now. Awesome!

Let's start with the 64-bit libraries first.

b2.exe --toolset=msvc-10.0 --build-type=complete --without-mpi --without-python architecture=x86 address-model=64 stage

If you have a multicore box (I know you do!), you can use "-j#" for the number of threads to run in parallel - usually 1.5x your number of cores.

Now is a time for a walk/movie/nap/sex with your {girlfriend,fiancee,wife,boyfriend,whatever}.

Once this is done, move them to the x64 subdirectory.

cd stage\lib
mkdir x64
move * x64
cd ..\..

Now, make the 32-bit libraries.

b2.exe --toolset=msvc-10.0 --build-type=complete --without-mpi --without-python stage

And, move them to the x86 dir.

cd stage\lib
mkdir x86
move *.lib x86
move *.dll x86
cd ..\..

Great - boost has been compiled.

Let's move boost to somewhere a bit saner - perhaps C:\boost_1_49_0 ?

move boost_1_49_0 c:\

Boost is ready to go!

Install cmake

http://www.cmake.org/cmake/resources/software.html - go, download, install.

Install libcurl

Download libcurl: http://curl.haxx.se/download.html

You can put it in the dependencies directory of Cryptohaze-Dev, or wherever you want. Because I'm on a dedicated build system, I'll put it in C:\curl-7.25.0\

In VS2010, open c:\curl-7.25.0\lib\libcurl.sln and let it convert it. You can build the 32-bit library now. To build a 64-bit library, click the "Win32" dropdown, go to Configuration Manager, and under Active Solution Platform, select "new". Create a new x64 solution, copying from the existing win32 settings. You should now be able to build a 64-bit version of libcurl in c:\curl-7.25.0\lib\Release\libcurl.lib -

Install protobuf

You'll need Google Protobuf to build the new multiforcer. http://code.google.com/p/protobuf/downloads/list is a good place to get it. I'll put it in with my other dependencies in C:\Dev\

Open the solution in the vsprojects subdirectory, and let VS convert it to the new format.

Add the x64 solution type in the Win32 dropdown - add x64. You should now be able to build libprotobuf. You won't need the rest of it.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox