Build Guide

From Cryptohaze Project Wiki
Revision as of 13:42, 24 August 2012 by Hacker949 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Teh Ugly...

Contents

Overview

There are several reasons to build from source. The first is if you're modifying things. The second is if you want packages built for something I don't support (such as 32-bit Linux for now). The third... is if you're someone who feels that if you didn't compile it yourself after inspecting the source, it's not legit. Fortunately, if you're insane enough to want to build from source, it's now somewhat less painful than before!

The new combined source tree is even better - it almost always builds without failing, and will work on all platforms.

Getting the source

To get the source, you'll want to pull via SVN - the SVN is at http://sourceforge.net/projects/cryptohaze/

Most of the top level directories are old now, and should be removed.

Check out the Cryptohaze-Combined source tree.

In whatever directory you wish to work from,

svn co https://cryptohaze.svn.sourceforge.net/svnroot/cryptohaze/Cryptohaze-Combined Cryptohaze-Combined

If you're on Windows, I recommend RapidSVN, and you can check out the same source tree.

Windows Builds

Building on Windows requires having Visual Studio 2008 installed, and the CUDA SDK (current builds are against 3.2 but 4.0 should work - I'll verify this soon). You'll need to be able to build the CUDA SDK samples properly, which is beyond the scope of this particular example.

You will also have to have the Boost headers & libraries built and installed. Set up the paths to these in your general Visual Studio preferences, as this will be different for everyone.

Once you have this working, open up the solution in build_windows/CryptohazeTools - you should see 12 or so projects load.

If you have everything installed properly, you can just build the solution (x64, Release) and it should work.

If not, check the error messages. If they're linker errors about boost, you don't have boost installed properly. Otherwise, ping me on IRC and I'll see what I can do to help. Or just download the binary release.

I'm not sure that it will build 32-bit clean right now. If there's a demand for this, I will attempt to get all that working.


Linux Builds

Linux is a bit easier. You'll need:

  • The CUDA toolkit[1] installed & the SDK installed in your home directory
  • The boost dev libs (v 1.47 or above) installed on the system
    • For Ubuntu: sudo apt-get install libboost1.48 libboost1.48-dev
    • For SuSe: boost libs v1.47+ not available in repositories, see "Generic Linux" instructions
    • Generic Linux: download and build from http://www.boost.org/users/download/
  • The curl libraries
    • For Ubuntu: sudo apt-get install libcurl4-gnutls-dev
    • Generic Linux: starting from the top level svn checkout folder, run these commands:
      • cd cryptohaze/Cryptohaze-Combined/dependencies
      • tar zxvf curl-7.26.0.tar.gz
      • cd curl-7.26.0
      • sh ../curl/buildcurl.sh
  • A protocol buffer library
    • For Ubuntu: sudo apt-get install libprotobuf-dev
    • For SuSe: sudo zypper install libprotobuf7 (...this needs to be confirmed...)
  • The cmake build system

Then run the following commands to compile:

  1. cd build
  2. cmake ..
  3. make

OS X Builds

OS X looks about the same as Linux. Install CUDA bits in /Developer as default, and try running make.

Building with CMake

We're in the process of transitioning the build system into CMake so we only have to maintain a single build system across all platforms. It's lacking some optional features (32 bit builds, only staticly links against boost, no optional cuda/opencl only, ...) and only tested on 64bit Ubuntu 10.04.

To quickly get started, install the cmake package. For those interested, cmake-gui is a pretty good frontend which makes it really easy to change properties of the build system. I recommend doing an out of source build (make a folder and run cmake from there) so the source folders don't get a bunch of files dumped everywhere.

To build from command line, make a folder to contain the build system and then "cmake /path/to/cryptohaze". Example from the cryptohaze root: "mkdir build-cmake && cd build-cmake && cmake ..". If no errors pop up, make and make install to build the binaries and place them in the CMake builds folders "bin" folder.

If you get an error generating the makefiles via "cmake ..",

  CUDA_SDK_ROOT_DIR not set, point cmake option to
  /path/NVIDIA_GPU_Computing_SDK/C or set NVSDKCUDA_ROOT envvar

then the CUDA SDK wasn't found. export NVSDKCUDA_ROOT=/path/to/NVIDIA_GPU_Computing_SDK/C (note the /C at the end) and re-run "cmake ..." to generate the makefiles. If you're using the CMake GUI, go to the CUDA_SDK_ROOT_DIR and change the value from CUDA_SDK_ROOT_DIR-NOTFOUND to its location on disk.

To build from cmake-gui, set "Where is the source code" to be the root directory of the cryptohaze source and "Where to build the binaries" to wherever you want the build files/objects/binaries to be created. Click Configure. With "Unix Makefiles" selected with Use default native compiliers, click finish. Address the error described above and click Configure again. Some more options will show up you can play with and when done, click Configure one more to enable the Generate button. In a terminal, navigate to the build output folder you selected and then make away.

To build only a subset of the project, go into the build/src/<project> and then make.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox