PMDK编译安装
系统环境:CentOS 7
依赖包
Linux:
-
autoconf
yum install autoconf -
pkg-config
首先新建一个目录pkg-config,然后下载pkg-config的包:
git clone git://anongit.freedesktop.org/pkg-config然后运行autogen.sh发现出错
image此时需要安装automake:
yum install automake直接
./autogen.sh遇到问题,查看README,里面说到了pkg-config依赖于glib,但是glib也依赖于pkg-config,所以增加一个参数:./autogen.sh --with-internal-glib编译再次遇到问题:这次是libtool没安装,所以安装libtool:
yum install libtoolOK现在执行
./autogen.sh --with-internal-glib即可image然后编译检查安装
make&&make check&&make install -
ndctl(60.1+)
下载安装包:
git clone https://github.com/pmem/ndctl.git./autogen.sh-
直接configure遇到点问题,提示遇到错误:
asciidoc needed to build documentation以及asciidoc needed to build documentation,所以首先安装这两个包:yum install asciidocyum install xmlto -
遇到问题,需要libkmod
git clone https://github.com/lucasdemarchi/kmod.git ./autogen.sh ./configure CFLAGS="-g -O2" --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib make&&make install -
需要libudev,安装过程及其蛋疼,解决:
$ export PKG_CONFIG_PATH=/usr/lib64/pkgconfig/:$PKG_CONFIG_PATH因为pkg-config默认的路径是/usr/lib,而libudev安装在/usr/lib64/pkgconfig,所以需要把这个路径添加到PKG_CONFIG_PATH里面去
这个设置在编译pmdk的时候也十分有用
-
安装uuid:
yum install uuid-devel注意是uuid-devel,centos里面加上devel是开发包,不加devel仍然会报错找不到uuid库
安装json-c:
yum install json-c-develmake
-
make check
imagepatch:需要打一个patch,https://patchwork.kernel.org/patch/9498041/
make clean&&make&&makecheck
make install
-
daxctl(60.1+)
在ndctl中已经安装好
libfabric(v1.4.2+)(仅在librpmem中需要)
PMDK
git clone https://github.com/pmem/pmdk.gitmakemake install(yum install doxygen)
Testing Libraries on Linux
/src/test/README:PMDK的单元测试在/src/test目录下面,单元测试需要一个testconfig.sh,这个文件描述了一些配置信息(比如去哪找PM)
RUNTEST脚本会运行所有的单元测试
make testcp testconfig.sh.example testconfig.sh...edit testconfig.sh and modify as appropriate
RUNTEST [testname](默认运行所有,可选择指定某个test)


