Skip to content

Latest commit

 

History

History
163 lines (106 loc) · 5.17 KB

File metadata and controls

163 lines (106 loc) · 5.17 KB

sibylline logo

Sibylline

Data Structures and Algorithms written in C

Status

BSD licensed Build, Test, Check Style


Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project as an external dependency.

Installation

To build this library the following dependencies must be installed on your system:

Then, run the following commands to build this library:

cmake -S . -B build
cmake --build build

Build Type and Tests

To run this lib's tests you need the following dependencies:

  • Check (At least version 0.11.0)

By default the Release build type will be used. Note that assertions will be disabled with this build type. Tests only build in Debug mode — specify it via CMAKE_BUILD_TYPE:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build
ctest --test-dir build

Memory Analysis

Valgrind (Linux)

Install Valgrind and enable it at configure time:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_VALGRIND=ON
cmake --build build
ctest --test-dir build --output-on-failure

AddressSanitizer + UndefinedBehaviorSanitizer (Linux and macOS)

No extra dependencies — ASan and UBSan ship with Clang/GCC. Detects use-after-free, buffer overflows, and undefined behavior. On Linux, leak detection (LSan) is also included automatically.

cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=ON
cmake --build build
ctest --test-dir build --output-on-failure

Leak detection on macOS

The leaks tool is built into macOS (Xcode developer tools). It is incompatible with ENABLE_SANITIZERS — run it as a separate step without sanitizers enabled:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_LEAKS=ON
cmake --build build
ctest --test-dir build --output-on-failure

For complete macOS coverage, run both configurations: ENABLE_SANITIZERS=ON to catch memory errors, then ENABLE_LEAKS=ON to catch leaks.


Deployment

If you wish to install the sibylline library run the following command with sudo after building the project:

sudo cmake --install build

By default the libray will be built as SHARED, if you wish to have it as a STATIC library you may edit the CMakeLists.txt at the root of the project:

# Configure wether libraries will be static or shared linked
set(BUILD_SHARED_LIBS ON)

The location of the shared library will be made available in the file sibylline/build/install_manifest.txt

  • This will install the shared library at /usr/local/lib/libsibylline.so in Unix machines.

If you wish to change the deployment location you may edit the CMakeLists.txt at the root of the project:

# install shared library at /usr/lib. Use "sudo make install" to apply 

install(TARGETS sibylline DESTINATION lib)

Documentation

To generate documentation make sure to install Doxygen. Once inside the folder type the command below to generate the documentation:

doxygen ./docs/Doxyfile

The documentation will be generated in the doc_doxygen folder under html & latex folders.

Code formatting

To format this project's source code we're using clang-format. To format all existing source code run the following command:

/bin/bash ./check_code_format.sh

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Benardi Nunes - Initial work - Benardi

Acknowledgments


License

This project is licensed under the BSD-3 Clause License - see the LICENSE.md file for details

FOSSA Status