Build from Scratch - DAOS v3.0
Author: DAOS Project
Description: Distributed Asynchronous Object Storage

Skip to content

# Build from scratch

The following instructions describe how to build DAOS from source code. This includes the following steps:

1. Download Source Code
2. Install Prerequisites
3. Build DAOS
4. Environment Setup

The approximate time to read and execute the steps on this guide is approximately 25 minutes per OS.

## Download Source Code

Download DAOS source code using the following command:

The DAOS repository is hosted on GitHub.

To checkout the master (development) branch, simply run:

    $ git clone --recurse-submodules https://github.com/daos-stack/daos.git
    $ cd daos

This command clones the DAOS git repository (path referred as ${daospath} below) and initializes all the submodules automatically.

## Install Prerequisites

To build DAOS and its dependencies, several software packages must be installed on the system. This includes libuuid, cmocka, Go, and several other packages usually available on all the Linux distributions.

Some DAOS tests also use MPI. The DAOS build process uses the environment modules package to detect the presence of MPI. If none is found, the build will skip building those tests.

In addition some python packages are required, which can be installed via the Linux distribution or installed by pip after the source code is available.

Scripts to install all the required packages are provided for each supported distribution.

### RHEL and Clones

For RHEL8-compatible distributions (e.g. Rocky Linux 8 or AlmaLinux 8), please run the following command from the DAOS tree as root or via sudo:

    $ sudo ./utils/scripts/install-el8.sh

### openSUSE

For openSUSE, the following command should be executed as root or via sudo:

    $ sudo ./utils/scripts/install-leap15.sh

### Ubuntu

As for Ubuntu, please run the following script as the root user or via sudo:

    $ sudo ./utils/scripts/install-ubuntu.sh

### Python Packages

Python packages required to build and test DAOS can be installed via a python virtual environment or system wide.

To install a virtual environment for building DAOS use the following commands, this will only need to be done once, for a new shell only the `source venv/bin/activate` command will be required. Alternatively the packages can be installed via pip as root which will install onto PATH, or as the user outside of a virtual environment, in which case `~/.local/bin` will need to be added to PATH.

`bash $ python3 -m venv venv $ source venv/bin/activate $ python3 -m pip --no-cache-dir install --upgrade pip $ python3 -m pip install -r requirements-build.txt`

## Build DAOS

Once all prerequisites installed and the sources are downloaded, DAOS can be built via the following command:

    $ scons --jobs $(nproc) --config=force --build-deps=yes install

By default, DAOS and its dependencies are installed under the `install` directory. The installation path can be modified by adding the PREFIX= option to the above command line (e.g., PREFIX=/usr/local).

Note

Several parameters can be set (e.g., COMPILER=clang) on the scons command line. Please see `scons --help` for all the possible options. Those options are also saved for future compilations.

## Environment setup

Once built, the environment must be modified to search for binaries and header files in the installation path. This step is not required if standard locations (e.g. /bin, /sbin, /usr/lib, ...) are used.

    $ export CPATH=${daospath}/install/include/:$CPATH
    $ export PATH=${daospath}/install/bin/:${daospath}/install/sbin:$PATH

If using bash, PATH can be set up for you after a build by sourcing the script utils/sl/setup_local.sh from the daos root. This script utilizes a file generated by the build to determine the location of daos and its dependencies.

If required, ${daospath}/install must be replaced with the alternative path specified through PREFIX.