Index
CBM User Guide

Command Line Builds with CBM

This topic discusses how to build Rogue Wave software parts using command line invocation of the configuration and build model (CBM). The major sections are:

Related topics include:

Preliminary Requirements

Before proceeding, be sure that:

After the above two actions, you have a CBM directory structure that is very nearly a complete Software Parts Manager directory structure, ready and waiting for the day you obtain the SPM graphical interface, and you have a product tree for the product you are going to build.

The Control Script rwspm

Rogue Wave provides the control script rwspm for performing command line builds through CBM. We encourage you to conduct your builds using the more flexible Software Parts Manager graphical interface distributed on our CD or from our web site. If you lack access to the GUI, rwspm must be used.

rwspm Syntax

The rwspm script has the following syntax:

   rwspm -t<build type> [-d] [-g|-G] [-l] -f<compiler properties file name>
         -p<product tree path> [-w<workspace path>]

Do not place any spaces between argument flags and their associated values or errors may result.

The following invocation would create a shared, multithread Tools.h++ library built on the Standard C++ Library, but without symbolic debugging:

   rwspm -t12 -d  -fw32_msvc.in -pc:\rwav\parts\tls0707w 
      -wc:\rwav\workspaces\win95\msvc50\12d

rwspm Arguments

The following paragraphs describe each of the arguments.

-d
(Optional) No arguments. Specifies that you are building a shared library, otherwise known as a DLL or dynamic library.

-f<compiler properties file name>
Required. Specifies the name of the compiler properties file to be used in the build. This file must reside in the directory <SPM_root>/scripts/platform, which contains a file for each of the environments (operating system and compiler combinations) that Rogue Wave supports. The naming convention is <OPSYS>_<COMPILER>.in. For example, the file for Microsoft Visual C++ on Windows 95 would be w32_msvc.in.

Here is the file w32_msvc.in:
# Shell script used as an input file to rwsetup
# Supports "cl" (MSVC) on WINNT

# --- Compiler and OS Names ---
RWOPSYS=WINNT
RWCOMPILER=MSVC

# --- Compiler Settings ---
RWCPP="cl"
RWFIRST_CCOPTS=""
RWLAST_CCOPTS=""
RWFIRST_LINKOPTS=""
RWLAST_LINKOPTS=""

Modifying the platform files may cause CBM not to work. The only modifications you should consider making are:

Note that the LINKOPTS specifications apply only to application builds, not to library builds.

The specification -fNULL indicates an unsupported platform and forces the insertion of question and answer breaks in the build to obtain platform-specific configuration data.

-g
(Optional) Interrupts the build process immediately after makefile generation and exporting of header files to the workspace. Useful for examining correctness of CBM-generated makefiles prior to building C++ libraries for unsupported environments. Normally paired with a subsequent rwspm -G, which completes the creation and installation of examples makefiles and source in the workspace after you manually invoke make to build a library.

-G
(Optional) Completes build process following manual application of make to create a C++ library. The rwspm -G invocation continues the interrupted build process with the creation and installation of examples makefiles and the installation of examples source. Normally used subsequent to rwspm -g.

-l
(Optional) Causes library build implementation source files to be copied to <workspace>/buildloc/<part>. This can be useful in debugging.

-p<product tree path>
Required. Specifies the path to the product tree for the part you are building. The product tree contains the source and makefile templates for the build. The installation script places the product tree at <rw_root>/parts/<product name>. For Tools.h++, this would be <rw_root>/parts/tls0708<os>, where <os> is w for Windows, o for OS/2, or u for Unix.

-t<build type>
Required. The build type argument is a one- or two-digit number specifying standard build type options. The table below shows the options available.

Build Type
Build Option
Std Lib in use?
Threading
Debugging
0
No
single thread
no debugging
3
No
single thread
debugging
4
No
multithread
no debugging
7
No
multithread
debugging
8
Yes
single thread
no debugging
11
Yes
single thread
debugging
12
Yes
multithread
no debugging
15
Yes
multithread
debugging

Keep in mind:


-w<workspace>
(Optional) Specifies the path to the workspace directory where the built library and associated files will be placed. The default location is <rw_root>/workspaces/<OPSYS>/<COMPILER>/<BUILDTYPE>. For Tools.h++ compiled for Microsoft Visual C++ on Windows NT with a build type of 3s this would be
   <rw_root>/workspaces/WINNT/MSVC/3s

Note: With the November, 1997 release of Software Parts Manager, default workspace paths include the operating system and compiler version number. But default workspace paths generated by command line builds through CBM do not have these version numbers, which depend on information supplied by the user through the SPM interface. If you wish version numbers to appear, you must use the -w option to specify the workspace path. For the above example, if the NT version were 4.0 and the Msvc version were 5.0, you would specify
   -w<rw_root>/workspaces/WINNT4/MSVC50/3s

Running the Build Process

Before running the build process, be sure you have carefully read:

Another good source of information on building your product is the build guide, located in <rw_root>/htmldocs. Look for a directory named with the product mnemonic, a three-digit version number, and the suffix bd, such as tlsnnnbd for Tools.h++, and open the file tindex.html in the HTML browser of your choice. Although written with the assumption that the user has the Software Parts Manager graphical interface, the cautions and warnings about product- or environment-specific requirements are equally applicable to CBM builds.

You should also consult Section 4 of the build guide for advice on compiling applications that link to the Rogue Wave product libraries.

Another thing to consider is whether you want a standard CBM-generated library name (in which case you don't need to do anything special), or you wish to add a custom suffix to the name. A custom suffix helps you to generate distinct library names in special cases where this is necessary.

As an example of an rwspm invocation, let's suppose that you are building Tools.h++ on top of the Rogue Wave Standard C++ Library. (You would need to have already built the Standard C++ Library.) The library is to be shared (DLL), multithreaded, and without debugging. You are compiling for Microsoft Visual C++ on Windows NT, your Rogue Wave root directory is c:\rwav, and you are accepting the default workspace location (so you do not need to specify the -w argument). Your invocation would be:

   rwspm -t12 -d -fw32_msvc.in -pc:\rwav\parts\tls0707w

Here is the procedure for running a build:

  1. Get thee to the command line.
  2. Change to the directory <spm_root>/scripts. You must be in this directory when running rwspm. If not, it won't work.
  3. Enter your invocation of rwspm, something on the order of the example above.
  4. For some builds, you will need to respond to questions written to the command window. Type a response and press Enter.

Results of the Build

The build creates a workspace if one does not already exist. By default the workspace path is based on the operating system, the compiler, and the build type used in the build, unless the -w argument was specified in the build invocation.

In the workspace, a library build creates the directory buildloc/<part> in which to implement the build. The build makefile or makefiles, the resulting object files, and, if requested, the implementation source files end up in this directory. Header files required by applications do not end up here. These are copied to the rw directory within the workspace.

Note that the build does not clean up the object files generated by the build. You must do this yourself by:

Other topics that might interest you at this point are Library Naming Conventions and Compatibility Issues, which discusses the implications if you have older versions of Rogue Wave products.

Building Examples

The script rwspm cannot be used to compile example code. The good news, however, is that the command line build process sets everything up so you can fairly effortlessly build the examples through your compiler's make command.

When rwspm is used to build a library product, all example source code and makefiles are exported to an examples/<part> directory located in the workspace directory. The default location would be:

   <rw_root>/workspaces/<OPSYS>/<COMPILER>/<BUILDTYPE>/examples/<part>

For the Tools.h++ build discussed above, the source would be located by default in

   <rw_root>/workspaces/WINNT/MSVC/12d/examples/tls0708w

For some products, the examples/<part> directory has subdirectories containing subsets of the examples.

To compile the examples, therefore, all you have to do is change to the examples source code directory (or directories) and invoke your compiler's make command, either globally by specifying no argument, or for a particular target by specifying a file name argument. Look at the makefile for a listing of the specific example targets available.

CBM User Guide
Index