Skip to content

wxiong38/libnvme

 
 

Repository files navigation

libnvme

This is the libnvme development C library. libnvme provides type defintions for NVMe specification structures, enumerations, and bit fields, helper functions to construct, dispatch, and decode commands and payloads, and utilities to connect, scan, and manage nvme devices on a Linux system.

The public specification is the authority to resolve any protocol discrepencies with this library. For more info on NVM Express, please see:

http://nvmexpress.org

Subscribe to [email protected] for linux-nvme related discussions and development for both kernel and userspace. The list is archived here:

http://lists.infradead.org/mailman/listinfo/linux-nvme

License

Except where otherwise stated, all software contained within this repo is currently licensed LGPL, see COPYING for more information.

Keith Busch 2020-02-06


Building with meson

What is the meson build system?

Here's an excerpt from the meson web site: Meson is an open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible. The main design point of Meson is that every moment a developer spends writing or debugging build definitions is a second wasted.

Several well-known projects such as systemd and Gnome use meson as their build system. A summary of projects using meson can be found here. For more info on meson, please consult the following sites:

Wiki page: https://en.wikipedia.org/wiki/Meson_(software)

meson documentation: https://mesonbuild.com/

meson repo: https://github.com/mesonbuild/meson

Prerequisite

First, install meson.

Debian / Ubuntu:

sudo apt-get install meson

Fedora / Red Hat:

sudo dnf install meson

To compile libnvme

Using meson is similar to projects that use a configure script before running make.

To configure the project:

meson .build

One nice feature of meson is that it doesn't mix build artifacts (e.g. *.o, *.so, etc.) with source code. In the above example, ".build" is the name of the directory where the build configuration as well as all the build artifacts will be saved. This directory can be named anything as long as it's not an existing source directory. To completely "clean" all the build artifacts, one need only delete the .build directory.

To compile:

cd .build
ninja

Or:

ninja -C .build

To install libnvme

To install libnvme:

cd .build
meson install

To run unit tests

To run unit tests:

cd .build
meson test

To clean after a build

To perform the equivalent of a make clean without deleting the build configuration.

cd .build
ninja -t clean

Or:

ninja -C .build -t clean

To purge everything

To completely clean all build artifacts, including the build configuration.

rm -rf .build

Supported build options

A few build options can be specified on the command line when invoking meson.

Option Values [default] Description

Changing the build options from the command-line (i.e. w/o modifying any files)

To configure a build for debugging purposes (i.e. optimization turned off and debug symbols enabled):

meson .build -Dbuildtype=debug

To enable address sanitizer (advanced debugging of memory issues):

meson .build -Db_sanitize=address

To list configuration options that are available and possible values:

meson configure .build

About

C Library for NVM Express on Linux

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 94.7%
  • SWIG 2.5%
  • Meson 1.5%
  • Other 1.3%