sb-config

StreamBase Compiler Environment Utility — a tool to determine and set StreamBase-related compiler and linker flags

SYNOPSIS

sb-config [--no-logging-backend] [OPTION]

DESCRIPTION

sb-config is a convenience utility used to set compiler and linker environment variables to settings compatible with the compiler and linker that built the library files for the current StreamBase installation.

On UNIX, the options --env, --cflags, --libs, --plugin-cflags, and --plugins-ldflags emit shell lines or fragments that might contain double quotes such that any spaces in the emitted line do not break up a variable definition or a command line option. This behavior interacts as expected with the shell eval command and with back quote operators.

On Windows and UNIX, the --java, --javac, and --classpath options do not put quotes around emitted paths that contain spaces, because the output of these options is likely to be combined with other members of a PATH or CLASSPATH variable. If your StreamBase installation path contains spaces, you might need to make sure your script or Makefile uses double quotes around the expansion of the sb-config output that you capture in a variable.

OPTIONS

--cflags  (UNIX only)

Returns the C++ compiler flags required for building StreamBase C++ client applications. Use this option in Makefiles, in statements such as SB_CLIENT_CFLAGS=`sb-config --cflags`.

--classpath  (UNIX and Windows)

Returns the path to the StreamBase client library JAR file that must be added to the class path when building and running StreamBase Java client applications.

--cxx  (UNIX only)

Returns the path to the default C++ compiler detected on your system. Use this option in Makefiles in statements such as CXX=`sb-config --cxx`.

--env  (UNIX and Windows)

Returns, but does not execute, the commands to set environment variables for running StreamBase utilities (Windows) or for running and building StreamBase client applications (UNIX). Use the output of sb-config --env with eval or a similar command to execute the commands returned. For Windows and UNIX, returns a setting for STREAMBASE_HOME and prepends the StreamBase bin directory to the PATH. For UNIX, also returns settings for LD_LIBRARY_PATH and MANPATH.

--help, -h  (UNIX and Windows)

Displays a usage message, then exits. Entering sb-config with no arguments also shows usage.

--java  (UNIX and Windows)

Returns the path to the Java JRE used by the current StreamBase installation.

--javac  (UNIX and Windows)

Returns the path to the Java compiler used by the current StreamBase installation.

--libs  (UNIX only)

Returns the C++ linker flags appropriate for building StreamBase C++ client applications.

--no-logging-backend  (UNIX and Windows)

Modifies the --classpath option, and must precede it. With this option, --classpath returns the path to an alternate version of the StreamBase client library JAR file, with StreamBase logging features disabled. Use this option if you have another logging system you want to use, such as log4j, already in your CLASSPATH.

--plugin-cflags  (UNIX only)

Returns the C++ compiler flags appropriate for building StreamBase C++ plug-ins. On most systems, this returns the same value as --cflags.

--plugin-ldflags  (UNIX only)

Returns the C++ linker flags appropriate for building StreamBase C++ plug-ins.

--pypath  (UNIX only)

Returns the path to the appropriate version of the StreamBase Python Client library to use to match the default version of Python detected on your system. Use this option when setting the PYTHONPATH environment variable. For example: export PYTHONPATH=`sb-config --pypath`:$PYTHONPATH.

--setenv  (Windows only)

Modifies the Windows registry to add PATH and STREAMBASE_HOME settings appropriate for the current version of StreamBase to the environment for the currently logged-in Windows user. Do not use if you have a mix of StreamBase 3.x and StreamBase 5.x or 6.x installations, and use with caution if you have multiple StreamBase 5.x or 6.x installations, as described in the StreamBase Command Prompt topic of the Test/Debug Guide.

--setsysenv  (Windows only)

Same as --setenv, but modifies the environment for all Windows users.

--version  (UNIX and Windows)

Returns version information and exits.

EXAMPLES

The following examples are for use at the UNIX shell prompt, or at the Bash prompt of a UNIX-like environment under Window such as Cygwin.

The next line sets the CXX environment variable to the path to the compiler used to build the StreamBase libraries and binaries in the current release of StreamBase.

CXX=`sb-config --cxx`

The following line uses the specified compiler ($CXX) to compile MyApplication.cpp, using the same compiler flags used to build the StreamBase libraries (sb-config --cflags). (The -c and -o are options to the compiler, not to sb-config.)

$CXX MyApplication.cpp `sb-config --cflags` -c -o MyApplication.o

The next line links the object file generated by the above line.

$CXX MyApplication.o `sb-config --libs` -o MyApplication

The next lines show examples for building StreamBase C++ plug-ins instead of client applications.

$CXX MyPlugin.cpp `sb-config --plugin-cflags` -c -o MyPlugin.o

$CXX `sb-config --plugin-ldflags` MyPlugin.o -o MyPlugin.so

The next lines show how to compile and run a StreamBase Java client application.

javac -classpath `sb-config --classpath` MyApplication.java

java -classpath `sb-config --classpath`:. MyApplication

The next line shows how to compile a StreamBase Java client application using your preferred Java logging libraries, which are assumed to be already in the CLASSPATH environment variable.

javac -classpath $CLASSPATH:`sb-config --no-logging-backend --classpath`:. MyApplication.java