Skip to content

Latest commit

 

History

History
155 lines (115 loc) · 5.21 KB

File metadata and controls

155 lines (115 loc) · 5.21 KB

Ignite Quick Start Guide for C++

This chapter explains system requirements for running Ignite and how to install Ignite, start a cluster, and run a simple Hello World example in C++.

Prerequisites

Ignite C++ was officially tested on:

Installing Ignite

Starting an Ignite Node

Note
Ignite for C++ supports a thick client and a thin client. Because this guide focuses on the thin client, you can run the examples below, connecting to the Java-based nodes you just started.

Once the cluster is started, you can use the Ignite C++ thin client to perform cache operations (things like getting or putting data, or using SQL).

Getting Started with Ignite and C++

Ignite ships with a robust C++ client. To get started with Ignite and C++, you will need to be familiar with building C++ applications.

  1. If you haven’t already, download/install Apache Ignite.

  2. Install CMake 3.6+ and add it to the %Path%.

  3. Install OpenSSL.

  4. Set %JAVA_HOME% environment variable.

  5. Navigate to the %IGNITE_HOME%\platforms\cpp\ folder.

  6. Create build directory %IGNITE_HOME%\platforms\cpp\cmake-build-release.

  7. Build and install Ignite C++.

tab:Win32[]

cd cmake-build-release
cmake .. -DWITH_THIN_CLIENT=ON -DCMAKE_GENERATOR_PLATFORM=Win32 -DOPENSSL_ROOT_DIR=<openssl install dir> -DCMAKE_INSTALL_PREFIX=<ignite cpp install dir>
cmake --build . --target install  --config Release

tab:Win64[]

cd cmake-build-release
cmake .. -DWITH_THIN_CLIENT=ON -DCMAKE_GENERATOR_PLATFORM=x64 -DOPENSSL_ROOT_DIR=<openssl install dir> -DCMAKE_INSTALL_PREFIX=<ignite cpp install dir>
cmake --build . --target install  --config Release

CMake by default generates on Windows Visual Studio projects. You can find generated projects in CMake build directory and open Ignite.C++.sln in Visual Studio.

From here, you can create your own code, or run one of the existing examples located in the {IGNITE_HOME}/platforms/cpp/examples/ directory.

There is much more information about how to build, test, and use Apache Ignite for C++ in the README.txt and DEVNOTES.txt files located in the {IGNITE_HOME}/platforms/cpp folder.

For information about the C++ thin client, see C++ Thin Client.

C++ for Unix

On unix systems, you can use the command line to build and run the examples included in the Ignite distribution.

Building C++ Ignite

  • Download and unzip the Ignite binary release. We’ll refer to a resulting directory as to ${IGNITE_HOME}.

  • Create a build directory for CMake. We’ll refer to this as ${CPP_BUILD_DIR}

  • Build and install Ignite.C++ by executing the following commands:

tab:Ubuntu[]

cd ${CPP_BUILD_DIR}
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_THIN_CLIENT=ON ${IGNITE_HOME}/platforms/cpp
make
sudo make install

tab:CentOS/RHEL[]

cd ${CPP_BUILD_DIR}
cmake3 -DCMAKE_BUILD_TYPE=Release -DWITH_THIN_CLIENT=ON ${IGNITE_HOME}/platforms/cpp
make
sudo make install

Building and running the Thick Client Example

  • Create a build directory for cmake. We’ll refer to it as ${CPP_EXAMPLES_BUILD_DIR}

  • Build the examples by executing the following commands:

tab:Ubuntu[]

cd ${CPP_EXAMPLES_BUILD_DIR}
cmake -DCMAKE_BUILD_TYPE=Release ${IGNITE_HOME}/platforms/cpp/examples && make
cd ./put-get-example
./ignite-put-get-example

tab:CentOS/RHEL[]

cd ${CPP_EXAMPLES_BUILD_DIR}
cmake3 -DCMAKE_BUILD_TYPE=Release ${IGNITE_HOME}/platforms/cpp/examples && make
cd ./put-get-example
./ignite-put-get-example

Next Steps

From here, you may want to: