Build Ceph

You can get Ceph software by retrieving Ceph source code and building it yourself.To build Ceph, you need to set up a development environment, compile Ceph,and then either install in user space or build packages and install the packages.

Build Prerequisites

Tip

Check this section to see if there are specific prerequisites for yourLinux/Unix distribution.

Before you can build Ceph source code, you need to install several librariesand tools:

  1. ./install-deps.sh

Note

Some distributions that support Google’s memory profiler tool may usea different package name (e.g., libgoogle-perftools4).

Build Ceph

Ceph is built using cmake. To build Ceph, navigate to your cloned Cephrepository and execute the following:

  1. cd ceph
  2. ./do_cmake.sh
  3. cd build
  4. make

Note

By default do_cmake.sh will build a debug version of ceph that mayperform up to 5 times slower with certain workloads. Pass‘-DCMAKE_BUILD_TYPE=RelWithDebInfo’ to do_cmake.sh if you would like tobuild a release version of the ceph executables instead.

See Installing a Build to install a build in user space.

Build Ceph Packages

To build packages, you must clone the Ceph repository. You can createinstallation packages from the latest code using dpkg-buildpackage forDebian/Ubuntu or rpmbuild for the RPM Package Manager.

Tip

When building on a multi-core CPU, use the -j and the number ofcores * 2. For example, use -j4 for a dual-core processor to acceleratethe build.

Advanced Package Tool (APT)

To create .deb packages for Debian/Ubuntu, ensure that you have cloned theCeph repository, installed the Build Prerequisites and installeddebhelper:

  1. sudo apt-get install debhelper

Once you have installed debhelper, you can build the packages:

  1. sudo dpkg-buildpackage

For multi-processor CPUs use the -j option to accelerate the build.

RPM Package Manager

To create .rpm packages, ensure that you have cloned the Ceph repository,installed the Build Prerequisites and installed rpm-build andrpmdevtools:

  1. yum install rpm-build rpmdevtools

Once you have installed the tools, setup an RPM compilation environment:

  1. rpmdev-setuptree

Fetch the source tarball for the RPM compilation environment:

  1. wget -P ~/rpmbuild/SOURCES/ https://download.ceph.com/tarballs/ceph-<version>.tar.bz2

Or from the EU mirror:

  1. wget -P ~/rpmbuild/SOURCES/ http://eu.ceph.com/tarballs/ceph-<version>.tar.bz2

Extract the specfile:

  1. tar --strip-components=1 -C ~/rpmbuild/SPECS/ --no-anchored -xvjf ~/rpmbuild/SOURCES/ceph-<version>.tar.bz2 "ceph.spec"

Build the RPM packages:

  1. rpmbuild -ba ~/rpmbuild/SPECS/ceph.spec

For multi-processor CPUs use the -j option to accelerate the build.