Toolchain#

The toolchain (compiler, archiver, and linker) used for building xNVMe must support C11, pthreads and on the system the following tools must be available:

  • Python (>=3.7)

  • meson (>=0.58) and matching version of ninja

  • make (gmake)

  • gcc/mingw/clang

Along with libraries:

  • glibc (>= 2.28, for io_uring/liburing)

  • libaio-dev (>=0.3, For xNVMe and SPDK)

  • libnuma-dev (>=2, For SPDK)

  • libssl-dev (>=1.1, For SPDK)

  • liburing (>=2.2, for xNVMe)

  • uuid-dev (>=2.3, For SPDK)

xNVMe makes use of libraries and interfaces when available and will “gracefully degrade” when a given library is not available. For example, if liburing is not available on your system and you do not want to install it, then xNVMe will simply build without io_uring-support.

The preferred toolchain is gcc and the following sections describe how to install it and required libraries on a set of popular Linux Distributions, FreeBSD, MacOS, and Windows.

In the following sections, the system package-manager is used whenever possible to install the toolchain and libraries. However, on some Linux distribution there are not recent enough versions. To circumvent that, then the packages are installed via the Python package-manager. In some cases even a recent enough version of Python is not available, to bootstrap it, then Python is built and installed from source.

Note

When installing packages via the Python package-manager (python3 -m pip install), then packages should be installed system-wide. This is ensure that the installed packages behave as though they were installed using the system package-manager.

Package-managers: apk, pkg, dnf, yum, pacman, apt, aptitude, apt-get, pkg, choco, brew.

Alpine Linux (latest)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/alpine-latest.sh

Or, run the commands contained within the script manually:

# Install packages via the system package-manager (apk)
apk add \
 bash \
 bsd-compat-headers \
 build-base \
 clang15-extra-tools \
 coreutils \
 cunit \
 findutils \
 gawk \
 git \
 libaio-dev \
 libarchive-dev \
 liburing-dev \
 libuuid \
 linux-headers \
 make \
 meson \
 musl-dev \
 nasm \
 ncurses \
 numactl-dev \
 openssl-dev \
 patch \
 perl \
 pkgconf \
 py3-pip \
 python3 \
 python3-dev \
 util-linux-dev

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

# Install packages via the Python package-manager (pip)
python3 -m pip install --upgrade pip
python3 -m pip install \
 pipx

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-alpine-latest:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe with SPDK and libvfn disabled
meson setup builddir -Dwith-spdk=false

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Note

There are issues with SPDK/DPDK due to incompatibilities with the standard library provided by musl libc. Additionally, the libexecinfo-dev package is no longer available on Alpine. Additionally, libvfn also relies on libexecinfo-dev which is currently not available for Alpine Linux. Thus, it is also disabled. Pull-request fixing these issues are most welcome, until then, disable libvfn and spdk on Alpine.

Arch Linux (latest)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/archlinux-latest.sh

Or, run the commands contained within the script manually:

# Install packages via the system package-manager (pacman)
pacman -Syyu --noconfirm
pacman -S --noconfirm \
 base-devel \
 bash \
 clang \
 cunit \
 findutils \
 git \
 libaio \
 libarchive \
 liburing \
 libutil-linux \
 make \
 meson \
 nasm \
 ncurses \
 numactl \
 openssl \
 patch \
 pkg-config \
 python-pip \
 python-pipx \
 python-pyelftools \
 python-setuptools \
 python3 \
 util-linux-libs

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

#
# Clone, build and install libisal
#
# Assumptions:
#
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/intel/isa-l.git toolbox/third-party/libisal/repository

pushd toolbox/third-party/libisal/repository
git checkout v2.30.0
./autogen.sh
./configure --prefix=/usr --libdir=/usr/lib
make
make install
popd

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-archlinux-latest:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir --prefix=/usr

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Note

The build is configured to install with --prefix=/usr this is intentional such the the pkg-config files end up in the default search path on the system. If you do not want this, then remove --prefix=/usr and adjust your $PKG_CONFIG_PATH accordingly.

Oracle Linux 9 (9)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/oraclelinux-9.sh

Or, run the commands contained within the script manually:

# This repo has CUnit-devel + meson
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled ol9_codeready_builder

# Install packages via the system package-manager (dnf)
dnf install -y \
 CUnit-devel \
 autoconf \
 bash \
 clang-tools-extra \
 diffutils \
 findutils \
 gcc \
 gcc-c++ \
 git \
 libaio-devel \
 libarchive-devel \
 libtool \
 libuuid-devel \
 make \
 meson \
 nasm \
 ncurses \
 numactl-devel \
 openssl-devel \
 patch \
 pkgconfig \
 procps \
 python3-devel \
 python3-pip \
 python3-pyelftools \
 unzip \
 wget \
 zlib-devel

# Install packages via the Python package-manager (pip)
python3 -m pip install --upgrade pip
python3 -m pip install \
 pipx

#
# Clone, build and install libisal
#
# Assumptions:
#
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/intel/isa-l.git toolbox/third-party/libisal/repository

pushd toolbox/third-party/libisal/repository
git checkout v2.30.0
./autogen.sh
./configure --prefix=/usr --libdir=/usr/lib64
make
make install
popd

# Clone, build and install liburing v2.2
#
# Assumptions:
#
# - Dependencies for building liburing are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/axboe/liburing.git toolbox/third-party/liburing/repository

pushd toolbox/third-party/liburing/repository
git checkout liburing-2.2
./configure --libdir=/usr/lib64 --libdevdir=/usr/lib64
make
make install
popd

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-oraclelinux-9:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir --prefix=/usr

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Rocky Linux 9.2 (9.2)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/rockylinux-9.2.sh

Or, run the commands contained within the script manually:

# This repo has CUnit-devel + meson
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled crb

# Install packages via the system package-manager (dnf)
dnf install -y \
 CUnit-devel \
 autoconf \
 bash \
 clang-tools-extra \
 diffutils \
 findutils \
 gcc \
 gcc-c++ \
 git \
 libaio-devel \
 libarchive-devel \
 libtool \
 libuuid-devel \
 make \
 meson \
 nasm \
 ncurses \
 numactl-devel \
 openssl-devel \
 patch \
 pkgconfig \
 procps \
 python3-devel \
 python3-pip \
 python3-pyelftools \
 unzip \
 wget \
 zlib-devel

# Install packages via the Python package-manager (pip)
python3 -m pip install --upgrade pip
python3 -m pip install \
 pipx

#
# Clone, build and install libisal
#
# Assumptions:
#
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/intel/isa-l.git toolbox/third-party/libisal/repository

pushd toolbox/third-party/libisal/repository
git checkout v2.30.0
./autogen.sh
./configure --prefix=/usr --libdir=/usr/lib64
make
make install
popd

# Clone, build and install liburing v2.2
#
# Assumptions:
#
# - Dependencies for building liburing are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/axboe/liburing.git toolbox/third-party/liburing/repository

pushd toolbox/third-party/liburing/repository
git checkout liburing-2.2
./configure --libdir=/usr/lib64 --libdevdir=/usr/lib64
make
make install
popd

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-rockylinux-9.2:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir --prefix=/usr

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

CentOS Stream 9 (stream9)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/centos-stream9.sh

Or, run the commands contained within the script manually:

# This repos has CUnit-devel
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled crb

# Install packages via the system package-manager (dnf)
dnf install -y \
 CUnit-devel \
 autoconf \
 bash \
 diffutils \
 findutils \
 gcc \
 gcc-c++ \
 git \
 libaio-devel \
 libarchive-devel \
 libtool \
 libuuid-devel \
 make \
 nasm \
 ncurses \
 numactl-devel \
 openssl-devel \
 patch \
 pkgconfig \
 procps \
 python3-devel \
 python3-pip \
 unzip \
 wget \
 zlib-devel

# Install packages via the Python package-manager (pip)
python3 -m pip install --upgrade pip # Otherwise too old to understand new Manylinux formats
python3 -m pip install \
 meson \
 ninja \
 pipx \
 pyelftools

#
# Clone, build and install libisal
#
# Assumptions:
#
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/intel/isa-l.git toolbox/third-party/libisal/repository

pushd toolbox/third-party/libisal/repository
git checkout v2.30.0
./autogen.sh
./configure --prefix=/usr --libdir=/usr/lib64
make
make install
popd

# Clone, build and install liburing v2.2
#
# Assumptions:
#
# - Dependencies for building liburing are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/axboe/liburing.git toolbox/third-party/liburing/repository

pushd toolbox/third-party/liburing/repository
git checkout liburing-2.2
./configure --libdir=/usr/lib64 --libdevdir=/usr/lib64
make
make install
popd

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-centos-stream9:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir --prefix=/usr

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Debian Testing (trixie)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/debian-trixie.sh

Or, run the commands contained within the script manually:

# Unattended update, upgrade, and install
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
apt-get -qy update
apt-get -qy \
  -o "Dpkg::Options::=--force-confdef" \
  -o "Dpkg::Options::=--force-confold" upgrade
apt-get -qy --no-install-recommends install apt-utils
apt-get -qy autoclean
apt-get -qy install \
 autoconf \
 bash \
 build-essential \
 clang-format \
 findutils \
 git \
 libaio-dev \
 libarchive-dev \
 libcunit1-dev \
 libisal-dev \
 libncurses5-dev \
 libnuma-dev \
 libssl-dev \
 libtool \
 liburing-dev \
 make \
 meson \
 nasm \
 openssl \
 patch \
 pipx \
 pkg-config \
 python3 \
 python3-pip \
 python3-pyelftools \
 python3-venv \
 uuid-dev

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-debian-trixie:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Debian Stable (bookworm)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/debian-bookworm.sh

Or, run the commands contained within the script manually:

# Unattended update, upgrade, and install
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
apt-get -qy update
apt-get -qy \
  -o "Dpkg::Options::=--force-confdef" \
  -o "Dpkg::Options::=--force-confold" upgrade
apt-get -qy --no-install-recommends install apt-utils
apt-get -qy autoclean
apt-get -qy install \
 autoconf \
 bash \
 build-essential \
 clang-format \
 findutils \
 git \
 libaio-dev \
 libarchive-dev \
 libcunit1-dev \
 libisal-dev \
 libncurses5-dev \
 libnuma-dev \
 libssl-dev \
 libtool \
 liburing-dev \
 make \
 meson \
 nasm \
 openssl \
 patch \
 pipx \
 pkg-config \
 python3 \
 python3-pip \
 python3-pyelftools \
 python3-venv \
 uuid-dev

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-debian-bookworm:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Debian Oldstable (bullseye)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/debian-bullseye.sh

Or, run the commands contained within the script manually:

# Unattended update, upgrade, and install
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
apt-get -qy update
apt-get -qy \
  -o "Dpkg::Options::=--force-confdef" \
  -o "Dpkg::Options::=--force-confold" upgrade
apt-get -qy --no-install-recommends install apt-utils
apt-get -qy autoclean
apt-get -qy install \
 autoconf \
 bash \
 build-essential \
 clang-format \
 findutils \
 git \
 libaio-dev \
 libarchive-dev \
 libcunit1-dev \
 libisal-dev \
 libncurses5-dev \
 libnuma-dev \
 libssl-dev \
 libtool \
 make \
 nasm \
 openssl \
 patch \
 pkg-config \
 python3 \
 python3-pip \
 python3-pyelftools \
 python3-venv \
 uuid-dev

# Install packages via the Python package-manager (pip)
python3 -m pip install --upgrade pip
python3 -m pip install \
 meson \
 ninja \
 pipx

# Clone, build and install liburing v2.2
#
# Assumptions:
#
# - Dependencies for building liburing are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/axboe/liburing.git toolbox/third-party/liburing/repository

pushd toolbox/third-party/liburing/repository
git checkout liburing-2.2
./configure
make
make install
popd

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-debian-bullseye:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Fedora (38)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/fedora-38.sh

Or, run the commands contained within the script manually:

# Install packages via the system package-manager (dnf)
dnf install -y \
 CUnit-devel \
 autoconf \
 bash \
 clang-tools-extra \
 diffutils \
 findutils \
 g++ \
 gcc \
 git \
 libaio-devel \
 libarchive-devel \
 libtool \
 liburing \
 liburing-devel \
 libuuid-devel \
 make \
 meson \
 nasm \
 ncurses \
 numactl-devel \
 openssl-devel \
 patch \
 pipx \
 pkgconfig \
 procps \
 python3-devel \
 python3-pip \
 python3-pyelftools \
 zlib-devel

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

#
# Clone, build and install libisal
#
# Assumptions:
#
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/intel/isa-l.git toolbox/third-party/libisal/repository

pushd toolbox/third-party/libisal/repository
git checkout v2.30.0
./autogen.sh
./configure --prefix=/usr --libdir=/usr/lib
make
make install
popd

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-fedora-38:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir --prefix=/usr

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Fedora (37)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/fedora-37.sh

Or, run the commands contained within the script manually:

# Install packages via the system package-manager (dnf)
dnf install -y \
 CUnit-devel \
 autoconf \
 bash \
 clang-tools-extra \
 diffutils \
 findutils \
 g++ \
 gcc \
 git \
 libaio-devel \
 libarchive-devel \
 libtool \
 liburing \
 liburing-devel \
 libuuid-devel \
 make \
 meson \
 nasm \
 ncurses \
 numactl-devel \
 openssl-devel \
 patch \
 pipx \
 pkgconfig \
 procps \
 python3-devel \
 python3-pip \
 python3-pyelftools \
 zlib-devel

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

#
# Clone, build and install libisal
#
# Assumptions:
#
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/intel/isa-l.git toolbox/third-party/libisal/repository

pushd toolbox/third-party/libisal/repository
git checkout v2.30.0
./autogen.sh
./configure --prefix=/usr --libdir=/usr/lib
make
make install
popd

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-fedora-37:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir --prefix=/usr

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Fedora (36)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/fedora-36.sh

Or, run the commands contained within the script manually:

# Install packages via the system package-manager (dnf)
dnf install -y \
 CUnit-devel \
 autoconf \
 bash \
 clang-tools-extra \
 diffutils \
 findutils \
 g++ \
 gcc \
 git \
 libaio-devel \
 libarchive-devel \
 libtool \
 libuuid-devel \
 make \
 meson \
 nasm \
 ncurses \
 numactl-devel \
 openssl-devel \
 patch \
 pipx \
 pkgconfig \
 procps \
 python3-devel \
 python3-pip \
 python3-pyelftools \
 zlib-devel

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

#
# Clone, build and install libisal
#
# Assumptions:
#
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/intel/isa-l.git toolbox/third-party/libisal/repository

pushd toolbox/third-party/libisal/repository
git checkout v2.30.0
./autogen.sh
./configure --prefix=/usr --libdir=/usr/lib64
make
make install
popd

# Clone, build and install liburing v2.2
#
# Assumptions:
#
# - Dependencies for building liburing are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/axboe/liburing.git toolbox/third-party/liburing/repository

pushd toolbox/third-party/liburing/repository
git checkout liburing-2.2
./configure --libdir=/usr/lib64 --libdevdir=/usr/lib64
make
make install
popd

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-fedora-36:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir --prefix=/usr

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Ubuntu Latest (lunar)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/ubuntu-lunar.sh

Or, run the commands contained within the script manually:

# Unattended update, upgrade, and install
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
apt-get -qy update
apt-get -qy \
  -o "Dpkg::Options::=--force-confdef" \
  -o "Dpkg::Options::=--force-confold" upgrade
apt-get -qy --no-install-recommends install apt-utils
apt-get -qy autoclean
apt-get -qy install \
 autoconf \
 bash \
 build-essential \
 clang-format \
 findutils \
 git \
 libaio-dev \
 libarchive-dev \
 libcunit1-dev \
 libisal-dev \
 libncurses5-dev \
 libnuma-dev \
 libssl-dev \
 libtool \
 liburing-dev \
 make \
 meson \
 nasm \
 openssl \
 patch \
 pipx \
 pkg-config \
 python3 \
 python3-pip \
 python3-pyelftools \
 python3-venv \
 uuid-dev

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-ubuntu-lunar:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Note

All tools and libraries are available via system package-manager.

Ubuntu LTS (jammy)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/ubuntu-jammy.sh

Or, run the commands contained within the script manually:

# Unattended update, upgrade, and install
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
apt-get -qy update
apt-get -qy \
  -o "Dpkg::Options::=--force-confdef" \
  -o "Dpkg::Options::=--force-confold" upgrade
apt-get -qy --no-install-recommends install apt-utils
apt-get -qy autoclean
apt-get -qy install \
 autoconf \
 bash \
 build-essential \
 clang-format \
 findutils \
 git \
 libaio-dev \
 libarchive-dev \
 libcunit1-dev \
 libisal-dev \
 libncurses5-dev \
 libnuma-dev \
 libssl-dev \
 libtool \
 make \
 nasm \
 openssl \
 patch \
 pipx \
 pkg-config \
 python3 \
 python3-pip \
 python3-pyelftools \
 python3-venv \
 uuid-dev

# Install packages via the Python package-manager (pip)
python3 -m pip install --upgrade pip
python3 -m pip install \
 meson \
 ninja

# Clone, build and install liburing v2.2
#
# Assumptions:
#
# - Dependencies for building liburing are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/axboe/liburing.git toolbox/third-party/liburing/repository

pushd toolbox/third-party/liburing/repository
git checkout liburing-2.2
./configure
make
make install
popd

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-ubuntu-jammy:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Note

Installing liburing from source and meson + ninja via pip

Ubuntu LTS (focal)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/ubuntu-focal.sh

Or, run the commands contained within the script manually:

# Unattended update, upgrade, and install
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
apt-get -qy update
apt-get -qy \
  -o "Dpkg::Options::=--force-confdef" \
  -o "Dpkg::Options::=--force-confold" upgrade
apt-get -qy --no-install-recommends install apt-utils
apt-get -qy autoclean
apt-get -qy install \
 autoconf \
 bash \
 build-essential \
 clang-format \
 findutils \
 git \
 libaio-dev \
 libarchive-dev \
 libcunit1-dev \
 libisal-dev \
 libncurses5-dev \
 libnuma-dev \
 libssl-dev \
 libtool \
 make \
 nasm \
 openssl \
 patch \
 pipx \
 pkg-config \
 python3 \
 python3-pip \
 python3-pyelftools \
 python3-venv \
 uuid-dev

# Install packages via the Python package-manager (pip)
python3 -m pip install --upgrade pip
python3 -m pip install \
 meson \
 ninja

# Clone, build and install liburing v2.2
#
# Assumptions:
#
# - Dependencies for building liburing are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/axboe/liburing.git toolbox/third-party/liburing/repository

pushd toolbox/third-party/liburing/repository
git checkout liburing-2.2
./configure
make
make install
popd

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-ubuntu-focal:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Note

Installing liburing from source and meson + ninja via pip

Gentoo (latest)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/gentoo-latest.sh

Or, run the commands contained within the script manually:

echo ""
echo "build requires linking against ncurses AND tinfo, run the following before compilation:"
echo "export LDFLAGS=\"-ltinfo -lncurses\""

emerge-webrsync
emerge \
 app-arch/libarchive \
 bash \
 dev-build/meson \
 dev-lang/nasm \
 dev-libs/isa-l \
 dev-libs/libaio \
 dev-libs/openssl \
 dev-python/pip \
 dev-python/pyelftools \
 dev-util/cunit \
 dev-util/pkgconf \
 dev-vcs/git \
 findutils \
 make \
 patch \
 sys-libs/liburing \
 sys-libs/ncurses \
 sys-process/numactl

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

# Install packages via the Python package-manager (pip)
python3 -m pip install --break-system-packages --upgrade pip
python3 -m pip install --break-system-packages \
 pipx

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-gentoo-latest:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

export LDFLAGS="-ltinfo -lncurses"

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir --prefix=/usr

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Note

In case you get error adding symbols: DSO missing from command line, during compilation, then add -ltinfo -lnurces to LDFLAGS as it is done in the commands above. The build is configured to install with --prefix=/usr this is intentional such the the pkg-config files end up in the default search path on the system. If you do not want this, then remove --prefix=/usr and adjust your $PKG_CONFIG_PATH accordingly.

openSUSE (tumbleweed-latest)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/opensuse-tumbleweed-latest.sh

Or, run the commands contained within the script manually:

zypper --non-interactive refresh

# Install packages via the system package-manager (zypper)
zypper --non-interactive install -y --allow-downgrade \
 autoconf \
 awk \
 bash \
 clang-tools \
 cunit-devel \
 findutils \
 gcc \
 gcc-c++ \
 git \
 gzip \
 libaio-devel \
 libarchive-devel \
 libnuma-devel \
 libopenssl-devel \
 libtool \
 liburing-devel \
 libuuid-devel \
 make \
 meson \
 nasm \
 ncurses \
 patch \
 pkg-config \
 python3 \
 python3-devel \
 python3-pip \
 python3-pipx \
 python3-pyelftools \
 python3-setuptools \
 tar

#
# Clone, build and install libvfn
#
# Assumptions:
#
# - Dependencies for building libvfn are met (system packages etc.)
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/SamsungDS/libvfn.git toolbox/third-party/libvfn/repository

pushd toolbox/third-party/libvfn/repository
git checkout v3.0.1
meson setup builddir -Dlibnvme="disabled" -Ddocs="disabled" --buildtype=release --prefix=/usr
meson compile -C builddir
meson install -C builddir
popd

#
# Clone, build and install libisal
#
# Assumptions:
#
# - Commands are executed with sufficient privileges (sudo/root)
#
git clone https://github.com/intel/isa-l.git toolbox/third-party/libisal/repository

pushd toolbox/third-party/libisal/repository
git checkout v2.30.0
./autogen.sh
./configure --prefix=/usr --libdir=/usr/lib
make
make install
popd

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-opensuse-tumbleweed-latest:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Note

All tools and libraries are available via system package-manager.

FreeBSD (13)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/freebsd-13.sh

Or, run the commands contained within the script manually:

# Install packages via the system package-manager (pkg)
pkg install -qy \
 autoconf \
 automake \
 bash \
 cunit \
 devel/py-pyelftools \
 e2fsprogs-libuuid \
 findutils \
 git \
 gmake \
 isa-l \
 libtool \
 meson \
 nasm \
 ncurses \
 openssl \
 patch \
 pkgconf \
 py39-pipx \
 python3 \
 wget

# Upgrade pip
python3 -m ensurepip --upgrade

# Installing meson via pip as the one available 'pkg install' currently that is 0.62.2, breaks with
# a "File name too long", 0.60 seems ok.
python3 -m pip install meson==0.60

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-freebsd-13:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Note

Interfaces; libaio, liburing, and libvfn are not supported on FreeBSD.

macOS (13)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/macos-13.sh

Or, run the commands contained within the script manually:

# This is done to avoid appleframework deprecation warnings
export MACOSX_DEPLOYMENT_TARGET=11.0
export HOMEBREW_NO_AUTO_UPDATE=1

# Install packages via brew, assuming that brew is: installed, updated, and upgraded
clang-format --version && echo "Installed" || brew install clang-format --overwrite || echo "Failed installing"
git --version && echo "Installed" || brew install git --overwrite || echo "Failed installing"
isa-l --version && echo "Installed" || brew install isa-l --overwrite || echo "Failed installing"
if make --version | grep i386-apple; then
  brew install make
fi

meson --version && echo "Installed" || brew install meson --overwrite || echo "Failed installing"
pipx --version && echo "Installed" || brew install pipx --overwrite || echo "Failed installing"
pkg-config --version && echo "Installed" || brew install pkg-config --overwrite || echo "Failed installing"
python3 --version && echo "Installed" || brew install python3 --overwrite || echo "Failed installing"

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-macos-13:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# configure xNVMe and build meson subprojects(SPDK)
meson setup builddir

# build xNVMe
meson compile -C builddir

# install xNVMe
meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Note

Interfaces; libaio, liburing, libvfn, and SPDK are not supported on macOS.

macOS (12)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as root or with sudo), by executing the commands below. You can run this from the root of the xNVMe by invoking:

sudo ./xnvme/toolbox/pkgs/macos-12.sh

Or, run the commands contained within the script manually:

# This is done to avoid appleframework deprecation warnings
export MACOSX_DEPLOYMENT_TARGET=11.0
export HOMEBREW_NO_AUTO_UPDATE=1

# Install packages via brew, assuming that brew is: installed, updated, and upgraded
clang-format --version && echo "Installed" || brew install clang-format --overwrite || echo "Failed installing"
git --version && echo "Installed" || brew install git --overwrite || echo "Failed installing"
isa-l --version && echo "Installed" || brew install isa-l --overwrite || echo "Failed installing"
if make --version | grep i386-apple; then
  brew install make
fi

meson --version && echo "Installed" || brew install meson --overwrite || echo "Failed installing"
pipx --version && echo "Installed" || brew install pipx --overwrite || echo "Failed installing"
pkg-config --version && echo "Installed" || brew install pkg-config --overwrite || echo "Failed installing"
python3 --version && echo "Installed" || brew install python3 --overwrite || echo "Failed installing"

Note

A Docker-image is provided via ghcr.io, specifically ghcr.io/xnvme/xnvme-deps-macos-12:next. This Docker-image contains all the software described above.

Then go ahead and configure, build and install using meson:

# This is done to avoid appleframework deprecation warnings
export MACOSX_DEPLOYMENT_TARGET=11.0

# configure xNVMe
meson setup builddir

# build xNVMe
meson compile -C builddir

# install xNVMe
sudo meson install -C builddir

# uninstall xNVMe
# cd builddir && meson --internal uninstall

Note

Interfaces; libaio, liburing, libvfn, and SPDK are not supported on macOS.

Windows (2022)#

Install the required toolchain and libraries, with sufficient system privileges (e.g. as eleveted command prompt), by executing the commands below. You can run this on administrator command prompt of the xNVMe by invoking:

call xnvme\toolbox\pkgs\windows-2022.bat

Or, run the commands contained within the script manually:

@echo off
@setlocal enableextensions enabledelayedexpansion

net session >nul: 2>&1
if errorlevel 1 (
	echo %0 must be run with Administrator privileges
	goto :eof
)

:: Use PowerShell to install Chocolatey
set "PATH=%ALLUSERSPROFILE%\chocolatey\bin;%PATH%"
echo [1/6] Install: Chocolatey Manager
powershell -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
where /q choco
if errorlevel 1 (
	echo [1/6] Install: Chocolatey = FAIL
	goto :eof
)
echo [1/6] Install: Chocolatey = PASS

:: Use Chocolatey to install msys2
echo [2/6] Install: MSYS2
set "PATH=%SystemDrive%\msys64;%PATH%"
choco install msys2 -y -r --params "/NoUpdate /InstallDir:C:\msys64"
where /q msys2
if errorlevel 1 (
	echo [2/6] Install: MSYS2 = FAIL
	goto :eof
)
echo [2/6] Install: MSYS2 = PASS

echo [3/6] Install: Git
choco install git -y -r
echo [3/6] Install: Git = PASS

echo [4/6] Install: dos2unix
choco install dos2unix
echo [4/6] Install: dos2unix = PASS

:: Use MSYS2/pacman to install gcc and clang toolchain
set MSYS2=call msys2_shell -no-start -here -use-full-path -defterm

echo [5/6] Install: MinGW Toolchain via msys2/pacman
set "PATH=%SystemDrive%\msys64\mingw64\bin;%PATH%"
%MSYS2% -c "pacman --noconfirm -Syy --needed base-devel mingw-w64-x86_64-toolchain"
where /q gcc
if errorlevel 1 (
	echo [5/6] Install: MinGW Toolchain via msys2/pacman = FAIL
	goto :eof
)
echo [5/6] Install: MinGW Toolchain via msys2/pacman = PASS

echo [6/6] Install: MinGW/meson via msys2/pacman
%MSYS2% -c "pacman --noconfirm -Syy mingw-w64-x86_64-meson"
echo [6/6] Install: MinGW/meson via msys2/pacman = OK

Then go ahead and configure, build and install using helper batch script build.bat:

  # build: auto-configure xNVMe, build third-party libraries, and xNVMe itself
  build.bat

  # config: only configure xNVMe
  build.bat config

  # config: debug only configure xNVMe
  build.bat config-debug

  # install xNVMe
  build.bat install

  # uninstall xNVMe
  # build.bat uninstall

Note

In case you see .dll loader-errors, then check that the environment variable PATH contains the various library locations of the toolchain. Interfaces; libaio, liburing, libvfn, and SPDK are not supported on Windows.