Vertica Analytics Platform Version 9.2.x Documentation

Setting Up a Development Environment

Before you start developing your UDx, you need to configure your development environment. You can choose to develop your UDx on a node in a development Vertica database (not in a production environment) or on another machine.

To test, you need access to a (non-production) Vertica database. You can install a single-node Vertica database on your development machine for easier development.

You should develop your UDx code on the same Linux platform that you use on your Vertica database cluster. This will ensure that your UDx library is compatible with the Vertica version deployed on your cluster.

The following sections describe language-specific requirements.

C++ Requirements

At a minimum, you need to install the following on your development machine:

  • g++ and its associated tool chain such as ld. (Note: some Linux distributions package g++ separately from gcc.)
  • A copy of the Vertica SDK. See Setting Up the C++ SDK for details.

The Vertica binaries are compiled using the default version of g++ installed on the supported Linux platforms. Vertica requires a minimum of gcc version 4.8.4. The default versions of g++ on Amazon Linux 2.0 and Ubuntu 16.04 are not compatible; see Requirements for Amazon Linux 2.0 and Ubuntu 16.04.

While not required, the following additional software packages can ease development:

  • make, or some other build-management tool.
  • gdb, or some other debugger.
  • Valgrind, or similar tools that detect memory leaks.
  • Although not currently required, future versions of Vertica may require that you compile with the flag -std=c++11.

If you want to use any third-party libraries (for example, statistical analysis libraries), you need to install them on your development machine. If you do not statically link these libraries into your UDx library, you also have to install them on every node in the cluster. See Compiling Your C++ Library for details.

Requirements for Amazon Linux 2.0 and Ubuntu 16.04

Amazon Linux 2.0 and Ubuntu 16.04 ship with compilers that are incompatible with the Vertica C++ SDK. To compile UDxs on these platform, you must install packages for 4.8 compatibility.

  1. Remove the existing gcc and gcc-c++ packages using your package manager.
  2. On Amazon Linux 2.0, install compat-gcc-48 and compat-gcc-48-c++. On Ubuntu 16.04, install gcc-4.8 and g++-4.8.
  3. Define symbolic links in /usr/bin for gcc and g++, pointing to the newly-installed packages.
  4. On Amazon Linux 2.0, define symbolic links in /usr/lib64 as shown in this example. (Exact library names depend on what was installed in Step 2.)

    $ cd /usr/lib64 
    $ sudo ln -s ./libstdc++.so.6.0.24 libstdc++.so 
    $ sudo ln -s ./libgcc_s-7-20170915.so.1 libgcc_s.so 

The following example demonstrates these steps for Ubuntu 16.04.

$ sudo apt-get remove g++ 
$ sudo apt-get remove gcc 

$ sudo apt-get install gcc-4.8 
$ sudo apt-get install g++-4.8 

$ cd /usr/bin 
$ sudo ln -s ./gcc-4.8 gcc 
$ sudo ln -s ./g++-4.8 g++ 

To test your environment, install the packages used by the SDK examples (if you haven't already) and then compile the examples:

$ sudo apt-get install libbz2-dev 
$ sudo apt-get install libghc-zlib-dev 
$ sudo apt-get install libboost-dev 
$ sudo apt-get install libghc-curl-dev 

$ cd /opt/vertica/sdk/examples 
$ sudo make

Java Requirements

At a minimum, you need to install the following on your development machine:

While not required, make or some other build-management tool can ease development.

Python Requirements

Vertica does not require any additional files or packages. You can develop your Python UDx on any system with a text editor.

When you begin UDx development, make sure that your code runs using Python 3.5.1. because you cannot change the version used by the Vertica Python interpreter.

When Vertica calls your UDx, it starts a side process that manages the interaction between the server and the Python interpreter.

R Requirements

Vertica does not require any additional files or packages. You can develop your R UDx on any system with a text editor.