Skip to content

Building Steppable

Andy Zhang edited this page Aug 22, 2024 · 6 revisions

Building Steppable (CMake)

Introduction

Steppable is configured using CMake, in order to enable building across different platforms and compilers. As a result, one needs an external build system, e.g., Make to build it.

Get Started

To get started, you would need:

Software Purpose Alternatives Required?
LLVM Clang C++ Compiler GCC, MSVC... YES
CMake Configure None YES
Make Building Ninja, Visual Studio... YES
Python Building None NO
Git Downloading Download as Zip NO

First, clone the repository using the command:

$ git clone https://github.com/ZCG-coder/Steppable.git
Cloning into Steppable
...

For more information on getting the source code, see Getting the Source Code.

Then, in the local folder, make a new directory. You can call it whatever you like, but I would recommend calling it build.

$ mkdir build

Release Build

Release builds are commonly used for production. Therefore, the executables and libraries are often optimized, in order to save some storage for end users.

CMake defaults to release builds, which means that one need not to specify any options to make a release build.

To make a release build:

  1. Open up a new terminal window, or CMD.EXE for Windows at the build directory.

  2. After the prompt, type:

    $ cmake ..
    -- The C Compiler indentification is Clang 17.0.6
    ...

    For users with ninja installed and working, please use the command below:

    $ cmake .. -GNinja
    -- The C Compiler indentification is Clang 17.0.6
  3. Then, invoke the build tool. CMake generates Makefiles by default, so the command to build is:

    $ make

    CMake also supports invoking the build command itself. You can also call:

    $ cmake --build .
    [1/70] Build CXX object...
  4. The binaries are in the bin/ directory in the build directory, and the libraries are in the lib/ directory.

Debug build

Debug builds are commonly used for development. The build also includes debug symbols, linking binary code to a human-readable format.

To make a release build:

  1. Open up a new terminal window, or CMD.EXE for Windows at the build directory.

  2. After the prompt, type:

    $ cmake .. -DCMAKE_BUILD_TYPE=Debug
    -- The C Compiler indentification is Clang 17.0.6
    ...

    For users with ninja installed and working, please use the build below:

    $ cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug
    -- The C Compiler indentification is Clang 17.0.6
  3. Then, invoke the build tool. CMake generates Makefiles by default, so the command to build is:

    $ make

    CMake also supports invoking the build command itself. You can also call

    $ cmake ---build . --config Debug
    [1/70] Build CXX object...
  4. The binaries are in the bin/ directory in the build directory, and the libraries are in the lib/ directory. You can run the binaries with a debugger to inspect them for bugs.

Extra options

Steppable has some features that are only available when a certain option is turned on.

  • STP_BUILD_COMPONENT_EXECUTABLE - Enables individual component executable files to be built, for debugging and testing purposes.
  • STP_NO_BINDINGS - Disables the building of Steppable Python bindings. Useful if you do not have Python.

Using the built libraries

In the lib directory, there should be a file starting with steppyble. It is a compiled Python shared object, which can be imported from Python.

>>> import steppyble

Contents

Introduction

Contributing

Building

Development

API Documentation

Others

  • Performance - Some benchmarks of Steppable for reference
  • Status - Status of Steppable, at a glance
Clone this wiki locally