aerospike
is a C client library (API) for interfacing with the Aerospike Database.
The C client library requires gcc
and g++
4.1 or newer.
Development packages of the following libraries must be installed.
libc
openssl
lua 5.1
For Debian-based distributions (Debian, Ubuntu, etc.):
$ sudo apt-get install libc6-dev libssl-dev liblua5.1-dev autoconf automake libtool g++
For Redhat Enterprise 6 or newer, or related distributions (CentOS, etc.):
$ sudo yum install openssl-devel glibc-devel autoconf automake libtool lua-devel
For Fedora 20 or newer:
$ sudo yum install openssl-devel glibc-devel autoconf automake libtool compat-lua-devel-5.1.5
If you wish to install Lua from source, make sure you install Lua 5.1. By default, Lua will be installed in /usr/local with the correct names, so no extra steps are necessary - only validate that liblua.so and liblua.a are in the default library search path of your build environment.
For MacOS X:
$ # Compile and install the latest Lua 5.1
$ mkdir -p external && cd external
$ curl -R -O http://www.lua.org/ftp/lua-5.1.5.tar.gz
$ tar zxf lua-5.1.5.tar.gz && cd lua-5.1.5
$ make macosx test
$ sudo make install
$ cd ../
$ # Compile and install the latest OpenSSL
$ curl -R -O https://www.openssl.org/source/openssl-1.0.1h.tar.gz
$ tar zxvf openssl-1.0.1h.tar.gz && cd openssl-1.0.1h
$ ./Configure darwin64-x86_64-cc
$ make
$ sudo make install
Before building, please ensure you have the prerequisites installed.
This project uses git submodules, so you will need to initialize and update the submodules before building thie project. To initialize and update submodules, run:
$ git submodule update --init
To build:
$ make
This will generate the following files:
target/{target}/include
– header filestarget/{target}/lib/libaerospike.a
– static archivetarget/{target}/lib/libaerospike.so
– dynamic shared library (for Linux) ortarget/{target}/lib/libaerospike.dylib
– dynamic shared library (for MacOS)
Static linking with the .a
prevents you from having to install the libraries on your target platform. Dynamic linking with the .so
avoids a client rebuild if you upgrade the client. Choose the option that is right for you.
For MacOS builds of tools such as AQL you will want to also call the following, which places the dynamic shared library in /usr/local/lib/
$ sudo make install
To clean:
$ make clean
This will remove all generated files.
To run unit tests:
$ make test
The module is structured as follows:
benchmarks
- measure read/write performance.demo
- demo applications, making use of multiple features.examples
- simple example applications, focused on specific features.src
– developer maintained code for the projectsrc/include
– public header filessrc/main
– source code for the librarysrc/test
- unit teststarget
– generated filestarget/{target}
– platform specific targetstarget/{target}/include
– public headers (API) for end userstarget/{target}/lib
– libraries for end userstarget/{target}/obj
– generated objects filestarget/{target}/deps
– generated dependency files