Getting Started

The CAProck library is implemented in portable C++, but offers a C-only API. The C API was chosen in order to most easily integrate the library in other projects and languages, whereas the implementation language was chosesn to provide better memory safety and similar conveniences during implementation.

As a user of the library, you need only be concerned with the C API.

You would usually use Meson when contributing to the library itself; that build system also provides some means for dependency management, which may help you in your project. If you do not wish to use Meson for whichever reason, try the approach with Conan below.

Using Meson

CAProck is built using meson, because this provides cross-platform builds that are relatively easily managed. Meson is written in Python, as is Sphinx, the tool with which this documentation is generated.

Install Tooling

Because there is so much Python based tooling in this project, it seemed best to use Pythonic means for managing the tool dependencies, so that is what we’re doing.

  1. Install Python version 3 or above. Most Linux systems have this already installed; BSD systems provide it. Use your system’s best installation method for this.

    Python comes with a command pip (sometimes pip3), with which you install packages.

  2. Install the pipenv package:

    $ pip3 install -U pipenv
    
  3. Use pipenv to install the development tools:

    $ pipenv install
    
  4. Activate the pipenv virtual environment:

    $ pipenv shell
    

At this point the shell you’re running has the development tools installed locally.

Build with Meson

Meson expects a build folder separate from the source folder. Typically you might create this within the repository working directory; this is what we’re doing here in the example.

$ cd /path/to/repo
$ mkdir build
$ cd build

From there, you need to run Meson.

$ meson setup ..
$ ninja

For more information on Meson usage, see the meson documentation. You may need to install ninja separately.

Documentation

For generating documentation, we need Sphinx, and some extensions. These are installed by passing an extra flag to the pipenv installation step above:

$ pipenv install --dev

Note that you will need to separately install Doxygen, which is typically provided by your system’s package manager.

To build the documentation, do the following:

$ cd /path/to/repo/docs/api
$ make html

Using Conan

We provide (semi-)regular builds of the library using conan. These are hosted on codeberg, where our code is also hosted. The site also includes instructions on installing caprock via conan.