Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Latest commit

 

History

History
103 lines (80 loc) · 3.8 KB

INSTALL.md

File metadata and controls

103 lines (80 loc) · 3.8 KB

Install / build guide

Contents

Requirements

In order to build libpmemstream, you need to have installed:

  • Linux 64-bit (OSX and Windows are not yet supported), with at least:
    • C compiler (e.g. gcc)
    • CMake >= 3.16
  • libpmem2-dev(el), which is part of PMDK - Persistent Memory Development Kit 1.10
  • miniasync - Mini Library for Asynchronous Programming
  • Used only for testing:
    • C++ compiler (e.g. g++)
    • valgrind - tool for profiling and memory leak detection. pmem forked version with pmemcheck tool is recommended, but upstream/original valgrind is also compatible (package valgrind-devel is required).
    • rapidcheck - some tests require this property based testing framework
    • gdb
    • bash, awk, grep - some tests require basic scripting tools.
    • GNU Binutils - some tests require this for testing generated binaries.
  • Used only for development:
    • pandoc - markup converter to generate man pages
    • perl - for whitespace checker script
    • clang format - to format and check coding style, version 11.1 is required
  • Used for benchmarks:
    • libpmemlog-dev(el), which is part of PMDK - Persistent Memory Development Kit 1.10

Required 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.

See our Dockerfiles (used e.g. on our CI system) to get an idea what packages are required to build the entire pmemstream, with all tests, checks, and examples.

Build and run tests

git clone https://github.com/pmem/pmemstream
cd pmemstream
mkdir ./build
cd ./build
cmake .. -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug    # run CMake, prepare Debug version
make -j$(nproc)                 # build everything
make test                       # run all tests

To see the output of failed tests, instead of the last command (make test) you can run:

ctest --output-on-failure

Install

To package pmemstream as a shared library and install on your system:

cmake .. [-DCMAKE_BUILD_TYPE=Release]	# prepare e.g. Release version
sudo make install			# install shared library to the default location: /usr/local
sudo make uninstall			# remove shared library and headers

To install this library into other locations, pass appropriate value to cmake using CMAKE_INSTALL_PREFIX variable like this:

cmake .. -DCMAKE_INSTALL_PREFIX=/usr [-DCMAKE_BUILD_TYPE=Release]
sudo make install		# install to path specified by CMAKE_INSTALL_PREFIX
sudo make uninstall		# remove shared library and headers from path specified by CMAKE_INSTALL_PREFIX

Build packages

...
cmake .. -DCPACK_GENERATOR="$GEN" -DCMAKE_INSTALL_PREFIX=/usr [-DCMAKE_BUILD_TYPE=Release]
make -j$(nproc) package

where $GEN is a type of package generator and can be: RPM or DEB.

CMAKE_INSTALL_PREFIX must be set to a destination where packages will be installed.

Out-of-source builds

If the standard build does not suit your needs, create your own out-of-source build and run tests like this:

cd ~
mkdir mybuild
cd mybuild
cmake ~/pmemstream  # this directory should contain the source code of pmemstream
make -j$(nproc)
make test           # or 'ctest --output-on-failure'