Data Structures and Algorithms written in C
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.
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 buildTo 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 buildInstall 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-failureNo 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-failureThe 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-failureFor complete macOS coverage, run both configurations: ENABLE_SANITIZERS=ON to catch memory errors, then ENABLE_LEAKS=ON to catch leaks.
If you wish to install the sibylline library run the following command with sudo after building the project:
sudo cmake --install buildBy 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.soin 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)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.
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.shWe use SemVer for versioning. For the versions available, see the tags on this repository.
- Benardi Nunes - Initial work - Benardi
-
Eduardo Rolim - check-cmake-example example repo
-
Fábio Silva - lotterypp automatic test discovery
This project is licensed under the BSD-3 Clause License - see the LICENSE.md file for details