Building NDCTL Utilities from Source: A Comprehensive Guide

Building NDCTL Utilities from Source: A Comprehensive Guide

Building NDCTL with Meson on Ubuntu 24.04

The NDCTL package includes the cxl, daxctl, and ndctl utilities. It uses the Meson build system for streamlined compilation. This guide reflects the modern build process for managing NVDIMMs, CXL, and PMEM on Ubuntu 24.04.

If you do not install a more recent Kernel than the one provided by the distro, then it is not recommended to compile these utilities from source code. If you have installed a mainline Kernel, then you will likely require a newer version of these utilities that are compatible with your Kernel. See the NDCTL Releases as the Kernel support information is provided there.

Here is the support matrix as of ndctl Version 81 and Kernel 6.14:

NDCTL VersionLinux Kernel Version
v816.14
v806.11
v796.9
v786.5
v776.3
v76.16.2
v766.2
v756.1
v74.16.0
v735.19
v72.15.17

Prerequisites

Use the following steps to install the prerequisite packages before we start the build and compile phase.

  1. System Update:

    sudo  apt update && sudo apt upgrade -y
    
  2. Core Build Tools:

    sudo  apt install -y git meson ninja-build pkg-config automake autoconf
    
  3. Libraries and Tools:

    sudo  apt install -y  asciidoc asciidoctor ruby-asciidoctor xmlto libtool  libkmod-dev libsystemd-dev libudev0 libudev-dev uuid-dev libjson-c-dev libkeyutils-dev libinih-dev bash-completion keyutils libkeyutils-dev libiniparser-dev libtraceevent-dev libtracefs-dev
    

Step 1: Clone the Repository

git clone https://github.com/pmem/ndctl.git && cd ndctl

Step 2: Configure with Meson

Create a build directory and configure:

meson setup build

Step 3: Compile the Code

Build using Ninja (Meson’s backend):

meson compile -C build

Step 4: Install Binaries (Optional)

sudo meson install -C build

If you choose not to install the binaries, the individual commands can be found in the ndctl/build/<cmd> directory, ie:

  • cxl: ~/ndctl/build/cxl/cxl
  • ndctl: ~/ndctl/build/ndctl/ndctl
  • daxctl: ~/ndctl/build/daxctl/daxctl

Step 5: Verify Installation

cxl --version

Troubleshooting

Build Errors:

Should you encounter any issues during the configure or build processes, you clean and rebuild using rm -rf build && meson setup build.

How To Enable Debug Logging in ipmctl

How To Enable Debug Logging in ipmctl

The ipmctl utility is used for configuring and managing Intel Optane Persistent Memory modules (DCPMM/PMem). It supports the functionality to:

  • Discover Persistent Memory on the server
  • Provision the persistent memory configuration
  • View and update the firmware on the persistent memory modules
  • Configure data-at-rest security
  • Track health and performance of the persistent memory modules
  • Debug and troubleshoot persistent memory modules

I wrote the IPMCTL User Guide showing how to use the tool, but what if ipmctl returns an error or something you’re not expecting? How do you debug the debugger? On Linux, ipmctl relies on libndctl to help perform communication to the BIOS and persistent memory modules themselves. This is a complicated stack involving multiple kernel drivers and the physical hardware itself. Anything along this path could be causing a problem.

Read More
How To Install and Boot Microsoft Windows Server 2019 from Persistent Memory

How To Install and Boot Microsoft Windows Server 2019 from Persistent Memory

In a previous post  I described how to install and boot Fedora Linux using only Persistent Memory, no SSDs are required. For this follow on post, I attempted to install Microsoft Windows Server 2019 and 2022 onto the persistent memory.

TL;DR - I was able to select the PMem devices as the install disk, but when the installer begins to write data, we get an “Error code: 0xC0000005”. I haven’t found a solution to this problem (yet).

Read More
The Library Landscape: Why Build Another One?

The Library Landscape: Why Build Another One?

Series: Building lib3mf-rs

This post is part of a 5-part series on building a comprehensive 3MF library in Rust:

  1. Part 1: My Journey Building a 3MF Native Rust Library from Scratch
  2. Part 2: The Library Landscape - Why Build Another One?
  3. Part 3: Into the 3MF Specification Wilderness - Reading 1000+ Pages of Specifications
  4. Part 4: Design for Developers - Features, Flags, and the CLI
  5. Part 5: Reflections and What’s Next - Lessons from Building lib3mf-rs

“Why not just use the existing library?”

It’s a fair question. One I asked myself many times during the early days of this project. The 3MF Consortium maintains lib3MF , a comprehensive C++ implementation used by major companies in additive manufacturing. Why build another one?

Read More