Difference between revisions of "MonetDB:Building from sources on OS X"

From MonetDB
Jump to navigationJump to search
(Fix tables. Adding Homebrew instructions)
Line 4: Line 4:
  
 
* Minimal required set - the bare minimum of modules that will deliver MonetDB Kernel, Backend, SQL interface and support packages.
 
* Minimal required set - the bare minimum of modules that will deliver MonetDB Kernel, Backend, SQL interface and support packages.
{|
+
{| class="wikitable"
! Module ! Function |-
+
! Module
| gdk | MonetDB Kernel |-
+
! Function
| monetdb5 | Backend with MAL queries support |-
+
|-
| sql | Interface with SQL:2003 support |-
+
| gdk
| control | MonetDB control daemon (formerly known asMerovingian)
+
| MonetDB Kernel
 +
|-
 +
| monetdb5
 +
| Backend with MAL queries support
 +
|-
 +
| sql
 +
| Interface with SQL:2003 support
 +
|-
 +
| control
 +
| MonetDB control daemon (formerly known asMerovingian)
 
|}
 
|}
* Default build-set modules - other extension in the enable by default the provide useful functionality.
+
 
{|
+
* Default build-set modules - other extension, which if enabled provide useful functionality.
! Module ! Function |-
+
{| class="wikitable"
| jaql | Interface with Jaql support - query language JSON |-
+
! Module
| geom | Support for GeoSpatial quires - based on OpenGIS Simple Features |-
+
! Function  
| gsl | Interface to the GNU Scientific Library |-
+
|-
| fits | Support for NASA's FITS (Flexible Image Transport System) |-
+
| jaql
| odbc | ODBC driver |-
+
| Interface with Jaql support - query language JSON
| jdbc | JDBC driver
+
|-
 +
| 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
 
* Other
{|
+
{| class="wikitable"
! Module ! Function |-
+
! Module
| rdf | Interface with SPARQL and RDF support |-
+
! Function
| datacell | Data streaming extension
+
|-
 +
| rdf
 +
| Interface with SPARQL and RDF support
 +
|-
 +
| datacell
 +
| 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.
 
 
{|
 
! Extension ! Function ! Dependencies |-
 
| atomic_ops | Provides support for fast atomic operations on most architectures. Not required for  |-
 
| bz2 | bz2 input compression support |-
 
| cfitsio | support for FITS (Flexible Image Transport System) |-
 
| curl | multi transfer protocol support |-
 
| geos | GeoSpatial support |-
 
| getaddrinfo | support for network host identification |-
 
| gsl | Provides support for interfacing with the GNU Scientific Library |-
 
| hwcounters | Provides support for identification of number of available hardware counters |-
 
| java | Java support |-
 
| java_control | Merovingian support |-
 
| java_jdbc | JDBC support
 
|}
 
  
 
== Install Xcode ==
 
== Install Xcode ==
Line 57: Line 66:
 
Once Xcode is installed, run the following command in Terminal in order to install the Xcode command-line tools:
 
Once Xcode is installed, run the following command in Terminal in order to install the Xcode command-line tools:
 
  xcode-select --install
 
  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.
 
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.
Line 65: Line 73:
  
 
There are two community supported package managers that one can use to install the dependencies for building MonetDB on OS X: MacPorts [https://www.macports.org] or Homebrew [http://brew.sh]. At this point you would need to pick which package manager to use and install only '''one''' of them.
 
There are two community supported package managers that one can use to install the dependencies for building MonetDB on OS X: MacPorts [https://www.macports.org] or Homebrew [http://brew.sh]. At this point you would need to pick which package manager to use and install only '''one''' of them.
 +
 +
=== Using Homebrew ===
 +
 +
To install Homebrew please follow the up-to-date instructions for your OS X version. You can find these on their website found here [http://brew.sh].
 +
 +
==== Minimal modules build-set ====
 +
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 ====
 +
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 [http://www.oracle.com/technetwork/java/javase/downloads/index.html]. Note: this is JDK, not the JRE.
 +
After JDK in installed, set the <tt>JAVA_HOME</tt> variable and add the JDK bin directory to your shell's <tt>PATH</tt>. 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 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 <tt>/Users/<username>/tools/apache-ant</tt> and <tt>/Users/<username>/tools/apache-maven</tt>. After that set the <tt>M2_HOME</tt> and <tt>ANT_HOME</tt> variables and update the <tt>PATH</tt> like this:
 +
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
 +
 +
* ODBC
 +
Install unixODBC
 +
brew install unixodbc
 +
 +
* JAQL
 +
Install bison
 +
brew bison
 +
Add the line below when configuring the build to point the tool to the library (see Configuring below).
 +
LDFLAGS=-L/usr/local/opt/bison/lib
 +
CFLAGS=-I/ust/local/opt/bison/include
 +
 +
* GEOM
 +
Install geos
 +
brew install geos
 +
 +
* GSL
 +
Install gsl
 +
brew install gsl
 +
 +
* FITS
 +
Install cfitsio
 +
brew install cfitsio
 +
 +
==== Other ====
 +
 +
* sphinxclient
 +
Install libsphinxclient
 +
brew install libsphinxclient
 +
 +
==== Putting it all together ====
 +
brew install pkg-config pcre unixodbc geos gsl cfitsio bison
 +
 +
==== Special cases ====
 +
In some cases you might need to install automake autoconf libtool and libiconv from MacPorts as well.
 +
brew install autoconf automake libtool libiconv
  
 
=== Using MacPorts ===
 
=== 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 here [https://www.macports.org/install.php]. Do not forget to restart your command prompt shell (since MacPorts will add new extensions to your <tt>PATH</tt> and run:
+
To install MacPorts please follow the up-to-date instructions for your OS X version. You can find these on their website found here [https://www.macports.org/install.php]. Do not forget to restart your command prompt shell (since MacPorts will add new extensions to your <tt>PATH</tt>) and run:
 
  sudo port -v selfupdate
 
  sudo port -v selfupdate
 
  
 
==== Minimal modules build-set ====
 
==== 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).
 
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
 
  sudo port install pkgconfig openssl pcre libxml2
 
  
 
==== Default modules build-set ====
 
==== Default modules build-set ====
Line 116: Line 180:
 
==== Other ====
 
==== Other ====
  
* Curl
+
* curl
 
Install curl (curl-ca-bundle, libind)
 
Install curl (curl-ca-bundle, libind)
 
  sudo port install curl
 
  sudo port install curl
Line 134: Line 198:
 
  --with-sphinxclient=/opt/local
 
  --with-sphinxclient=/opt/local
  
===== Putting it all together =====
+
==== Putting it all together ====
 
  sudo port install pkgconfig openssl pcre libxml2 unixodbc bison geos gsl cfitsio curl libmicrohttpd uriparser libsphinxclient
 
  sudo port install pkgconfig openssl pcre libxml2 unixodbc bison geos gsl cfitsio curl libmicrohttpd uriparser libsphinxclient
 
  
 
==== Special cases ====
 
==== Special cases ====
Line 142: Line 205:
 
  sudo port install automake autoconf
 
  sudo port install automake autoconf
  
== Configuring ==
+
== Configuring for building with Homebrew ==
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.
+
Before starting the configure tool, go in the directory where the MonetDB sources are, and create a subdirectory <tt>BUILD</tt>. Go in the <tt>BUILD</tt> directory and run the following command, where <tt>prefix</tt> is the location where you would like MonetDB installed.
 +
../configure --prefix=<full-path>
 +
 
 +
== Configuring for building with MacPorts ==
 +
Before starting the configure tool, go in the directory where the MonetDB sources are, and create a subdirectory <tt>BUILD</tt>. Go in the <tt>BUILD</tt> directory and run the following command, where <tt>prefix</tt> is the location where you would like MonetDB installed.
 
  ../configure --prefix=<full-path> --with-libiconv-prefix=/opt/local
 
  ../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.:
 
* 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
 
  ../configure --prefix=<full-path> --with-libiconv-prefix=/opt/local --with-sphinxclient=/opt/local --with-unixodbc =/opt/local --with-readline=/opt/local
 
  
 
== Building ==
 
== Building ==
 
To build the configured modules, simply run from the <tt>BUILD</tt> directory, using the <tt>-j<number></tt> argument for a parallel build. E.g.
 
To build the configured modules, simply run from the <tt>BUILD</tt> directory, using the <tt>-j<number></tt> argument for a parallel build. E.g.
 
  make -j4
 
  make -j4
 
  
 
Once the build process finishes, run <tt>make install</tt> MonetDB in the prefix location configured during the configure process.
 
Once the build process finishes, run <tt>make install</tt> MonetDB in the prefix location configured during the configure process.
 
  make install
 
  make install

Revision as of 14:34, 11 March 2014

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.
Module Function
gdk MonetDB Kernel
monetdb5 Backend with MAL queries support
sql Interface with SQL:2003 support
control MonetDB control daemon (formerly known asMerovingian)
  • 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

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

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

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

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

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 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:

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
  • ODBC

Install unixODBC

brew install unixodbc
  • JAQL

Install bison

brew bison

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

LDFLAGS=-L/usr/local/opt/bison/lib
CFLAGS=-I/ust/local/opt/bison/include
  • GEOM

Install geos

brew install geos
  • GSL

Install gsl

brew install gsl
  • FITS

Install cfitsio

brew install cfitsio

Other

  • sphinxclient

Install libsphinxclient

brew install libsphinxclient

Putting it all together

brew install pkg-config pcre unixodbc geos gsl cfitsio bison

Special cases

In some cases you might need to install automake autoconf libtool and libiconv from MacPorts as well.

brew install autoconf automake libtool libiconv

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

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

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 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:

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
  • 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

  • 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

Putting it all together

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

Special cases

In some cases you might need to install automake (gdbm, perl5.16, perl5) and autoconf from MacPorts as well.

sudo port install automake autoconf

Configuring for building with Homebrew

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>

Configuring for building with MacPorts

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

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, run make install MonetDB in the prefix location configured during the configure process.

make install