MASH logo
Login | Register

Heuristics development: Setup

From MASH Wiki

Jump to: navigation, search

Here you will find information about the installation of the SDK and the compilation of the heuristics.


Contents


Requirements

The MASH SDK uses CMake to allows the compilation of the heuristics on any platform. You'll need to install at least the version 2.6.

You'll also need a C++ compiler. The following are supported:

  • On Linux: gcc 4
  • On MacOS X: XCode 3.1+ and gcc 4 (install the Developer tools from the Apple developers site, free registration required)
  • On Windows: Visual Studio 2005, Visual Studio 2008, Visual Studio 2010 and Visual C++ 2010 Express (which is free)

Others might also work, but are up to you (patch welcome!).


Download

Download the MASH SDK from the downloads page and decompress it.

Using a shell/terminal
~$ tar -xvzf mash_sdk_1.0.0.tar.gz
~$ ln -s mash_sdk_1.0.0 mash_sdk
~$ cd mash_sdk


Compilation

The first step is to generate the files needed to compile the SDK on your platform/compiler (Makefiles, XCode project or Visual Studio solution) using CMake. Then use them as usual to compile the SDK. On each platform, CMake comes as both a command-line tool and a GUI-based one. The usage of the command-line tool is shown below. See the CMake: Quick Start Guide or the CMake: Getting Started pages for more details.

It is recommended to generate the makefiles/IDE projects in a separate directory. In the description below that directory is ~/mash_sdk/build/. The compiled executables and libraries will be located in a bin subfolder of this directory.

Using a shell/terminal
~/mash_sdk$ mkdir build
~/mash_sdk$ cd build
~/mash_sdk/build$ cmake ..
...
~/mash_sdk/build$ make

Test of your compilation

~/mash_sdk/build$ cd bin
~/mash_sdk/build/bin$ ./testheuristic examples/identity car.ppm results.txt

You should obtain:

Image:
  File:          car.ppm
  Size:          128x128
  Format:        'RGB' 
Parameters:
  Coordinates:   (63, 63)
  ROI extent:    63
Heuristic:
  Name:          examples/identity
  Dimension:     16129


Test terminated correctly.


The mash_sdk/data folder contains some test images. When looking for an image (in the above example: car.ppm), the testheuristic program will first look in that folder to find it. That's why you don't have to provide the full path to the images in that folder. You can still test your heuristic on any image found on your computer by providing its full path to the testheuristic program.

Personal