MonetDB:Building from sources

From MonetDB
Jump to: navigation, search

Building the latest release from source tarball[edit]

The following instructions regard MonetDB's latest release version, Jul2015-SP4 (11.21.19). If you need to build an older version, try searching the history of this page for its instructions (which are likely to be very similar).

Initial install[edit]

Before starting set a number of environment variables for convenience (assuming BASH syntax):

export MonetDB_rel=Jul2015-SP4
export MonetDB_ver=11.21.19
export MonetDB_base_dir=$HOME/MonetDB-$MonetDB_rel
export MonetDB_source_dir=$MonetDB_base_dir/MonetDB-$MonetDB_ver
export MonetDB_build_dir=$MonetDB_base_dir/BUILD
export MonetDB_prefix_dir=$MonetDB_base_dir

a. Create a directory where you want to place MonetDB on your machine, and `cd` into that directory, e.g.:

mkdir $MonetDB_base_dir
cd $MonetDB_base_dir

b. Download the source tarball for the Jul2015-SP4 release, either directly from our download page or directly from http://dev.monetdb.org/downloads/sources/Jul2015-SP4/MonetDB-11.21.19.tar.xz Jul2015-SP4 release], e.g.:

wget http://dev.monetdb.org/downloads/sources/$MonetDB_rel/MonetDB-$MonetDB_ver.tar.xz

c. Unpack the tarball in the above created directory, e.g.:

tar xf MonetDB-$MonetDB_ver.tar.xz

d. Create a build-directory and `cd` into it, e.g.:

mkdir $MonetDB_build_dir
cd $MonetDB_build_dir

e. `configure` the code base for your system. You would at least want to specify a 'prefix' where to install MonetDB, e.g.:

$MonetDB_source_dir/configure --prefix=$MonetDB_prefix_dir
  • For more `configure` options, see:
$MonetDB_source_dir/configure --help

f. Once `configure` has finished successfully, you can compile MonetDB; still in the above created BUILD directory, call:

make -j[<number_of_CPU_cores_of_your_system>]

g. Once the compilation has finished successfully, you can install MonetDB; still in the BUILD directory, call:

make -j[<number_of_CPU_cores_of_your_system>] install

h. Finally, to use MonetDB conveniently, set the following PATHs:


export       PATH=$MonetDB_prefix_dir/bin:$PATH
export    MANPATH=$MonetDB_prefix_dir/share/man:$MANPATH
export  CLASSPATH=$MonetDB_prefix_dir/share/monetdb/lib:$CLASSPATH
MonetDB_python_lib=$MonetDB_prefix_dir/`python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,1,"")'`
export PYTHONPATH=$MonetDB_python_lib/site-packages:$python_lib/dist-packages:$PYTHONPATH

i. At last, you can check whether you can call the server successfully:

mserver5 --version

Updating to a newer version[edit]

In case you need / want to get and use an updated version of the Jul2015-SP4 release of MonetDB - a new tarball, potentially including bug fixes, might be available at least once a day. First, download the latest source tarball and unpack it. Then, re-compile and install MonetDB by repeating steps f. & g. in directory BUILD as above (if necessary, `make` will automatically call `configure` with the same arguments you used initially).

Building the Jul2015-SP4 release from Mercurial (HG) sources[edit]

Before starting, make sure that you have read and understood the Introduction to Mercurial (HG), and followed all instructions and recommendations given there.

Prerequisites[edit]

Mercurial

A source code revision management tool. You only need mercurial if you are building directly from our version control system. If you start with the source distribution (source tarball) as suggested above - you don't need Mercurial.

You need to have a working Mercurial executable (named hg) and clone the main repository using the URL: http://dev.monetdb.org/hg

Python

MonetDB uses the scripting language Python during configuration of the software. Versions 2.6 and newer are what we use and test with, but theoretically any version in the 2.x release line should work, as far back as 2.0.0.

GNU autotools - autoconf/automake/libtool

MonetDB uses GNU autoconf (>= 2.60) and automake (>= 1.10) during the bootstrap phase, and "libtool" (>= 1.5) during the make phase. autoconf and automake are not needed when you start with the source distribution (tarball).

iconv

A macrofile "iconv.m4" is expected in "/usr/share/aclocal/". On Ubuntu, you can search with `apt-file` what provides these files,

   $ apt-file search iconv.m4
   gettext: /usr/share/aclocal/iconv.m4
   gnulib: /usr/share/gnulib/m4/iconv.m4

The .m4 that usually works is in "gettext". Simply run,

   $ sudo apt-get install gettext


standard software development tools

To compile MonetDB, you also need to have the following standard software development tools installed and ready for use on you system:

  • a C compiler (e.g. the GNU project's gcc or the LLVM-based clang);
  • GNU's make" program, also known as gmake. Note that native platform-specific non-GNU "make" variants (e.g. on IRIX and Solaris) often don't work.
  • A a parser generator (e.g., "bison"; yacc" may do).

The following are not needed when you start with the source distribution:

  • You do not need a C++ compiler (e.g. GNU's g++);
  • You do not need a a lexical analyzer generator (e.g., lex or flex);

The following are optional. They are checked for during configuration and if they are missing, the feature is just missing:

  • perl
  • php

libxml2

The XML parsing library "libxml2" is used by the XML module of monetdb5.

MonetDB5 cannot be compiled without libxml2. Current Linux distributions all come with libxml2.

PCRE

The Perl Compatible Regular Expressions library "pcre" is used by monetdb5 and sql. Most prominently, complex SQL LIKE expressions are evaluated with help of the PCRE library.

OpenSSL

The OpenSSL (Secure Sockets Layer) toolkit development files are necessary in the default configuration of MonetDB (it's used for securing network connections by encryption).

Initial install[edit]

Before starting set a number of environment variables for convenience (assuming BASH syntax):

export MonetDB_rel=Jul2015-SP4
export MonetDB_ver=11.21.19
export MonetDB_base_dir=$HOME/MonetDB-$MonetDB_rel
export MonetDB_source_dir=$MonetDB_base_dir/MonetDB
export MonetDB_build_dir=$MonetDB_base_dir/BUILD
export MonetDB_prefix_dir=$MonetDB_base_dir

a. Create a directory where you want to place MonetDB on your machine, and `cd` into that directory, e.g.:

mkdir $MonetDB_base_dir
cd $MonetDB_base_dir

b. Get a clone of the MonetDB Mercurial (HG) repository and check out the Jul2015 branch:

hg clone -u $MonetDB_rel http://dev.monetdb.org/hg/MonetDB/

c. `bootstrap` the source base

( cd MonetDB && ./bootstrap )

d. Proceed as of step d) above.

Updating to a newer version[edit]

Go (`cd`) to directory $MonetDB_base_dir, and execute:

 ( cd MonetDB && hg pull -u )

to update your clone & check out of the MonetDB repository.

Then re-bootstrap the source base as in step c. above, i.e.,

( cd MonetDB && ./bootstrap )

Finally, re-compile & install MonetDB by repeating steps f. & g. in directory $MonetDB_build_dir as above (if necessary, `make` will automatically call `configure` with the same argument you used initially).