C++
XAP’s c++ API supported on Linux and Windows 32bit or 64bit machines. The current supported platforms and compilers are:
- Linux
- gcc.4.1.2
- Windows
- 32/64bit – VS 9.0/10.0 (Visual Studio 2008⁄2010)
Installation
- Download the c++ API file that suits your platform.
- Unzip the file into your
<GigaSpaces Root>
directory (download GigaSpaces here), using your favorite unzip tool (.e.g WinZip). For example - On linux you should run the following to install the C++ libraries:
xap-version
tar -xzvf gigaspaces-cpp- 9.7.0-ga-linux-amd64-gcc-4.1.2.tar.gz
Where the gigaspaces-cpp-9.X.X-ga-linux-amd64-gcc-4.1.2.tar.gz
should be located at the /gigaspaces-xap-premium-9.X.X-ga
folder.
- After unzipping the ZIP file, you should have the following files and folders under your
<GigaSpaces Root>\cpp
folder:
Setting the Environment
There are several environment settings that are necessary to build and run the examples that come with this package. This section lists these settings. Choose the tab below that matches your platform.
Environment Variables
The following environment variables need to be defined:
JSHOMEDIR
– the<GigaSpaces Root>
directory.PLATFORM
– the build platform, in this case win32 or win64.COMPILER
– the compiler used for building, for example: VS9.0.PATH
– This should include the compiler folder , GigaSpaces gsxml2cpp location and the jvm.dll location
For example:
gshome-directory set JSHOMEDIR=C:\ gigaspaces-xap-premium-9.7.0-ga set PLATFORM=win32 set COMPILER=VS9.0
In addition, for windows 32 bit the PATH
variable should be updated to include:
%JSHOMEDIR%\cpp\lib\%PLATFORM%\%COMPILER%;%JSHOMEDIR%\cpp\bin\%PLATFORM%\%COMPILER%;%JAVA_HOME%\jre\bin\client
For windows 64 bit the PATH
variable should be updated to include:
%JSHOMEDIR%\cpp\lib\%PLATFORM%\%COMPILER%;%JSHOMEDIR%\cpp\bin\%PLATFORM%\%COMPILER%;%JAVA_HOME%\jre\bin\server
Environment Script Files
If you don’t want to set these variables globally (by defining System Variables) then the GigaSpaces C++ package includes the following script files that help set the environment:
<GigaSpaces Root>\cpp\env.cmd
– Running this file defines these variables to match your platform.<GigaSpaces Root>\cpp\GigaVisualStudio.bat
– Running this file starts Visual Studio and automatically sets the environment.
You might need to edit these files to include the correct values for the
PATH
, JAVA_HOME
and JSHOMEDIR
environment variables and the correct location of Visual Studio and the jvm.dll.Environment Variables
The following environment variables need to be defined:
JSHOMEDIR
– the<GigaSpaces Root>
directory.PLATFORM
– the build platform, in this case linux-amd64 or linux32.COMPILER
– the compiler used for building, for example: gcc-4.1.2.
Example:
JSHOMEDIR=../../..
PLATFORM=linux-amd64
COMPILER=gcc-4.1.2
Environment Script Files
If you don’t want to set these variables globally the GigaSpaces C++ package includes the following script file that help set the environment:
<GigaSpaces Root>/cpp/setenv.sh
– Running this file defines these variables to match your platform.
Testing the Installation
The package provides the following scripts (placed in <GigaSpaces Root>\cpp
):
- sanity – Run sanity tests on embedded, remote and partitioned space
- runBenchmark – Run benchmark tests on embedded space
- runTest – Run all functional tests on embedded space
- testJiniTransactions – Run benchmark and functional tests on partitioned space using Jini Mahalo transactions
Result files can be found in <GigaSpaces Root>\cpp
:
benchmarkResult*.txt
– Benchmark tests results
testResult*.xml
– Functional tests results