Installation

Installation zhang Mon, 02/17/2020 - 17:42

Although there are pre-built images for MonetDB, it is also possible to download and build it from source code.

In this section we are going to give a guide for binary installers, source code build, Windows and Mac OS setup.

Install from Source

Install from Source giulia Tue, 02/25/2020 - 16:36

As of Oct2020 releases compilation of MonetDB is done using CMake. The build of a program or library with CMake is a two stage process. First, standard build files are created (generated) from configuration files (CMakeLists.txt) which are written in CMake language. Then the platform's native build tools (native toolchain) are used for actual building of programs.

Note: Before release Oct2020 building the MonetDB software was based on the bootstrap-configure-make pattern.

MonetDB can be compiled in any location on your file system and it does not require special (root) permissions.

For latest build instructions please read: dev.monetdb.org/hg/MonetDB/file/tip/documentation/source/build.rst. This document also contains at the bottom specific information for compilation on Windows and macOS.

While the core task of compiling MonetDB itself is very simple (on UNIX based platforms), inexperienced users often run into problems caused by many effects of the build environment. The catch is the differences between the target platforms, because not all libraries needed may have been installed by your system administrator. Typical missing components on a binary distribution such as Fedora or Debian or Ubuntu are the xxx-dev packages necessary for MonetDB to compile against the package itself.

For Fedora specific packages read: dev.monetdb.org/hg/MonetDB/file/tip/documentation/source/build-fedora.rst.

For Debian specific packages read: dev.monetdb.org/hg/MonetDB/file/tip/documentation/source/build-debian.rst.

In a nutshell, building the MonetDB sources involves commands:


% mkdir build
% cd build
% cmake -DCMAKE_INSTALL_PREFIX=/path/to/install/monetdb /path/to/monetdb/source
% cmake --build .
% cmake --build . --target install

 

MonetDB is a rather large C-based program, and it sometimes closely interacts with the host system it runs on to achieve the best end results for the user. This makes the code not always as generic as we ultimately would like it to be. Because we understand that these parts of the code are likely suspects for malfunctioning, we try to test our sources on a nightly basis on as many different platforms that we can access. This mainly focuses on different architectures, kernels and libcs, but we also test a couple of Linux distributions, see Nightly testing.

 

OS X Install

OS X Install dnedev Tue, 02/25/2020 - 16:39

See instructions at: https://www.monetdb.org/downloads/MacOSX/.

In case you want to build from source code, read latest build instructions: dev.monetdb.org/hg/MonetDB/file/tip/documentation/source/build.rst. This document also contains specific information on compilation on macOS at the end.

The information below the next horizontal line is old and deprecated as of release Oct2020. It is kept available for building older releases.


Install Xcode

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

If you want the most recent version of Xcode you can only obtain it from the Apple Developer Website (if you are a registered Apple developer) or directly from the Apple Mac App Store here.

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 toolset, 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: Homebrew or MacPorts. 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.

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 openssl

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 the Oracle website. Note: You need the 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

Other

* sphinxclient
Install libsphinxclient

brew install libsphinxclient

* GSL
Install gsl

brew install gsl

* FITS
Install cfitsio

brew install cfitsio

Before building

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

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

Using MacPorts

As an alternative to Homebrew, you can also use MacPorts to obtain the required packages. To install MacPorts please follow the up-to-date instructions for your OS X version. You can find these on their website here. 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 the Oracle website. Note: You need the 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 [https://ant.apache.org/bindownload.cgi]. 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

* GEOM
Install geos

sudo port install geos

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

* GSL
Install gsl

sudo port install gsl

* FITS
Install cfitsio

sudo port install cfitsio

Before building

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

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

Obtaining sources and bootstrapping

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

Cloning MonetDB Mercurial repository

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

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. The same holds for the OpenSSL libs and includes:

export M4DIRS=/usr/local/opt/gettext/share/aclocal
export LDFLAGS=-L/usr/local/opt/openssl/lib
export CPPFLAGS=-I/usr/local/opt/openssl/include

Configuring build

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>

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

Note: If you don't have root/admin permission for your system you will not be able to deploy the RubyGem. If you don't need the RubyGem simply disable with with the option --without-rubygem

Building

To build the configured modules, simply run from the <tt>BUILD</tt> 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 set during the configure process.

make install

Note: If you have built the RubyGem, on OS X you will need to use sudo make install to deploy it.

Windows Install

Windows Install giulia Tue, 02/25/2020 - 16:37

First download the required installer file from: https://www.monetdb.org/downloads/Windows/. You probably want to to choose the Latest subdirectory.
There are MonetDB5-SQL-Installer-*.msi installers for 64-bit (x86_64) and 32-bit (i386). Use 32-bit version only on 32-bit Windows OS. Use 64-bit if your OS is 64-bit.

Note: There is no separate installer if you only require the client progams (mclient, msqldump) without the server. The complete (server and clients) installation only requires some 20 MB of disk space, much less than other RDBMS software.

The MonetDB ODBC driver is available as a separate independent installer program, for 64-bit (x86_64) and 32-bit (i386). On 64-bit OS you may need to install both ODBC drivers (64-bit and 32-bit) when you want to run a 32-bit application that uses ODBC to connect to MonetDB.

If this is your first time you install MonetDB/SQL just start the downloaded installer program and answer the questions in the dialogs. It is also possible to choose a custom install where you can select which components (such as the optional geometry/GIS module, optional header and lib files, optional debug files, optional Python 3 integration) to install and specify a different installation directory.

If you already had a version of MonetDB installed the installer program will do an upgrade of the MonetDB software, replacing the previous installed version. So before you run the downloaded installer program, make a backup of your database(s) in case you need to go back to the previous version. Also copy edited M5server.bat and mclient.bat files as they will be overridden by the installer program. Next check via Task Manager that no more mserver5.exe process is running. Now you can start the installer program.

Important: the installer program and MonetDB server software only supports upgrades, not downgrades. So it is important to make backups of your original databases before upgrading the MonetDB software and starting the new server software on existing database(s). If you haven't made a backup it is not possible to go back to the previous database version.

Note: the database itself will be upgraded to the new server version the first time the upgraded server is started for that database. At start up the MonetDB server checks if the database exists (if not it is created and initialised) and whether it is of an older version than the server software. If so the server software will first upgrade the database to match the server software. This database upgrade process may take some time especially if you upgrade from a very old version. During this database upgrade process no connections to the server are possible as the database is not available yet. If the upgrade fails for some reason the server cannot start and exits. Check the MonetDB server console window for logged errors. If the database upgrade is completed successfully the server becomes available for clients to connect to.

Note: the installer program also contains functionality to Change, Repair and Remove the installed MonetDB software. So keep the installer program file for later use.

Starting the MonetDB server after installation

On Windows the first step is to start a MonetDB server by simply opening: 'Start -> Programs -> MonetDB -> Start server'. Alternatively you can use Explorer and go to the install directory and double click on M5server.bat.
The first time the you start the MonetDB server it will create a new database named demo. This may take a few seconds, watch the Windows console output window. Wait till it shows:
# MonetDB/SQL module loaded
# MonetDB server is started. To stop server press Ctrl-C.

Subsequently you can start the textual interface (mclient) by opening: 'Start -> Programs -> MonetDB -> SQL client'. Alternatively you can use Explorer and go to the install directory and double click on mclient.bat.
The commands entered in mclient are identical to those found on other platforms.

To stop the server, you can simply close the MonetDB/SQL server console window.

Note: the server by default only accepts connections originating from the local host. If you need other machines to access your database, change the configuration file by setting mapi_open=yes.

Changing database location

If you need (or want) to change the location of the database then editing of the monetdb script is required. Copy the mclient.bat and M5server.bat files in 'C:\Program Files\MonetDB\MonetDB5' and edit the copied files. In the M5server_copy.bat file you would need to change the setting of the MONETDBFARM variable, and in mclient_copy.bat you would need to add a -d option to the call of mclient.exe.
Note: on upgrade of MonetDB software the files mclient.bat and M5server.bat will be overwritten, so copy them and edit the copies.