]> git.proxmox.com Git - ceph.git/blame - ceph/doc/install/build-ceph.rst
import quincy beta 17.1.0
[ceph.git] / ceph / doc / install / build-ceph.rst
CommitLineData
7c673cae
FG
1============
2 Build Ceph
3============
4
5You can get Ceph software by retrieving Ceph source code and building it yourself.
f67539c2
TL
6To build Ceph, you need to set up a development environment, compile Ceph,
7and then either install in user space or build packages and install the packages.
7c673cae
FG
8
9Build Prerequisites
10===================
11
12
f67539c2 13.. tip:: Check this section to see if there are specific prerequisites for your
7c673cae
FG
14 Linux/Unix distribution.
15
f67539c2
TL
16A debug build of Ceph may take around 40 gigabytes. If you want to build Ceph in
17a virtual machine (VM) please make sure total disk space on the VM is at least
1860 gigabytes.
19
20Please also be aware that some distributions of Linux, like CentOS, use Linux
21Volume Manager (LVM) for the default installation. LVM may reserve a large
22portion of disk space of a typical sized virtual disk for the operating system.
23
7c673cae
FG
24Before you can build Ceph source code, you need to install several libraries
25and tools::
26
27 ./install-deps.sh
28
29.. note:: Some distributions that support Google's memory profiler tool may use
30 a different package name (e.g., ``libgoogle-perftools4``).
31
32Build Ceph
33==========
34
35Ceph is built using cmake. To build Ceph, navigate to your cloned Ceph
36repository and execute the following::
37
38 cd ceph
31f18b77 39 ./do_cmake.sh
7c673cae 40 cd build
20effc67 41 ninja
7c673cae 42
20effc67
TL
43See `Installing a Build`_ to install a build in user space and `Ceph README.md`_
44doc for more details on build.
7c673cae
FG
45
46Build Ceph Packages
47===================
48
49To build packages, you must clone the `Ceph`_ repository. You can create
50installation packages from the latest code using ``dpkg-buildpackage`` for
51Debian/Ubuntu or ``rpmbuild`` for the RPM Package Manager.
52
53.. tip:: When building on a multi-core CPU, use the ``-j`` and the number of
54 cores * 2. For example, use ``-j4`` for a dual-core processor to accelerate
55 the build.
56
57
58Advanced Package Tool (APT)
59---------------------------
60
61To create ``.deb`` packages for Debian/Ubuntu, ensure that you have cloned the
62`Ceph`_ repository, installed the `Build Prerequisites`_ and installed
63``debhelper``::
64
65 sudo apt-get install debhelper
66
67Once you have installed debhelper, you can build the packages::
68
69 sudo dpkg-buildpackage
70
71For multi-processor CPUs use the ``-j`` option to accelerate the build.
72
73
74RPM Package Manager
75-------------------
76
77To create ``.rpm`` packages, ensure that you have cloned the `Ceph`_ repository,
78installed the `Build Prerequisites`_ and installed ``rpm-build`` and
79``rpmdevtools``::
80
81 yum install rpm-build rpmdevtools
82
83Once you have installed the tools, setup an RPM compilation environment::
84
85 rpmdev-setuptree
86
87Fetch the source tarball for the RPM compilation environment::
88
11fdf7f2 89 wget -P ~/rpmbuild/SOURCES/ https://download.ceph.com/tarballs/ceph-<version>.tar.bz2
7c673cae
FG
90
91Or from the EU mirror::
92
11fdf7f2 93 wget -P ~/rpmbuild/SOURCES/ http://eu.ceph.com/tarballs/ceph-<version>.tar.bz2
7c673cae
FG
94
95Extract the specfile::
96
97 tar --strip-components=1 -C ~/rpmbuild/SPECS/ --no-anchored -xvjf ~/rpmbuild/SOURCES/ceph-<version>.tar.bz2 "ceph.spec"
98
99Build the RPM packages::
100
101 rpmbuild -ba ~/rpmbuild/SPECS/ceph.spec
102
103For multi-processor CPUs use the ``-j`` option to accelerate the build.
104
105.. _Ceph: ../clone-source
106.. _Installing a Build: ../install-storage-cluster#installing-a-build
20effc67 107.. _Ceph README.md: https://github.com/ceph/ceph#building-ceph