Skip to content

DEIS-Tools/ptrie

 
 

Repository files navigation

ptrie

A memory efficient hashfree hashmap implementation packaged as a header-only library.

Dependencies

Ubuntu (assuming 24.04 LTS):

sudo apt install cmake ninja-build g++
sudo apt install libsparsehash-dev

macOS (install XCode from AppStore, and Homebrew) using native AppleClang:

brew install cmake ninja  
brew install google-sparsehash

macOS (install XCode from AppStore, and Homebrew) using GCC from brew:

brew install cmake ninja gcc
brew install google-sparsehash
export CC=gcc-15
export CXX=g++-15

Windows MSYS2 UCRT64:

PRE=mingw-w64-ucrt-x86_64
pacman -S $PRE-git $PRE-cmake $PRE-ninja $PRE-toolchain $PRE-sparsehash

Installation

Use CMake to install to $PWD/local (headers and CMake configuration):

cmake --workflow --preset quick-release && \
cmake --install build-quick --config Release --prefix=$PWD/local

Example Usage

Directory example contains a sample project using ptrie.

Test against the ptrie installed in local using ptrie.cmake:

cmake -S example -B build-example-local -DCMAKE_PREFIX_PATH=$PWD/local && \
cmake --build build-example-local && \
ctest --test-dir build-example-local --verbose

Test by fetching ptrie from the repository using ptrie.cmake:

cmake -S example -B build-example && \
cmake --build build-example && \
ctest --test-dir build-example --verbose

Clean all:

rm -Rf local build-quick build-example-local build-example

Testing and Benchmarking

Benchmark results are plotted using python when the following packages are installed:

sudo apt install python3-matplotlib python3-pandas python3-scipy python3-pyqt6

Test and benchmark a release build:

cmake --workflow --preset release

Test and debug with sanitizers:

cmake --workflow --preset debug-san

Inspect other workflow presets:

cmake --workflow --list-presets

See also configuration, build and test presets:

cmake --list-presets=configure
cmake --list-presets=build
cmake --list-presets=test

For example multi-config with sanitizers Debug build and test:

cmake --preset multi-san
cmake --build --preset debug-san
ctest --preset debug-san

About

A memory efficient hashfree hashmap implementation

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 85.7%
  • CMake 8.5%
  • Python 3.6%
  • Shell 1.5%
  • C 0.7%