Setup and Build BDE

The BDE Build System (BBS) allows users to quickly set build parameters in the environment variables that will be used by various bbs tools.

Note

This same process can be used to build any BDE-style repository.

Note

The Build setup must always be performed at the top of the repository or the workspace.

Download the BDE libraries

BDE library can be cloned from public github bde repository:

$ git clone https://github.com/bloomberg/bde.git
$ cd bde

See Build Multiple Projects in a Workspace for the instruction on setting a build workspace with multiple repos.

Setup the Environment

Use bbs_build_env To set the build variables in the environment:

$ eval `bbs_build_env -u dbg_64`

Note

The -p and -u options can be used to configure the compiler and build options resectively.

bbs_build_env list can be used to list the available compilers (users can also add a custom compiler profile). The build options are passed by UFID

After setting the build environment, user can subsequently run bbs_build configure without additional options.

Inspect Build Environment Settings

Users can also use bbs_build_env to see the environment variables that will be set:

$ bbs_build_env -u dbg_64
Effective ufid: dbg_64
Using build profile: gcc-10.2.1
export BBS_ENV_MARKER=ON
export BDE_CMAKE_UPLID=unix-linux-x86_64-3.10.0-gcc-10.2.1
export BDE_CMAKE_UFID=dbg
export BDE_CMAKE_BUILD_DIR="_build/unix-linux-x86_64-3.10.0-gcc-10.2.1-dbg"
export CC=/opt/bb/bin/gcc
export CXX=/opt/bb/bin/g++
export BDE_CMAKE_TOOLCHAIN=/home/<user>/bde-tools/BdeBuildSystem/toolchains/linux/gcc-default.cmake
export BDE_CMAKE_INSTALL_DIR=/home/<user>/workspace/bde/_install

Configure the Build

Because we used bbs_build_env to set environment variables specifying the compiler and build options, we do not need to pass any options to configure. Alternatively, compiler and build options can be passed explicitly to bbs_build on the command line.

$ bbs_build configure

Note

The configure step must be done after setting a new build environment (be it a different compiler, ufid or a build shell).

In the case when you want to make sure that any pre-existing build configuration is erased, add --clean parameter:

$ bbs_build configure --clean

Build and Install

  • Build the software:

$ bbs_build build
  • Build and run any tests:

$ bbs_build build --tests run
  • Install the headers and built libraries:

$ bbs_build install

Developers can also build individual components and groups of components.