PMDK (Persistent Memory Development Kit) 是英特尔持久内存的开发工具集,以便开发者开发适用于非易失性持久内存的应用程序。PMDK 在 Linux 上安装稍微有点点复杂,本文根据我的踩坑经验总结了一波安装过程。(本文基于 CentOS)

首先需要安装 epel-release:

1
2
yum install epel-release
yum config-manager --set-enabled PowerTools

然后安装一堆编译依赖、编译工具和文档工具:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
yum install cmake
yum install gcc-c++
yum install autoconf
yum install libtool
yum install glibc glibc-static
yum install ruby
gem install asciidoctor
yum install gtk2 gtk2-devel gtk2-devel-docs gtk-doc
yum install uuid-devel
yum install json-c-devel
yum install libudev-dev
yum install systemd-devel
yum install doxygen
yum install pandoc
yum install ndctl-devel
yum install keyutils-libs-devel

安装 kmod

1
2
3
4
5
git clone https://github.com/lucasdemarchi/kmod.git
cd kmod
./autogen.sh
./configure CFLAGS="-g -O2" --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
make && make install

安装 pkg-config

1
2
3
4
5
6
7
wget https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
tar -zxvf pkg-config-0.29.2.tar.gz
cd pkg-config-0.29.2
./configure --with-internal-glib
make
make check
make install

这里有个很有意思的操作,需要手工指定下 pkgconfig 的位置,不然后续编译会出问题

1
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig/:$PKG_CONFIG_PATH

编译安装 Ndctl:

1
2
3
4
5
6
git clone https://github.com/pmem/ndctl.git
cd ndctl
./autogen.sh
./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64
make
make install

编译安装 pmdk:

1
2
3
4
git clone https://github.com/pmem/pmdk.git
cd pmdk
make
make install

大功告成,测试一下下哦