next up previous contents
Next: References Up: The Shore Storage Manager Previous: Miscellaneous Facilities

 

Writing and Compiling a VAS and Client

This section discusses some of the general issues in compiling and linking with the SSM libraries. Still, the best way to learn about writing and compiling a VAS and client is to read the tutorial, Writing Value-Added Servers with the Shore Storage Manager.

 

Include Files and Libraries

All of the include files needed to build servers and clients are located in SHROOT/include. Any server code using the SSM should include sm_vas.h. Since clients do not need all of the SSM functionality, they need only include sm_app.h. The RPC package include files are located in SHROOT/include/rpc and are usually included with this line:

	#include <rpc/rpc.h>

All of the libraries needed to build servers and clients are located in SHROOT/lib. Clients only need libshorecommon.a. Servers need both libsm.a and libshorecommon.a The RPC package library is librpclib.a.

There are two pre-compiled version of these libraries. The are included in the debugging and no-debugging binary releases. The debugging version not only includes symbol table information ( -g option to gcc), but also has considerable additional auditing and assert checking code. This includes code that audits data pages whenever an update is made, performs monitoring to detect thread stack overflow, and checks over 1,400 additional assertions. See the Shore Release document for more information on these releases.

Note: when compiling for linkage with the debugging release, the compiler flag -DDEBUG should be used.

 

Template Instantiation

The SSM uses a number of templates One of the issues that is often confusing is controlling template instantiation. All of the template instantiations needed by the SSM are already included in the libraries.

However, due to a bug in gcc 2.6.* (supposedly to be fixed in 2.7.0), it is possible to have problems during linking due to multiple definitions of template code. To avoid this, and to have smaller executables, we use the gcc option -fno-implicit-templates in the Makefile from the tutorial example. This causes gcc not to emit any template code unless the template is explicitly instantiated.

Here is an example of explicit instantiation from the tutorial

    #ifdef __GNUG__
    // Explicitly instantiate lists of client_t.
    template class w_list_t<client_t>;
    #endif

 

Other Example Code

The SSM has been used to build a number of value-added servers. Some of these are publicly available. You may find these helpful in writing your own.



next up previous contents
Next: References Up: The Shore Storage Manager Previous: Miscellaneous Facilities



Marvin Solomon
Fri Aug 2 13:40:00 CDT 1996