From World of VOC - Wiki

Jump to: navigation, search

Contents

Building the SessionVOC Open (Step-By-Step)

The following sections describe how to compile and build the SessionVOC Open from scratch. The SessionVOC Open will compile on most Linux systems. It assumes that you use the GNU C++ compiler to compile the source. The SessionVOC has been tested with the GNU C++ compiler, but should compile with any Posix compliant compiler. Please let us know, whether you successfully compiled it with another C++ compiler.

The SessionVOC Open consists of a server, an session compiler, and an extension for the PHP language. This extension is only necessary if you want to access the SessionVOC from within your PHP code in an easy and simple way. You can always access the server using the HTTP interface.

Basic System Requirements

Verify that your system contains

  • the GNU C++ compiler "g++" and standard C++ libraries
  • the GNU autotools (autoconf, automake)
  • the GNU make

The repository contains generated "configure" and "Makefile.in" files. If you do not intent to make changes to the "configure.ac" or "Makefile.am" source files, you do not have to install the GNU autotools. But keep in mind that the generated "Makefile" contains dependencies between the "Makefile.in" and "Makefile.am" and others, so you might have to touch the generated files in order to avoid that the Makefile tries to generate them again.

Compile the SessionVOC

Download the Source

Download the latest source using GIT:

 git clone git://github.com/triAGENS/SessionVoc-OPEN.git

Prerequisites

Install or download the prerequisites

Most linux systems already supply RPM or DEP for there packages. Please note that you have to install the development packages.

Setup

Switch into the SessionVOC directory

 cd SessionVoc-OPEN

The source tarball contains a pre-generated "configure" script. You can regenerate this script by using the GNU auto tools. In order to do so, execute

 make setup

This will call aclocal, autoheader, automake, and autoconf in the correct order.

Configure

In order to configure the build environment execute

 ./configure

to setup the makefiles. This will check for the various system characteristics and installed libraries. If the configure scripts fail to find the boost library, check that C++ is installed and working and that the boost-devel package was successfully installed.

Compile

Compile the program by executing

 make

This will compile the SessionVOC and create a binary in

 ./SessionVoc/sessionvoc

It also creates a demo session description in

 ./DefaultDescription/sessionvoc.so

Test

Check the binary by starting it using the command line.

 ./SessionVoc/sessionvoc --session.description DefaultDescription/sessionvoc.so --server.session-port 12345

This will start up the SessionVOC and listen for HTTP requests on port 12345 bound to any address. Use your favorite browser to access the URL

 http://localhost:12345/version

This should produce a JSON object like

 {"version":"1.7.3 OPEN (8096)", "edition":"open"}

as result.

Install

Install everything by executing

 make install

You must be root to do this or at least have write permission to the corresponding directories.

Centos, RedHat

For Centos you need to install the following packages:

 yum install boost-devel
 yum install mysql-devel

The libev is not available via YUM. You can either use an rpm search like http://rpm.pbone.net/ to find the corresponding files or download the source from http://software.schmorp.de/pkg/libev.html

Debian

For Debian you need to install the following packages:

 aptitude install libboost-dev
 aptitude install libmysqlclient15-dev
 aptitude install libev-dev

openSUSE

For openSUSE you need to install the following packages:

 zypper install boost-devel
 zypper install libmysqlclient-devel
 zypper install libev-devel

If your openSUSE 11.3 installation does not contain libev-devel use

   http://software.opensuse.org/search?q=libev4&baseproject=openSUSE%3A11.3&exclude_filter=home%3A&exclude_debug=true 
   http://software.opensuse.org/search?q=libev-devel&baseproject=openSUSE%3A11.3&exclude_filter=home%3A&exclude_debug=true

Ubuntu

For Ubuntu you need to install the following packages:

 aptitude install libboost-all-dev
 aptitude install libmysqlclient-dev
 aptitude install libev-dev

Mac OS X (The Hard Way)

The following describes how to compile the SessionVOC using the source tar.

Prerequisites

You need the following components:

  • Xcode from Apple
  • boost from www.macports.org
  • libev from www.macports.org

To install the boost and libev use

 sudo port install boost
 sudo port install mysql5-devel 
 sudo port install libev

Configure

Under MacOS X the files from MacPorts are copied to a non-standard location "/opt/local". Therefore you have to specify this location using

 ./configure CPPFLAGS="-isystem /opt/local/include" LDFLAGS="-L/opt/local/lib"

to setup the makefiles. This will check for the various system characteristics and installed libraries. If the configure scripts fail to find the boost library, check that C++ is installed and working and that the boost-devel package was successfully installed.