-
Notifications
You must be signed in to change notification settings - Fork 1
Building Steppable
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.
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 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:
-
Open up a new terminal window, or
CMD.EXE
for Windows at the build directory. -
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
-
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...
-
The binaries are in the
bin/
directory in the build directory, and the libraries are in thelib/
directory.
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:
-
Open up a new terminal window, or
CMD.EXE
for Windows at the build directory. -
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
-
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...
-
The binaries are in the
bin/
directory in the build directory, and the libraries are in thelib/
directory. You can run the binaries with a debugger to inspect them for bugs.
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.
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
Copyright (C) Andy Zhang, 2023-2024. Licensed under the MIT License.
- Getting the Source - Cloning the repository to your local machine
- Build the Project (CMake) - Compiling the source code of Steppable using CMake
- Build the Project (build.py) - Compiling the source code of Steppable using build.py
- Workflow - How to contribute to this repository
- Coding Style (Python) - Style guidelines for Python code in this project
- Coding Style (C++) - Style guidelines for CPP code in this project
- Directory Structure - The directory structure used by this project.
- Using the API - How to use the Steppable API
- Supported Platforms
- Performance - Some benchmarks of Steppable for reference
- Status - Status of Steppable, at a glance