MonetDB:Building from sources on OS X

From MonetDB
Jump to: navigation, search

Modules[edit]

MonetDB ships with a number of components or modules. For the purpose of this guide we've separated them in three groups

  • Minimal required set - the bare minimum of modules that will deliver MonetDB Kernel, Backend, SQL interface and support packages.
Module Function
gdk MonetDB Kernel
monetdb5 Backend with MAL queries support
sql Interface with SQL:2003 support
control MonetDB control daemon (formerly known as Merovingian)
  • Default build-set modules - other extension, which if enabled provide useful functionality.
Module Function
jaql Interface with Jaql support - query language JSON
geom Support for GeoSpatial quires - based on OpenGIS Simple Features
gsl Interface to the GNU Scientific Library
fits Support for NASA's FITS (Flexible Image Transport System)
odbc ODBC driver
jdbc JDBC driver
  • Other
Module Function
rdf Interface with SPARQL and RDF support
datacell Data streaming extension

Install Xcode[edit]

To be able to build (almost) any software package on OS X, one needs to have Apple Xcode installed. Xcode comes with a C/C++ compiler toolchain, which as of the more recent versions based on Clang/LLVM and not GCC.

Most recent version of Xcode you can only obtain from the Apple Developer Website [1] (if you are a registered Apple developer) or directly from the Apple Mac App Store [2].

Once Xcode is installed, run the following command in Terminal in order to install the Xcode command-line tools:

xcode-select --install

Beware, OS X usually ships with a BSD tools, unlike most Linux distribution that make use of the GNU toolset. This affects not only the compiler, but also tools such as make, pkgconfig aws, sed used in the build scripts of MonetDB.

Installing required packages[edit]

There are two community supported package managers that one can use to install the dependencies for building MonetDB on OS X: MacPorts [3] or Homebrew [4]. At this point you would need to pick which package manager to use and install only one of them.

Using Homebrew[edit]

To install Homebrew please follow the up-to-date instructions for your OS X version. You can find these on their website found here [5].

Minimal modules build-set[edit]

After Homebrew is installed, you should install the required packages for building MonetDB absolute minimal set of modules. Run the command below to install the required packages (and their dependencies in the brackets): pkg-config; pcre

brew install pkg-config pcre

Default modules build-set[edit]

Keep reading/installing if you want to build the other MonetDB modules included in the default build-set.

  • JDBC & control

Install JDK 7, which you can get from Oracle's website [6]. Note: this is JDK, not the JRE. After JDK in installed, set the JAVA_HOME variable and add the JDK bin directory to your shell's PATH. To do this, add the lines below to your .profile, .bashrc or .bash_profile (or the corresponding config file for your shell).

export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=${JAVA_HOME}/bin:$PATH

Install Apache Ant

brew install ant
  • ODBC

Install unixODBC

brew install unixodbc
  • GEOM

Install geos

brew install geos
  • GSL

Install gsl

brew install gsl
  • FITS

Install cfitsio

brew install cfitsio

Other[edit]

  • sphinxclient

Install libsphinxclient

brew install libsphinxclient

Before building[edit]

You most likely need to install automake, autoconf, libtool, gettext and readline from Homebrew as well. These will also be required to run the bootstrap script (see below).

brew install autoconf automake libtool gettext readline

Putting it all together[edit]

brew install autoconf automake libtool gettext readline pkg-config pcre unixodbc geos gsl cfitsio

Using MacPorts[edit]

To install MacPorts please follow the up-to-date instructions for your OS X version. You can find these on their website found here [7]. Do not forget to restart your command prompt shell (since MacPorts will add new extensions to your PATH) and run:

sudo port -v selfupdate

Minimal modules build-set[edit]

After MacPorts is installed, you should install the required packages for building MonetDB absolute minimal set of modules. Run the command below to install the required packages (and their dependencies in the brackets): pkgconfig (libiconv); openssl (zlib); pcre (bzip2, ncurses, libedit); libxml2 (expat, gettext, xz).

sudo port install pkgconfig openssl pcre libxml2

Default modules build-set[edit]

Keep reading/installing if you want to build the other MonetDB modules included in the default build-set.

  • JDBC & control

Install JDK 7, which you can get from Oracle's website [8]. Note: this is JDK, not the JRE. After JDK in installed, set the JAVA_HOME variable and add the JDK bin directory to your shell's PATH. To do this, add the lines below to your .profile, .bashrc or .bash_profile (or the corresponding config file for your shell).

export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=${JAVA_HOME}/bin:$PATH


Install Apache Ant, which can be downloaded its website [9]. Unpack the package in a directory in your home space, e.g. in /Users/<username>/tools/apache-ant. After that set the ANT_HOME variables and update the PATH like this:

export ANT_HOME=/Users/<username>/tools/apache-ant
export PATH=${ANT_HOME}/bin:$PATH
  • ODBC

Install unixODBC (libtool, readline)

sudo port install unixodbc

Add the line below when configuring the build to point the tool to the library (see Configuring below).

--with-unixodbc =/opt/local --with-readline=/opt/local
  • JAQL

Install bison (m4)

sudo port install bison
  • GEOM

Install geos

sudo port install geos
  • GSL

Install gsl

sudo port install gsl
  • FITS

Install cfitsio

sudo port install cfitsio

Other[edit]

  • curl

Install curl (curl-ca-bundle, libind)

sudo port install curl
  • libmicrohttpd

Install libmicrohttpd (gmp, libtasn1, nettle, libffi, glib2, popt, desktop-file-utils, libxslt, p11-kit, gnutls, libgpg-error, libgcrypt)

sudo port install libmicrohttpd
  • liburiparser

Install uriparser

sudo port install uriparser
  • sphinxclient

Install libsphinxclient

sudo port install libsphinxclient

Add the line below when configuring the build to point the tool to the library (see Configuring below).

--with-sphinxclient=/opt/local

Before building[edit]

You will probably need to install automake (gdbm, perl5.16, perl5) and autoconf from MacPorts as well. These will also be required to run the bootstrap script (see below).

sudo port install automake autoconf

Putting it all together[edit]

sudo port install automake autoconf pkgconfig openssl pcre libxml2 unixodbc bison geos gsl cfitsio curl libmicrohttpd uriparser libsphinxclient

Obtaining sources and bootstrapping[edit]

Sources of the latest released and testing versions on MonetDB can be obtained from the repository: released [10] and testing[11]. Download the selected file and unpack it in a directory.

Cloning Mercurial[edit]

Optionally, bleeding egde sources can be directly obtained from the MonetDB Mercurial repository. To do that make sure you have Mercurial installed on your system first - latest version available here [12]. The clone the MonetDB repository. Note this can take some time and a lot of data will be transferred.

hg clone http://dev.monetdb.org/hg/MonetDB/

Bootstrapping[edit]

Sources check-out from Mercurial need to be bootstrapped first, before configure can be run. To do that, go in the directory you in check you cloned the repository and run:

./bootstrap
  • If you are using Homebrew, you will also need to set M4DIRS to the directory where the Homebrew gettext M4 macros are in:
export M4DIRS=/usr/local/opt/gettext/share/aclocal


Configuring build[edit]

With Homebrew[edit]

Before starting the configure tool, go in the directory where the MonetDB sources are, and create a subdirectory BUILD. Go in the BUILD directory and run the following command, where prefix is the location where you would like MonetDB installed.

../configure --prefix=<full-path>

With MacPorts[edit]

Before starting the configure tool, go in the directory where the MonetDB sources are, and create a subdirectory BUILD. Go in the BUILD directory and run the following command, where prefix is the location where you would like MonetDB installed.

../configure --prefix=<full-path> --with-libiconv-prefix=/opt/local
  • If you want to build the ODBC driver or enable sphinxclient support, do not forget to add the appropriate arguments, e.g.:
../configure --prefix=<full-path> --with-libiconv-prefix=/opt/local --with-sphinxclient=/opt/local --with-unixodbc =/opt/local --with-readline=/opt/local

Building[edit]

To build the configured modules, simply run from the BUILD directory, using the -j<number> argument for a parallel build. E.g.

make -j4

Once the build process finishes, install MonetDB in the prefix location configured during the configure process.

make install