StreamBase Compiler Environment Utility — a tool to set StreamBase working environment and to set client API development flags
sb-config is a convenience utility primarily used with its
--env option to set the shell environment for using StreamBase and LiveView. See "StreamBase-Configued Shells" in the StreamBase
Installation Guide for information on using this option in shell startup files.
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 LiveView Client APIs. In particular, use sb-config to:
|-- Return the full paths to the Java commands that this StreamBase and LiveView installation is currently configured to use with the Java Client API.|
|-- Return the path to the JAR files that implement the StreamBase and LiveView Java Client APIs.|
|-- Return compiler and linker environment variables configured for compatibility with the C++ Client API for the current StreamBase installation.|
|-- Return the full path to the StreamBase Python Client API library, for use in PYTHONPATH variables or other Python related script.|
--libs 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.
--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
--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-classpathoption 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
--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
--envwith eval or a similar command to execute the commands returned. For all platforms, returns a setting for
STREAMBASE_HOMEand prepends the StreamBase
bindirectories to the
PATH. For macOS and Linux, also returns a setting for
MANPATH. See the StreamBase-Configued Shells page in the StreamBase Installation Guide for information on using this option in shell startup files.
--help, -h(Linux, macOS, and Windows)
Displays a usage message, then exits. Using the sb-config command with no arguments also shows usage.
--java-home(Linux, macOS, and Windows)
Returns the full absolute path to the directory that contains a system-installed JDK, or StreamBase-bundled JDK, to be used with StreamBase Studio and StreamBase command-line utilities. Whether this option returns the path to a system or bundled JDK depends on the setting, if any, of the
STREAMBASE_USE_INTERNAL_JDKenvironment variable, as follows:
fallback — This is the default setting as of StreamBase 10.4.0. If set to
fallback, or not set, this configures Studio to try to locate a system-installed JDK 8, and to use the StreamBase bundled JDK 8 only if a system JDK 8 is not found.
true — Always use the JDK 8 bundled with StreamBase. This was the default value of STREAMBASE_USE_INTERNAL_JDK before release 10.4.0.
false — Use the JDK specified in the
JAVA_HOMEenvironment variable, if set.
JAVA_HOMEmust be set to the full, absolute path to the top-level directory containing your JDK.
If set to
false, but no
JAVA_HOMEis defined, StreamBase searches the system PATH for a JDK. If not found, StreamBase looks in standard installation locations for a JDK. If still not found, Studio does not start.
--java(Linux, macOS, and Windows)
Returns the path to the java command used by the current StreamBase and LiveView installation, using the same rules as for
--java-home, above. By default, this option returns the java command from a system-installed JDK.
--javac(Linux, macOS, and Windows)
Returns the path to the javac Java compiler used by the current StreamBase and LiveView installation, using the same rules as for
--libs(Linux and macOS only)
Returns the C++ linker flags appropriate for building StreamBase and LiveView 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 LiveView Java client applications. See the
--classpathoption above for StreamBase-only development.
--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
PYTHONPATHenvironment variable. For example:
export PYTHONPATH=`sb-config --pypath`:$PYTHONPATH.
On Linux, the versions of Python supported can be determined from the names of the
STREAMBASE_HOME/lib64, such as
On Windows, this option requires the presence of a Windows Python 2.7 installation from Python.org or ActiveState, with the python.exe command available in the PATH.
Returns version information and exits.
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.
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
-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 how to compile and run a StreamBase Java client application.
javac -classpath `sb-config --classpath` MyApplication.java
java -classpath `sb-config --classpath`:. MyApplication