{"id":16567843,"url":"https://github.com/thenetadmin/nvleak-libpmemobj-cpp","last_synced_at":"2026-04-20T15:33:26.694Z","repository":{"id":109731255,"uuid":"550658987","full_name":"TheNetAdmin/NVLeak-libpmemobj-cpp","owner":"TheNetAdmin","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-14T03:08:38.000Z","size":4708,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"nvleak-mitigation","last_synced_at":"2025-02-26T10:54:07.947Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheNetAdmin.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-10-13T05:49:15.000Z","updated_at":"2022-10-13T05:53:34.000Z","dependencies_parsed_at":"2023-06-11T06:30:11.016Z","dependency_job_id":null,"html_url":"https://github.com/TheNetAdmin/NVLeak-libpmemobj-cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNetAdmin%2FNVLeak-libpmemobj-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNetAdmin%2FNVLeak-libpmemobj-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNetAdmin%2FNVLeak-libpmemobj-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNetAdmin%2FNVLeak-libpmemobj-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheNetAdmin","download_url":"https://codeload.github.com/TheNetAdmin/NVLeak-libpmemobj-cpp/tar.gz/refs/heads/nvleak-mitigation","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242009809,"owners_count":20057143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T21:07:38.109Z","updated_at":"2025-12-02T15:05:45.446Z","avatar_url":"https://github.com/TheNetAdmin.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libpmemobj-cpp\n\n[![Build status](https://github.com/pmem/libpmemobj-cpp/workflows/CPP/badge.svg)](https://github.com/pmem/libpmemobj-cpp/actions)\n[![libpmemobj-cpp version](https://img.shields.io/github/tag/pmem/libpmemobj-cpp.svg)](https://github.com/pmem/libpmemobj-cpp/releases/latest)\n[![Coverity Scan Build Status](https://scan.coverity.com/projects/15911/badge.svg)](https://scan.coverity.com/projects/pmem-libpmemobj-cpp)\n[![Coverage Status](https://codecov.io/github/pmem/libpmemobj-cpp/coverage.svg?branch=master)](https://codecov.io/gh/pmem/libpmemobj-cpp/branch/master)\n[![Packaging status](https://repology.org/badge/tiny-repos/libpmemobj-cpp.svg)](https://repology.org/project/libpmemobj-cpp/versions)\n\n**libpmemobj-cpp** is a C++ binding for **libpmemobj** (a library which is a part of [PMDK collection](https://github.com/pmem/pmdk)).\nMore implementation details can be found in [include/libpmemobj++/README.md](include/libpmemobj++/README.md).\n\nLatest releases can be found on the [\"releases\" tab](https://github.com/pmem/libpmemobj-cpp/releases).\nUp-to-date support/maintenance status of branches/releases is available on [pmem.io](https://pmem.io/libpmemobj-cpp).\n\n## Compatibility note\nIn libpmemobj 1.12 we introduced a new transaction handler type: [pmem::obj::flat_transaction](https://pmem.io/libpmemobj-cpp/master/doxygen/classpmem_1_1obj_1_1flat__transaction.html).\nBy defining LIBPMEMOBJ_CPP_USE_FLAT_TRANSACTION you can make pmem::obj::transaction to be an alias to pmem::obj::flat_transaction.\nIn 1.12 we have also changed the default behavior of containers' transactional methods. Now, in case of any failure within such method,\nthe outer transaction (if any) will not be immediately aborted. Instead, an exception will be thrown, which will lead to transaction abort\nonly if it's not caught before the outer tx scope ends. To change the behavior to the old one, you can set LIBPMEMOBJ_CPP_FLAT_TX_USE_FAILURE_RETURN macro to 0.\nBe aware that the old behavior can lead to segfaults in some cases (see tx_nested_struct_example in this [file](examples/transaction/transaction.cpp)).\n\n## Table of contents\n1. [Pre-built packages](#pre-built-packages)\n\t- [Windows](#windows)\n\t- [Ubuntu/Debian](#ubuntudebian)\n\t- [Fedora/RHEL](#fedorarhel)\n2. [Dependencies](#dependencies)\n3. [Linux build](#linux-build)\n\t- [Standard compilation](#standard-compilation)\n\t- [Developer compilation](#developer-compilation)\n\t- [Distribution package build](#distribution-package-build)\n\t- [Compilation with Valgrind instrumentation](#compilation-with-valgrind-instrumentation)\n4. [Windows build](#windows-build)\n\t- [Install prerequisites via vcpkg](#install-prerequisites-via-vcpkg)\n\t- [Compilation with Visual Studio 2015](#compilation-with-visual-studio-2015)\n\t- [Compilation with Visual Studio 2017 or above](#compilation-with-visual-studio-2017-or-above)\n5. [Extra CMake compilation flags](#extra-cmake-compilation-flags)\n6. [Contact us](#contact-us)\n\n## Pre-built packages\nThe best way to install stable releases, tested on specific OS, is to use package manager.\n\n### Windows\nThe recommended and the easiest way to install **libpmemobj-cpp** on Windows is to use Microsoft's vcpkg. Vcpkg is an open source tool and ecosystem created for library management.\nFor more information about vcpkg please see [vcpkg repository](https://github.com/microsoft/vcpkg#quick-start-windows).\n```ps\n.\\vcpkg.exe install libpmemobj-cpp:x64-windows\n```\n\n### Ubuntu/Debian\nFor installation on Debian-related distros please execute following commands:\n```\n# apt install libpmemobj-cpp-dev\n```\n\n### Fedora/RHEL\nTo install **libpmemobj-cpp** on Fedora or RedHat execute:\n```\n# dnf install libpmemobj++-devel\n```\n\n## Dependencies\nYou will need the following packages for compilation:\n\n- **cmake** \u003e= 3.3\n- **libpmemobj-dev(el)** \u003e= 1.9 (https://pmem.io/pmdk/)\n- compiler with C++11 support\n\t- **gcc** \u003e= 4.8.1\u003csup\u003e 1\u003c/sup\u003e\n\t- **clang** \u003e= 3.3\n\t- **msbuild** \u003e= 14\u003csup\u003e 2\u003c/sup\u003e\n- for testing and development:\n\t- **valgrind-devel** (at best with [pmemcheck support](https://github.com/pmem/valgrind))\n\t- **clang-format** 9.0\n\t- **perl**\n\t- **libatomic**\n- for Windows compilation:\n\t- [**vcpkg**](https://github.com/microsoft/vcpkg#quick-start-windows)\n\nRequired packages (or their names) for some OSes may differ. Some examples or scripts in this repository may require additional dependencies, but should not interrupt the build.\n\nSee our **[Dockerfiles](utils/docker/images)** (used e.g. on our CI\nsystems) to get an idea what packages are required to build\nthe entire libpmemobj-cpp, with all tests and examples.\n\n \u003e\u003csup\u003e1\u003c/sup\u003e C++11 is supported in GCC since version 4.8.1, but it does not support expanding variadic template variables in lambda expressions, which is required to build persistent containers and is possible with GCC \u003e= 4.9.0. If you want to build libpmemobj-cpp without testing containers, use flag TEST_XXX=OFF (separate flag for each container).\n\n \u003e\u003csup\u003e2\u003c/sup\u003e **radix_tree** is supported on Windows with MSBuild \u003e=15 (Visual Studio at least 2017 is needed). Testing radix_tree can be disabled via CMake option (use -DTEST_RADIX_TREE=OFF).\n\n## Linux build\n### Standard compilation\n```\n$ mkdir build\n$ cd build\n$ cmake .. [-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\u003cpath_to_installation_dir\u003e]\n$ make\n# make install\n```\n\n### Developer compilation\n```sh\n$ mkdir build\n$ cd build\n$ cmake .. -DCMAKE_BUILD_TYPE=Debug -DDEVELOPER_MODE=1 -DCHECK_CPP_STYLE=1\n$ make\n$ ctest --output-on-failure\n```\n\n### Distribution package build\n```sh\n$ mkdir build\n$ cd build\n$ cmake .. -DCPACK_GENERATOR=\"$GEN\" -DCMAKE_INSTALL_PREFIX=/usr\n$ make package\n```\n\n$GEN is type of package generator and can be RPM or DEB\n\nCMAKE_INSTALL_PREFIX must be set to a destination were packages will be installed\n\n### Compilation with Valgrind instrumentation\n\nIn order to build your application with libpmemobj-cpp and\n[pmemcheck](https://github.com/pmem/valgrind) / memcheck / helgrind / drd,\nValgrind instrumentation must be enabled during compilation by adding flags:\n- LIBPMEMOBJ_CPP_VG_PMEMCHECK_ENABLED=1 for pmemcheck instrumentation\n- LIBPMEMOBJ_CPP_VG_MEMCHECK_ENABLED=1 for memcheck instrumentation\n- LIBPMEMOBJ_CPP_VG_HELGRIND_ENABLED=1 for helgrind instrumentation\n- LIBPMEMOBJ_CPP_VG_DRD_ENABLED=1 for drd instrumentation, or\n- LIBPMEMOBJ_CPP_VG_ENABLED=1 for all Valgrind instrumentations (including pmemcheck).\n\nIf there are no memcheck / helgrind / drd / pmemcheck headers installed on your\nsystem, build will fail.\n\n## Windows build\n\n### Install prerequisites via vcpkg\n```ps\nvcpkg install pmdk:x64-windows\nvcpkg integrate install\n```\n\n### Compilation with Visual Studio 2015\n```ps\ncmake . -Bbuild -G \"Visual Studio 14 2015 Win64\"\n        -DCMAKE_TOOLCHAIN_FILE=\"c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake\"\n        -DTEST_RADIX_TREE=OFF\n\nmsbuild build/ALL_BUILD.vcxproj /m\n```\n### Compilation with Visual Studio 2017 or above\n```ps\ncmake . -Bbuild -G \"Visual Studio 15 2017\" -A \"x64\"\n\t\t-DCMAKE_TOOLCHAIN_FILE=\"c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake\"\n\nmsbuild build/ALL_BUILD.vcxproj /m\n```\n\n## Extra CMake compilation flags\nFor custom build you can use CMake flags to change build type, change C++ standard, enable/disable components or features for testing purposes.\nTo list all CMake flags use the following:\n```sh\n$ mkdir build\n$ cd build\n$ cmake ..\n$ cmake -LH\n```\nor just use graphical CMake frontend like **cmake-qt-gui** or **cmake-curses-gui**.\n\n## Contact us\nFor more information on this library, contact Igor Chorążewicz (igor.chorazewicz@intel.com),\nPiotr Balcer (piotr.balcer@intel.com) or post on our **#pmem** Slack channel using\n[this invite link](https://join.slack.com/t/pmem-io/shared_invite/enQtNzU4MzQ2Mzk3MDQwLWQ1YThmODVmMGFkZWI0YTdhODg4ODVhODdhYjg3NmE4N2ViZGI5NTRmZTBiNDYyOGJjYTIyNmZjYzQxODcwNDg)\nor [Google group](https://groups.google.com/group/pmem).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenetadmin%2Fnvleak-libpmemobj-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthenetadmin%2Fnvleak-libpmemobj-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenetadmin%2Fnvleak-libpmemobj-cpp/lists"}