Obtaining and Installing

Obtaining the Client

Before using the client, you will need to download and install it on your development computer. The client is packaged into a single file, amps-c++-client-<version>.tar.gz, where <version> is replaced by the version of the client, such as amps-c++-client-5.3.0.zip. In the following examples, the version number is omitted from the filename.

Once expanded, the amps-c++-client directory will be created, containing sources, samples and makefiles for the C++ client. You’re welcome to locate this directory anywhere that seems convenient; but for the remainder of this book, we’ll simply refer to this directory as the amps-c++-client directory.

Explore the client

The client is organized into a number of directories that you’ll be using through this book. Understanding this organization now will save you time in the future. The top level directories are:

src

Sources and makefile for the AMPS C++ client library.

include

Location of include files for C and C++ programs. When building your own program, you’ll add the include directory to your include path.

samples

Getting started with a new C/C++ library can be challenging. For your reference, we provide a number of small samples, along with a makefile.

Build the Client

After unpacking the amps-c++-client directory, you must build the client library for your platform.

To build on Linux, change to the amps-c++-client directory and, from a command prompt, type:

cmake

to make a static library, or

SHARED=1 cmake

to make a shared object.

Test Connectivity to AMPS

Before writing programs in AMPS, make sure connectivity to your AMPS development instance is working from your AMPS development environment.

Launch a terminal window and change the directory to the AMPS directory in your AMPS installation and use spark to test connectivity to your server.

For example:

./bin/spark ping -type fix -server localhost:9004

If spark returns an error, verify that your AMPS server is running and that there is no firewall blocking access (including local firewalls between a host instance and virtual machine or container).

Without connectivity to AMPS, you will be unable to make best use of this guide.

Last updated