Quick Start for Developers
Note
The sc-machine can't be built on Windows.
This guide provides short information for developers to start to work with sc-machine quickly. You can always learn more about the sc-machine's build system.
Check CMake
Install pipx first using pipx installation guide if not already installed.
Ensure you are using CMake version 3.24 or newer. Verify your version with:
To upgrade CMake, run:
# Use pipx to install cmake if not already installed
pipx install cmake
pipx ensurepath
# relaunch your shell after installation
exec $SHELL
Install Ninja generator for CMake, to use sc-machine CMake presets:
# Use pipx to install ninja if not already installed
pipx install ninja
pipx ensurepath
# relaunch your shell after installation
exec $SHELL
Start develop sc-machine with Conan
Install Conan
Install Conan, to build sc-machine with Conan-provided dependencies:
# Use pipx to install conan if not already installed
pipx install conan
pipx ensurepath
# relaunch your shell after installation
exec $SHELL
Use sc-machine in Debug
Build sc-machine in Debug
To build sc-machine in debug mode using Conan-provided dependencies, run:
Note: By default, configure preset debug
enables building sc-machine tests.
Run sc-machine tests in Debug
After that, you can go to build/Debug
and run tests via ctest
:
Run sc-machine in Debug
# create empty knowledge base sources folder
mkdir kb
# note: at this stage you can move your KB sources to the ./kb folder
# build knowledge base
./build/Debug/bin/sc-builder -i kb -o kb.bin --clear
# run sc-machine
./build/Debug/bin/sc-machine -e build/Debug/lib/extensions -s kb.bin
Use sc-machine in Release
Build sc-machine in Release
To build sc-machine in release mode using Conan-provided dependencies, run:
To build sc-machine with tests in release mode using Conan-provided dependencies, run:
# release build type with tests
cmake --preset release-with-tests-conan
cmake --build --preset release
Run sc-machine tests in Release
After that, you can run tests:
Run sc-machine in Release
# create empty knowledge base sources folder
mkdir kb
# note: at this stage you can move your KB sources to the ./kb folder
# build knowledge base
./build/Release/bin/sc-builder -i kb -o kb.bin --clear
# run sc-machine
./build/Release/bin/sc-machine -e build/Release/lib/extensions -s kb.bin
You can also check code formatting, build sc-machine with sanitizers and other. To learn more, go to the CMake flags page.
Start develop sc-machine with system-provided dependencies
Install sc-machine dependencies
Note: sc-machine build system supports installation of dependencies for Ubuntu and macOS only.
Install sc-machine dependencies for Ubuntu
Install sc-machine dependencies for macOS
Install sc-machine dependencies for other OS
Currently, we require the following packages to be available to CMake at build-time:
java
glib2
websocketpp
asio
as the transitive dependencynlohmann_json
xml2
You can try install these dependencies on your OS.
Use sc-machine in Debug
Build sc-machine in Debug
To build sc-machine in debug mode using system-provided dependencies, run:
Note: By default, configure preset debug
enables building sc-machine tests.
Run sc-machine tests in Debug
After that, you can go to build/Debug
and run tests via ctest
:
Run sc-machine in Debug
# create empty knowledge base sources folder
mkdir kb
# note: at this stage you can move your KB sources to the ./kb folder
# build knowledge base
./build/Debug/bin/sc-builder -i kb -o kb.bin --clear
# run sc-machine
./build/Debug/bin/sc-machine -e build/Debug/lib/extensions -s kb.bin
Use sc-machine in Release
Build sc-machine in Release
To build sc-machine in release mode using system-provided dependencies, run:
To build sc-machine with tests in release mode using system-provided dependencies, run:
Run sc-machine tests in Release
After that, you can run tests:
Run sc-machine in Release
# create empty knowledge base sources folder
mkdir kb
# note: at this stage you can move your KB sources to the ./kb folder
# build knowledge base
./build/Release/bin/sc-builder -i kb -o kb.bin --clear
# run sc-machine
./build/Release/bin/sc-machine -e build/Release/lib/extensions -s kb.bin
You can also check code formatting, build sc-machine with sanitizers and other. To learn more, go to the CMake flags page.