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