The DataStax C/C++ Driver for Apache Cassandra and DataStax Products will build on most standard Unix-like and Microsoft Windows platforms. Packages are available for the following platforms:
NOTE: The build procedures only need to be performed for driver development or if your system doesn't have packages available for download and installation.
The C/C++ driver depends on the following software:
* Use the CASS_USE_KERBEROS CMake option to enable/disable Kerberos support. Enabling this option will enable Kerberos authentication protocol within the driver; defaults to Off.
** Use the CASS_USE_OPENSSL CMake option to enable/disable OpenSSL support. Disabling this option will disable SSL/TLS protocol support within the driver; defaults to On.
*** Use the CASS_USE_ZLIB CMake option to enable/disable zlib support. Disabling this option will disable DataStax Astra support within the driver; defaults to On.
Migrating from OpenSSL 1.1.x to 3.x largely involves avoiding the use of many functions which are now deprecated (consult the migration guide for details). The driver does not use any of these functions so we expect the transition to OpenSSL 3.x to be relatively painless. Note that two officially supported platforms (Ubuntu 22.04 and Rocky Linux 9.2) come with OpenSSL 3.x by default and the unit and integration tests all pass on these platforms.
The driver is known to build on Rocky Linux 8/9, Mac OS X 10.10/10.11 (Yosemite and El Capitan), Mac OS 10.12/10.13 (Sierra and High Sierra), and Ubuntu 20.04/22.04 LTS.
NOTE: The driver will also build on most standard Unix-like systems using GCC 4.1.2+ or Clang 3.4+.
yum install automake cmake gcc-c++ git libtool
apt-get update apt-get install build-essential cmake git
Homebrew (or brew) is a free and open-source software package management system that simplifies the installation of software on the Mac OS operating system. Ensure Homebrew is installed before proceeding.
brew update
brew upgrade
brew install autoconf automake cmake libtool
yum install krb5-devel
apt-get install libkrb5-dev
libuv v1.x should be used in order to ensure all features of the C/C++ driver are available. When using a package manager for your operating system make sure you install v1.x.
Packages are available from our Artifactory server. Select the driver version, build and platform and then look for the dependencies directory. Note that the version of libuv available on supported versions of Ubuntu can be used when building the driver. As a result we only provide packages for Rocky Linux only.
brew install libuv
The following procedures should be performed if packages are not available for your system.
pushd /tmp wget http://dist.libuv.org/dist/v1.34.0/libuv-v1.35.0.tar.gz tar xzf libuv-v1.35.0.tar.gz pushd libuv-v1.35.0 sh autogen.sh ./configure make install popd popd
yum install openssl-devel
apt-get install libssl-dev
brew install openssl
Note: For Mac OS X 10.11 (El Capitan) and Mac OS 10.12/10.13 (Sierra and High Sierra) a link needs to be created in order to make OpenSSL available to the building libraries:
brew link --force openssl
pushd /tmp wget --no-check-certificate https://www.openssl.org/source/openssl-1.0.2u.tar.gz tar xzf openssl-1.0.2u.tar.gz pushd openssl-1.0.2u CFLAGS=-fpic ./config shared make install popd popd
yum install zlib-devel
apt-get install zlib1g-dev
brew install zlib
pushd /tmp wget --no-check-certificate https://www.zlib.net/zlib-1.2.11.tar.gz tar xzf zlib-1.2.11.tar.gz pushd zlib-1.2.11 ./configure make install popd popd
mkdir build pushd build cmake .. make make install popd
Examples are not built by default and need to be enabled. Update your CMake line to build examples.
cmake -DCASS_BUILD_EXAMPLES=On ..
Tests (integration and unit) are not built by default and need to be enabled.
cmake -DCASS_BUILD_TESTS=On ..
Note: This will build both the integration and unit tests
cmake -DCASS_BUILD_INTEGRATION_TESTS=On ..
cmake -DCASS_BUILD_UNIT_TESTS=On ..
The driver is known to build with Visual Studio 2013, 2015, 2017, and 2019.
%SYSTEMDRIVE%\GnuWin32)First you will need to open a “Command Prompt” to execute the CMake commands.
Supported generators are:
mkdir build pushd build cmake -G "Visual Studio 16 2019" -A x64 .. cmake --build . popd
Note: To build 32-bit binaries/libraries use -A Win32.
Examples are not built by default and need to be enabled. Update your CMake line to build examples.
cmake -G "Visual Studio 16 2019" -A x64 -DCASS_BUILD_EXAMPLES=On ..
Tests (integration and unit) are not built by default and need to be enabled.
cmake -G "Visual Studio 16 2019" -A x64 -DCASS_BUILD_TESTS=On ..
Note: This will build both the integration and unit tests
cmake -G "Visual Studio 16 2019" -A x64 -DCASS_BUILD_INTEGRATION_TESTS=On ..
cmake -G "Visual Studio 16 2019" -A x64 -DCASS_BUILD_UNIT_TESTS=On ..