blob: 94e519e3a876c275710ffa2c2770e486bd4b0ae1 [file] [log] [blame]
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
= Ignite 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:
include::includes/cpp-prerequisites.adoc[]
== Installing Ignite
include::includes/install-ignite.adoc[]
== Starting an Ignite Node
include::includes/starting-node.adoc[]
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 {cpp} client.
To get started with Ignite and {cpp}, you will need to be familiar with building {cpp} applications.
. Install `openssl` and add it to your path.
. If you haven't already, download/install <<Installing Ignite,Apache Ignite>>.
. Navigate to the `{IGNITE_HOME}/platforms/cpp/project/vs` folder.
. Launch the appropriate Visual Studio solution file for your system (`ignite.sln` is for 64-bit).
. Build the solution.
From here, you can create your own code, or run one of the existing examples located in the `{IGNITE_HOME}/platforms/cpp/examples/project/vs` directory.
There is much more information about how to build, test, and use GGCE for {cpp} in the `readme.txt` and `DEVNOTES.txt` files located in the `{IGNITE_HOME}/platforms/cpp` folder.
For information about the {cpp} thin client, see link:thin-clients/cpp-thin-client[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.
=== Prerequisites
include::includes/cpp-linux-build-prerequisites.adoc[]
=== 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:
[tabs]
--
tab:Ubuntu[]
[source,bash,subs="attributes,specialchars"]
----
cd ${CPP_BUILD_DIR}
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_ODBC=ON -DWITH_THIN_CLIENT=ON ${IGNITE_HOME}/platforms/cpp
make
sudo make install
----
tab:CentOS/RHEL[]
[source,shell,subs="attributes,specialchars"]
----
cd ${CPP_BUILD_DIR}
cmake3 -DCMAKE_BUILD_TYPE=Release -DWITH_ODBC=ON -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:
[tabs]
--
tab:Ubuntu[]
[source,bash,subs="attributes,specialchars"]
----
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[]
[source,shell,subs="attributes,specialchars"]
----
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:
* Check out the link:thin-clients/cpp-thin-client[C++ thin client] that provides a lightweight form of connectivity
to Ignite clusters
* Explore the link:{githubUrl}/modules/platforms/cpp/examples[additional C++ examples] included with Ignite
* Refer to the link:cpp-specific[C{plus}{plus} specific section] of the documentation to learn more about capabilities
that are available for C++ applications