文章目录
- 1.安装前的准备
- 2.安装说明
- 3.安装PMDK库
- 4.安装ndctl库
- 5.管理持久内存PM的工具-ipmctl 和 ndctl
- 6.模拟持久内存
1.安装前的准备
安装前需要保证yum是可用状态
- 若服务器能访问阿里云镜像,可以参考中yum源配置
yum repolist
yum makecache
执行上述命令不会报错
2.安装说明
PMDK库安装依赖ndctl,ndctl依赖autoconf和pkg-config等库,如果安装过程中缺少相应依赖,需要参考以下命令的执行方式去安装依赖包
yum install -y bash-completion*
yum install -y json-c*
yum install -y libudev*
- autoconf库缺失
which autoconf若有,则不需要安装,若无,则执行以下命令进行安装
yum install autoconf* -y
- pkg-config库缺失
which pkg-config若有,则不需要安装,若无,则执行以下命令进行安装
首先新建一个目录pkg-config,然后下载pkg-config的包:
git clone git://anongit.freedesktop.org/pkg-config
然后运行autogen.sh发现出错
此时需要安装automake:yum install automake
直接./autogen.sh遇到问题,查看README,里面说到了pkg-config依赖于glib,
但是glib也依赖于pkg-config,所以增加一个参数:./autogen.sh --with-internal-glib
编译再次遇到问题:这次是libtool没安装,所以安装libtool:yum install libtool*
最后执行以下命令
./autogen.sh --with-internal-glib
make&&make check&&make install
3.安装PMDK库
yum无法直接安装PMDK库,所以执行源码级方式安装:
git clone https://github.com/pmem/pmdk.git
执行make命令报错:Unable to locate package libndctl-devel,所以先得参照4.安装ndctl库进行安装
make
make install
Testing Libraries on Linux
- PMDK的单元测试在/src/test目录下面,单元测试需要一个testconfig.sh,这个文件描述了一些配置信息(比如去哪找PM)
make test
cp -f testconfig.sh.example testconfig.sh
...edit testconfig.sh and modify as appropriate
cd src/test
RUNTEST [testname] (默认运行所有,可选择指定某个test)
4.安装ndctl库
如果能使用yum直接安装,则可以执行
yum install -y ndctl*
否则执行以下方式:
git clone https://github.com/pmem/ndctl.git
./autogen.sh
已经安装asciidoc库了,但是执行以下提示构建命令还报错,参考readme文件进行修改命令,如下:
./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 enable_asciidoctor=no
make;make check;make install
源码级安装过程中遇到的问题如下:
- 需要libkmod
yum install -y kmod*
- 需要libudev
不需要去解决PKG_CONFIG_PATH什么环境变量问题
yum install -y udev*
- 需要uuid
yum install uuid* -y
- 需要json-c
yum install json-c* -y
- make编译失败
…/acpi.h:9:1: error: initializer element is not constant,这应该是源码的bug
将acpi.h文件中
static const uuid_le uuid_pmem = UUID_LE(0x66f0d379, 0xb4f3, 0x4074, 0xac, 0x43, 0x0d,
0x33, 0x18, 0xb7, 0x8c, 0xdb);
修改为:
#define uuid_pmem UUID_LE(0x66f0d379, 0xb4f3, 0x4074, 0xac, 0x43, 0x0d,\
0x33, 0x18, 0xb7, 0x8c, 0xdb)
5.管理持久内存PM的工具-ipmctl 和 ndctl
ipmctl是一个管理实用程序工具,旨在专门与持久内存英特尔® 傲腾™工作。一些管理功能包括:
- 探索和管理模块
- 配置平台配置 - 内存或 App Direct
- 查看和更新模块固件
- 监控运行状况
- 跟踪性能
- 调试和故障排除
ndctl是一款仅支持 Linux 的管理实用程序工具,设计用于持久内存技术。一些管理功能包括:
- 显示模块信息
- 管理名称空间和配置标签
- 监控运行状况
- 管理安全性 - Passphrases 和安全擦除
- 注入/测试错误
- 实际用法见:持久内存入门篇之8.管理持久内存PM的工具
如果能yum安装,则不建议使用源码级安装
yum install -y ipmctl*
ipmctl源码级安装
ipmctl安装
https://github.com/intel/ipmctl
mkdir output && cd output
cmake -DRELEASE=ON -DCMAKE_INSTALL_PREFIX=/usr ..
make -j all-------------ipmctl可能依赖asciidoctor和sciidoctor-pdf,需要安装
sudo make install
安装完毕后,发现其安装目录居然是:
/home/homedir/ipmctl/bin/ipmctl
如果在其他bash中能使用ipmctl,则不需要做如下操作
ln -s /home/homedir/ipmctl/bin/ipmctl /usr/local/bin/ipmctl
vim /etc/ld.so.conf添加动态库的搜索路径/home/homedir/ipmctl/lib64/(方法很多)
ldconfig
asciidoctor和sciidoctor-pdf安装
下载git代码,其对应的的命令已经在目录bin下了,所以直接添加到PATH中即可
https://github.com/asciidoctor/asciidoctor
https://github.com/asciidoctor/asciidoctor-pdf
vim ~/.bashrc
export PATH=$PATH:/home/wangji/PMDK/asciidoctor-main/bin/:/home/wangji/PMDK/asciidoctor-pdf-main/bin/:/home/homedir/ipmctl/bin/ipmctl
source ~/.bashrc
6.模拟持久内存
持久内存入门篇之使用内存(DRAM)模拟持久化内存(Persistent Memory)
- 参考:PMDK编译安装,PMDK 安装,Ubuntu 16.04部署PMDK,适用于持久内存的 ipmctl 和 ndctl 英特尔® 傲腾™实用程序,Ubuntu 18.04安装英特尔Optane DC Persistent Memory Module配置工具ipmctl