MonetDB:Building from sources on OS X

From MonetDB
Revision as of 14:10, 11 March 2014 by Dnedev (talk | contribs) (Initial entry)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Modules =

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.
- MonetDB Kernel |- Backend with MAL queries support |- Interface with SQL:2003 support |- MonetDB control daemon (formerly known asMerovingian)
  • Default build-set modules - other extension in the enable by default the provide useful functionality.
- Interface with Jaql support - query language JSON |- Support for GeoSpatial quires - based on OpenGIS Simple Features |- Interface to the GNU Scientific Library |- Support for NASA's FITS (Flexible Image Transport System) |- ODBC driver |- JDBC driver
  • Other
- Interface with SPARQL and RDF support |- Data streaming extension


Extensions and other libraries

A number of extensions can be enabled at build time, if MonetDB is compiled with certain extensions on, provided the the required libraries are present. Most of these are also required for some of the modules listed above.

- Provides support for fast atomic operations on most architectures. Not required for |- bz2 input compression support |- support for FITS (Flexible Image Transport System) |- multi transfer protocol support |- GeoSpatial support |- support for network host identification |- Provides support for interfacing with the GNU Scientific Library |- Provides support for identification of number of available hardware counters |- Java support |- Merovingian support |- JDBC support

Install Xcode

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: <source lang="bash"> xcode-select --install </source>

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

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 MacPorts

To install MacPorts please follow the up-to-date instructions for your OS X version. You can find these on their website found [5]. Do not forget to restart your command prompt shell and run <source lang="shell"> sudo port -v selfupdate </source>

Minimal modules build-set

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). <source lang="bash"> sudo port install pkgconfig openssl pcre libxml2 </source>

Default modules build-set

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).

<source lang="bash"> export JAVA_HOME=$(/usr/libexec/java_home) export PATH=${JAVA_HOME}/bin:$PATH </source>

Install Apache Ant and Maven, both of which can be downloaded from their respective websites. Unpack the packages in a directory in your home space, e.g. in /Users/<username>/tools/apache-ant and /Users/<username>/tools/apache-maven. After that set the M2_HOME and ANT_HOME variables and update the PATH like this: <source lang="bash"> export ANT_HOME=/Users/<username>/tools/apache-ant export M2_HOME=/Users/<username>/tools/apache-maven export PATH=${ANT_HOME}/bin:${M2_HOME}/bin:$PATH </source>

  • ODBC

Install unixODBC (libtool, readline) <source lang="bash"> sudo port install unixodbc </source> Add the line below when configuring the build to point the tool to the library (see Configuring below). <source lang="bash"> --with-unixodbc =/opt/local --with-readline=/opt/local </source>

  • JAQL

Install bison (m4) <source lang="bash"> sudo port install bison </source>

  • GEOM

Install geos <source lang="bash"> sudo port install geos </source>

  • GSL

Install gsl <source lang="bash"> sudo port install gsl </source>

  • FITS

Install cfitsio <source lang="bash"> sudo port install cfitsio </source>

Other

  • Curl

Install curl (curl-ca-bundle, libind) <source lang="bash"> sudo port install curl </source>

  • libmicrohttpd

Install libmicrohttpd (gmp, libtasn1, nettle, libffi, glib2, popt, desktop-file-utils, libxslt, p11-kit, gnutls, libgpg-error, libgcrypt) <source lang="bash"> sudo port install libmicrohttpd </source>

  • liburiparser

Install uriparser <source lang="bash"> sudo port install uriparser </source>

  • sphinxclient

Install libsphinxclient <source lang="bash"> sudo port install libsphinxclient </source> Add the line below when configuring the build to point the tool to the library (see Configuring below). <source lang="bash"> --with-sphinxclient=/opt/local </source>

  • Putting it all together

<source lang="bash"> sudo port install pkgconfig openssl pcre libxml2 unixodbc bison geos gsl cfitsio curl libmicrohttpd uriparser libsphinxclient </source>


Special cases

In some cases you might need to install automake (gdbm, perl5.16, perl5) and autoconf from MacPorts as well. <source lang="bash"> sudo port install automake autoconf </source>

Configuring

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. <source lang="bash"> ../configure --prefix=<full-path> --with-libiconv-prefix=/opt/local </source>

  • If you want to build the ODBC driver or enable sphinxclient support, do not forget to add the appropriate arguments, e.g.:

<source lang="bash"> ../configure --prefix=<full-path> --with-libiconv-prefix=/opt/local --with-sphinxclient=/opt/local --with-unixodbc =/opt/local --with-readline=/opt/local </source>


Building

To build the configured modules, simply run from the BUILD directory, using the -j<number> argument for a parallel build. E.g. <source lang="bash"> make -j4 </source>

Once the build process finishes, run make install MonetDB in the prefix location configured during the configure process. <source lang="bash"> make install </source>