3.7 Loadable Modules

Mapper modules are external pieces of software designed to handle a particular subset of map queries. They are built as shared libraries and loaded into smapd at startup.

Modules are loaded using the module command:

Config: module module-id module-name [args]

Load module ‘module-name’. Additional arguments (args), if specified, are passed to the module initialization function.

The module-id is a unique identifier, which will subsequently be used to refer to that module.

A module load path is an internal list of directories which smapd scans in order to find a loadable file name specified in module statement. By default the scan order is as follows:

  1. Additional search directories specified by prepend-load-path (see below);
  2. Smap module directory: ‘$prefix/lib/smap’;
  3. Additional search directories specified by append-load-path (see below);
  4. Directories specified in the environment variable LTDL_LIBRARY_PATH.
  5. The system dependent library search path (e.g. on GNU/Linux it is set by the file ‘/etc/ld.so.conf’ and the environment variable LD_LIBRARY_PATH).

Values of LTDL_LIBRARY_PATH and LD_LIBRARY_PATH must be colon-separated lists of absolute directory names, for example: ‘/usr/lib/mypkg:/lib/foo'’.

In any of these directories, smapd first attempts to find and the given module-name verbatim and to load it. If this fails, it tries to append the following suffixes to it:

  1. the libtool archive suffix ‘.la
  2. the suffix used for native dynamic libraries on the host platform, e.g.: ‘.so’, ‘.sl’, etc.

Additional search directories may be configured with prepend-load-path and append-load-path statements:

Config: prepend-load-path path

Prepends the directories listed in its argument to the module load path. The path argument must be a colon-separated list of absolute directory names.

Config: append-load-path path
Config: load-path path

Appends the directories listed in its argument to the module load path. The path argument must be a colon-separated list of absolute directory names.