LATEST VERSION: 9.0.6 - CHANGELOG
Pivotal GemFire® Native Client v9.0

Developing C++ Programs on Solaris

This section describes how to build and run a native client application on Solaris.

Step 1. Set Environment Variables

Note: When compiling external projects or applications that are used or referenced by the native client, make sure that you compile them for the same target architecture as your native client installation. For example, if you installed the 32-bit (x86) version of the native client, compile your external projects for 32-bit (x86) architecture.

Set the native client environment variables on each Solaris host. For each case, product-dir is the path to the native client product directory.

For Bourne and Korn shells (sh, ksh, bash)

GFCPP=product-dir; export GFCPP
PATH=$GFCPP/bin:$PATH;export PATH
LD_LIBRARY_PATH=$GFCPP/lib:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH

Version 5.9 of the SUNpro compiler is supported on Solaris. The linker switches vary according to whether you are statically linking to the native client library.

To build and link a C++ client on Solaris, the compilation command line must include the appropriate arguments from this table.

Argument Explanation
-D_REENTRANT Required to compile Solaris programs in a thread-safe way.
-xarch=v8plus Enables 32-bit compilation.
-xarch=v9 Enables 64-bit compilation.
-ldl; -lpthread; -lc; -lm; -lsocket; -lrt; -lnsl; -ldemangle; -lkstat; -lz Additional libraries.
-library=stlport4 Solaris library compilation.
-I$ GFCPP /include Specifies the GemFire include directory.

Step 3. Make Sure the Native Client Library Can Be Loaded

When a C++ application is not statically linked to the native client library, the library must be dynamically loadable.

To verify that the native client library is available for loading, make sure you have added the path product-dir/lib to the LD_LIBRARY_PATH environment variable, where product-dir is the path to the Geode product directory.