Installing PMDK from Source on Linux
Overview
This procedure describes how to clone the source code from the pmdk github repository and compile, then install it.
If your system is behind a firewall and requires a proxy to access the Internet, configure your package manager to use a proxy.
Install Prerequisites
To build the PMDK libraries on Linux, you may need to install the following required packages on the build system:
autoconf
automake
gcc
gcc-c++
glib2-devel
libfabric-devel
pandoc
pkg-config
ncurses-devel
$ sudo dnf install autoconf automake pkg-config glib2-devel libfabric-devel pandoc ncurses-develSome of the required packages can be found in the EPEL repository. Verify the EPEL repository is active:
$ sudo yum repolistIf the EPEL repository is not listed, install and activate it using:
$ sudo yum -y install epel-releaseTo install the prerequisite packages, run:
$ sudo yum install autoconf automake pkgconfig glib2-devel libfabric-devel pandoc ncurses-develFor Ubuntu 18.04 (Bionic) or Debian 9 (Stretch) or later
$ sudo apt install autoconf automake pkg-config libglib2.0-dev libfabric-dev pandoc libncurses5-devFor Ubuntu 16.04 (Xenial) and Debian 8 (Jessie):
$ sudo apt install autoconf automake pkg-config libglib2.0-dev pandoc libncurses5-dev****
To build and test the PMDK library on FreeBSD, you may need to install the following required packages on the build system:
autoconf
bash
binutils
coreutils
e2fsprogs-libuuid
gmake
glib2
glib2-devel
libunwind
ncurses*
pandoc
pkgconf
$ sudo pkg install autoconf automake bash coreutils e2fsprogs-libuuid glib2 glib2-devel gmake libunwind pandoc ncurses pkg-config(*) The pkg version of ncurses is required for proper operation; the base version included in FreeBSD is not sufficient.
The git utility is required to clone the repository or you can download the source code as a zip file directly from the repository on GitHub.
Optional Prerequisites
The following packages are required only by selected PMDK components or features. If not present, those components or features may not be available:
libfabric (v1.4.2 or later) -- required by librpmem
libndctl and libdaxctl (v60.1 or later) -- required by daxio and RAS features. See Installing NDCTL
To build pmdk without ndctl support, set 'NDCTL_ENABLE=n' using:
$ export NDCTL_ENABLE=n
Compiler Requirements
A C/C++ Compiler is required. GCC/G++ will be used in this documentation but you may use a different compiler then set the CC and CXX shell environments accordingly.
$ sudo dnf install gcc gcc-c++$ sudo yum install gcc gcc-c++$ sudo apt install gcc g++Clone the PMDK GitHub Repository
The following uses the git utility to clone the repository.
$ git clone https://github.com/pmem/pmdk
$ cd pmdkAlternatively you may download the source code as a zip file from the GitHub website.
$ wget https://github.com/pmem/pmdk/archive/master.zip
$ unzip master.zip
$ cd pmdk-masterCompile
To build the master branch run the make utility in the root directory:
$ makeIf you want to compile with a different compiler, you have to provide the CC and CXXvariables. For example:
$ make CC=clang CXX=clang++These variables are independent and setting CC=clang does not set CXX=clang++.
Install
Installing the library is more convenient since it installs man pages and libraries in the standard system locations.
To install the libraries to the default /usr/local location:
$ sudo make installTo install this library into other locations, you can use the prefix=path option, e.g:
$ sudo make install prefix=/usrIf you installed to non-standard directory (anything other than /usr) you may need to add $prefix/lib or $prefix/lib64 (depending on the distribution you use) to the list of directories searched by the linker:
sudo sh -c "echo /usr/local/lib >> /etc/ld.so.conf"
sudo sh -c "echo /usr/local/lib64 >> /etc/ld.so.conf"
sudo ldconfigLast updated