Kwecbuild

The kwecbuild command allows you to perform a distributed integration build analysis of a C/C++ project based on emake (the Electric Cloud version of make).

This command takes a build specification as input.

Usage

kwecbuild --ec-make <path_to_emake> [<other_options>] <build_specification_1> [<build_specification_2>...]

where:

Important:

  • kwecbuild must be executed from same directory as the Electric Cloud integration build.
  • The output (tables) directory for kwecbuild must be under the current working directory.

Example for Unix

This example command outputs Klocwork tables to the tables subdirectory of the current working directory.

kwecbuild --ec-make /opt/ecloud/i686_Linux/bin/emake --ec-host server01 --output-dir tables kwinject.out

Example for Windows

When using Windows, you may need to run the nmake emulation type, for example:

kwecbuild --ec-make C:\space\ecloud\i686_win32\bin\emake.exe --ec-host server01 --ec-option "--emake-root=Z:\dev;c:\Users\dev.lab" --ec-option "--emake-emulation=nmake" --output-dir tables kwinject.out 

When running the nmake emulation type, verify that the following environment variables are not set as they can cause the nmake emulation to fail, or can cause the analysis to run in dry mode:

  • EMAKEFLAGS
  • MAKEFLAGS

Options

Name Short name Description
--add-compiler-options <string> -a

pass additional options to the C/C++ compiler. To pass multiple compiler options, separate them by spaces, and surround the entire string in quotation marks. Acceptable values are Compiler options for kwbuildproject. For example:

 --add-compiler-options "-I C:\Toolbus\lib_includes --print-errors"
--add-linker-options <string> -L pass additional options to linker. To pass multiple linker options, separate them by spaces, and surround the entire string in quotation marks. Acceptable values are Linker options for kwbuildproject
--buildspec-variable <variable_name>=<variable_value> -V allows the use of a build specification template. When this option is used, and a build specification template (*.tpl) is supplied as input to kwecbuild instead of a standard build specification, kwebuild will substitute all occurrences of a given variable in a build specification template with the specified variable value. See Providing a build specification template for your developers.
--color -c enable colored console output
--ec-host <Cluster_manager_host_name>   Electric Cloud cluster manager host name. If this option is not provided, a warning will be issued, and emake will be executed in local mode.
--ec-make <path_to_emake>   Electric Cloud emake utility location (required)
--ec-option <string>   additional options for emake
--errors-config <string> -e specify the problem configuration file
--force -f run the analysis even if the specified output directory contains data files from the previous run (existing files will be deleted)
--help -h display this help
--license-host <host_name>   License Server host (default: localhost)
--license-port <port_number>   License Server port (default: 27000)
--log-file <file> -l send log output to the specified file. Default:<output_directory>\build.log
--no-lef -n do not run the Klocwork issue detection stage
--output-dir <directory> -o output tables directory (default: current working directory). Must be the current working directory, or a subdirectory of the current working directory. The path to the tables directory must not contain spaces.
--encoding -C encoding of the source files used in the project. The default is your system encoding. Use the --list option of kwconv to find the list of acceptable values. For more information, see the --encoding option of kwbuildproject.
--use-fbkb <string> -k use the specified knowledge base file for C/C++ projects. You can use this option multiple times in one command line.
--use-prev-fbkb <string> -Q

use the specified knowledge base file as a lower-priority file during a knowledge base update. Records from this file will be added to the new file only if more recent comparable records do not exist. Use this option when you have an automatically generated knowledge base file for a previous version of your source code. This allows you to speed up the issue detection process. However, results will not be as accurate.

You can specify multiple instances of this option on one command line.

--version   display version information