sb-config
StreamBase Compiler Environment Utility — a tool to set StreamBase working environment and to set client API development flags
DESCRIPTION
sb-config is a convenience utility primarily used with its --env
option to set the shell environment for using StreamBase and Live Datamart. See "Configuring Shells for StreamBase Use" in
the StreamBase Installation Guide for related information.
The tool is also used to return development values that can be used in environment variables or build-related scripts to configure the command-line environment for use with one of the StreamBase or Live Datamart Client APIs. In particular, use sb-config to:
-- Return compiler and linker environment variables configured for compatibility with the C++ Client API for the current StreamBase installation. |
-- Return the full paths to the Java commands that this StreamBase and Live Datamart installation is currently configured to use with the Java Client API. |
-- Return the path to the JAR files that implement the StreamBase and Live Datamart Java Client APIs. |
-- Return the full path to the StreamBase Python Client API library, for use in PYTHONPATH variables or other Python related script. |
The options --env
, --cflags
, --libs
, --plugin-cflags
, and --plugins-ldflags
might emit shell lines or fragments that contain double quotes such that any spaces in the emitted line do not break up a
variable definition or a command line option. On Linux and macOS, this behavior interacts as expected with the shell eval
command and with back quote operators.
This command's other 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, CLASSPATH, or other PATH-like variable. If your StreamBase installation path contains spaces, you might need to make sure your build script or Makefile uses double quotes around the expansion of the sb-config output that you capture in a variable.
OPTIONS
--cflags
(Linux and macOS only)-
Returns the C++ compiler flags required for building StreamBase C++ client applications. Use this option in build scripts or in Makefile statements such as
SB_CLIENT_CFLAGS=`sb-config --cflags`
. --classpath
(Linux, macOS, and Windows)-
Returns the path to the StreamBase client library JAR file that must be added to the classpath when building and running StreamBase Java client applications. See the
--live-data-client-classpath
option below for LiveView client development. --cxx
(Linux and macOS 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
(Linux, macOS, and Windows)-
Returns, but does not execute, the commands to set environment variables for running StreamBase utilities at the command prompt. With macOS and Linux shells, use the output of sb-config
--env
with eval or a similar command to execute the commands returned. For all platforms, returns a setting forSTREAMBASE_HOME
and prepends the StreamBasebin
directories to thePATH
. For macOS and Linux, also returns a setting forMANPATH
. For Linux only, also returns a settings forLD_LIBRARY_PATH
. See "Configuring Shells for StreamBase Use" in the StreamBase Installation Guide for related information. --help, -h
(Linux, macOS, and Windows)-
Displays a usage message, then exits. Using the sb-config command with no arguments also shows usage.
--java
(Linux, macOS, and Windows)-
Returns the path to the java command used by the current StreamBase and Live Datamart installation. By default, this option returns the java command from the embedded JDK bundled with the StreamBase installation; however, if the current environment specifies
STREAMBASE_USE_INTERNAL_JDK=false
, this option returns$JAVA_HOME/bin/java
. --javac
(Linux, macOS, and Windows)-
Returns the path to the javac Java compiler used by the current StreamBase and Live Datamart installation. By default, this option returns the javac command from the StreamBase embedded JDK, but honors the setting of the STREAMBASE_USE_INTERNAL_JDK variable, as above.
--jar
(Linux, macOS, and Windows)-
Returns the path to the jar Java archiver used by the current StreamBase and Live Datamart installation. By default, this option returns the jar command from the StreamBase embedded JDK, but honors the setting of the STREAMBASE_USE_INTERNAL_JDK variable, as above.
--libs
(Linux and macOS only)-
Returns the C++ linker flags appropriate for building StreamBase and Live Datamart C++ client applications.
--live-data-client-classpath
(Linux, macOS, and Windows)-
Returns the path to the LiveView client API JAR files plus the StreamBase client library JAR file that must be added to the class path when building and running Live Datamart Java client applications. See the
--classpath
option above for StreamBase-only development. --no-logging-backend
(Linux, macOS, 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
(Linux only)-
Returns the C++ compiler flags appropriate for building StreamBase C++ plug-ins. On many systems, this returns the same value as
--cflags
. --plugin-ldflags
(Linux only)-
Returns the C++ linker flags appropriate for building StreamBase C++ plug-ins.
--pypath
(Linux and Windows 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
.On Linux, the versions of Python supported can be determined from the names of the
python*
directories underSTREAMBASE_HOME/lib64
, such aspython2.7.
On Windows, this option requires the presence of a Windows Python 2.7 installation from ActiveState or Python.org, with the python.exe command available in the PATH.
--setenv
(Windows only)-
TIBCO recommends using a StreamBase Command Prompt instead of this option for all interaction with StreamBase command-line tools.
This option modifies the Windows registry to add
PATH
andSTREAMBASE_HOME
settings appropriate for the current version of StreamBase to the environment for the currently logged-in Windows user. Do not use this option if you have more than one StreamBase version installed, which each has its own StreamBase Command Prompt appropriate to each version. --setsysenv
(Windows only)-
Same as
--setenv
, but modifies the environment for all Windows users. --version
-
Returns version information and exits.
EXAMPLES
The following examples are for use at a macOS or Linux shell prompt, or at the Bash prompt of a UNIX-like environment under Windows 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 MyClientApp.cpp
, using the same compiler flags used to build the StreamBase libraries (sb-config --cflags). (The -c
and -o
are options for the compiler, not for 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 specified as part of the CLASSPATH environment variable.
javac -classpath $CLASSPATH:`sb-config --no-logging-backend --classpath`:. MyApplication.java