Chendi Xue

I am linux software engineer, currently working on Spark, Arrow, Kubernetes, Ceph, c/c++, and etc.

Persisten Memory Development Kit(PMDK) Notes 1: How to install

10 Oct 2018 » PMDK

This blog records all my steps of building PMDK, PMDK C++ API(libpmemobj++), PMDK JAVA API(llpl) on Centos 7.3. If you want to have a rampup of what PMDK is, and how it works, please refer to PMDK Notes 0: what it is and quick examples


PMDK Installation github page

step1: PREREQUISITES TO BUILD

  • autoconf
yum install -y autoconf
yum install -y asciidoctor 
  • pkg-configure
yum groupinstall -y "Development Tools"
  • libndctl-devel (v60.1 or later), libdaxctl-devel (v60.1 or later), ndctl (v60.1 or later)
git clone https://github.com/pmem/ndctl.git
cd ndctl
git checkout v63

yum install -y acsciidoctor
yum install -y kmod-devel.x86_64
yum install -y libudev-devel
yum install -y libuuid-devel
yum install -y json-c-devel
yum install -y jemalloc-devel

./autogen.sh
./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64
make -j
make check
make install
cd ..

step2: PMDK INSTALLATION

yum install -y pandoc
git clone https://github.com/pmem/pmdk.git
cd pmdk
git checkout tags/1.8
make -j
make install
export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig/:$PKG_CONFIG_PATH
cd ..

libpmemobj++ Installation github page

srep1: PREREQUISITES TO BUILD

wget https://cmake.org/files/v3.13/cmake-3.13.0-rc1.tar.gz
tar zxf cmake-3.13.0-rc1.tar.gz
cd cmake-3.13.0-rc1/
./bootstrap
make -j
make install
cd ..

cmake --version
cmake version 3.13.0-rc1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
  • upgrade gcc/g++ to 5.3
sudo yum install -y centos-release-scl
sudo yum install devtoolset-4-gcc*
scl enable devtoolset-4 bash
gcc --version
  • Persistent Memory Development Kit (PMDK)

step2: COMPILE Libpmemobj++

git clone https://github.com/pmem/libpmemobj-cpp.git
cd libpmemobj-cpp/
git checkout 1.5-rc1
mkdir build
cd build
cmake ..
make -j
make install
cd ../..
  • Some may happen issue fixing
-- Checking for module 'libpmemobj>=1.4'
--   No package 'libpmemobj' found

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

llpl(Low Level Persistence Library)JAVA Lib Installation github page

step1: PREREQUISITES TO BUILD

  • Persistent Memory Development Kit (PMDK)
  • Java 8 or above
java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
  • Build tools - g++ compiler and make
g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)

step2: BUILD AND RUN

  • compile
git clone https://github.com/pmem/llpl.git
cd llpl/
make -j
  • mount a EMULATING PERSISTENT MEMORY or PERSISTENT MEMORY and run tests

[Pmem official doc: How to emulate Persistent Memory]https://pmem.io/2016/02/22/pm-emulation.html

# sudo vi /etc/default/grub
GRUB_CMDLINE_LINUX="memmap=60G!4G"  #60G is pmem size, 4G is start offset
On BIOS-based machines:
# sudo grub2-mkconfig -o /boot/grub2/grub.cfg
On UEFI-based machines:
# sudo grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg

# REBOOT system

sudo mkdir /mnt/mem
sudo mkfs.xfs /dev/pmem0
sudo mount -o dax /dev/pmem0 /mnt/mem
make tests
cd ..