Installing the C++ SDK

Before developing or using user-defined routines in C++, you must set up a build environment. First, ensure that cmake and gcc-8 are installed on your system.

Since version 7.3.2 you will find the C++ SDK installed as part of a full install of s-Server at $SQLSTREAM_HOME/examples/c++sdk/.

For best results you should compile your C++ UDFs, UDXs and UDAs on Centos. SQLstream s-Server is built on Centos and ensuring that Centos is used for user-defined C++ modules ensures that all required libraries will be present, and will use the exact same entry points.

Even though your modules are compiled on Centos, they can be deployed and executed on Ubuntu.

On Centos 7.x

yum install scl-utils
yum install devtoolset-8-gcc devtoolset-8-gcc-c++
scl enable devtoolset-8 -- bash
source /opt/rh/devtoolset-8/enable

Install cmake:

yum install cmake

Check gcc version:

which gcc

Permanently enable devtoolset-8 by adding this line to .bash_profile:

echo "source /opt/rh/devtoolset-8/enable" >> ~/.bash_profile

On Ubuntu 20.04

sudo apt-get install cmake gcc-8 g++-8
export CC=/usr/bin/gcc-8
export CXX=/usr/bin/g++-8

Using the C++ SDK with Docker images

NOTE If you are using a SQLstream docker image or VM appliance, this C++ environment is not currently pre-installed. You will need to derive a new image from one of the standard sqlstream/xxx images, and copy the SDK to it.