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.
Note: We recommend installing NDCTL first so PMDK builds all features. If the ndctl development packages and header files are not installed, PMDK will build successfully, but will disable some of the RAS (Reliability, Availability and Serviceability) features.
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
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.
Clone the PMDK GitHub Repository
The following uses the git
utility to clone the repository.
Alternatively you may download the source code as a zip file from the GitHub website.
Compile
To build the master branch run the make
utility in the root directory:
If you want to compile with a different compiler, you have to provide the CC
and CXX
variables. For example:
These variables are independent and setting CC=clang
does not set CXX=clang++
.
If the make
command returns an error similar to the following, this is caused by pkg-config being unable to find the required "libndctl.pc" file.
This can occur when libndctl was installed in a directory other than the /usr location.
To resolve this issue, the PKG_CONFIG_PATH is a environment variable that specifies additional paths in which pkg-config will search for its .pc files.
This variable is used to augment pkg-config's default search path. On a typical Unix system, it will search in the directories /usr/lib/pkgconfig and /usr/share/pkgconfig. This will usually cover system installed modules. However, some local modules may be installed in a different prefix such as /usr/local. In that case, it's necessary to prepend the search path so that pkg-config can locate the .pc files.
The pkg-config program is used to retrieve information about installed libraries in the system. The primary use of pkg-config is to provide the necessary details for compiling and linking a program to a library. This metadata is stored in pkg-config files. These files have the suffix .pc and reside in specific locations known to the pkg-config tool.
To check the PKG_CONFIG_PATH value use this command:
$ echo $PKG_CONFIG_PATH
To set the PKG_CONFIG_PATH value use:
Now execute the make
command again.
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:
To install this library into other locations, you can use the prefix=path
option, e.g:
If 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:
Last updated