]> git.proxmox.com Git - ceph.git/blame - ceph/doc/install/build-ceph.rst
bump version to 12.0.3-pve3
[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.
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.
8
9Build Prerequisites
10===================
11
12
13.. tip:: Check this section to see if there are specific prerequisites for your
14 Linux/Unix distribution.
15
16Before you can build Ceph source code, you need to install several libraries
17and tools::
18
19 ./install-deps.sh
20
21.. note:: Some distributions that support Google's memory profiler tool may use
22 a different package name (e.g., ``libgoogle-perftools4``).
23
24Build Ceph
25==========
26
27Ceph is built using cmake. To build Ceph, navigate to your cloned Ceph
28repository and execute the following::
29
30 cd ceph
31 mkdir build
32 cd build
33 cmake ..
34 make
35
36.. topic:: Hyperthreading
37
38 You can use ``make -j`` to execute multiple jobs depending upon your system. For
39 example, ``make -j4`` for a dual core processor may build faster.
40
41See `Installing a Build`_ to install a build in user space.
42
43Build Ceph Packages
44===================
45
46To build packages, you must clone the `Ceph`_ repository. You can create
47installation packages from the latest code using ``dpkg-buildpackage`` for
48Debian/Ubuntu or ``rpmbuild`` for the RPM Package Manager.
49
50.. tip:: When building on a multi-core CPU, use the ``-j`` and the number of
51 cores * 2. For example, use ``-j4`` for a dual-core processor to accelerate
52 the build.
53
54
55Advanced Package Tool (APT)
56---------------------------
57
58To create ``.deb`` packages for Debian/Ubuntu, ensure that you have cloned the
59`Ceph`_ repository, installed the `Build Prerequisites`_ and installed
60``debhelper``::
61
62 sudo apt-get install debhelper
63
64Once you have installed debhelper, you can build the packages::
65
66 sudo dpkg-buildpackage
67
68For multi-processor CPUs use the ``-j`` option to accelerate the build.
69
70
71RPM Package Manager
72-------------------
73
74To create ``.rpm`` packages, ensure that you have cloned the `Ceph`_ repository,
75installed the `Build Prerequisites`_ and installed ``rpm-build`` and
76``rpmdevtools``::
77
78 yum install rpm-build rpmdevtools
79
80Once you have installed the tools, setup an RPM compilation environment::
81
82 rpmdev-setuptree
83
84Fetch the source tarball for the RPM compilation environment::
85
86 wget -P ~/rpmbuild/SOURCES/ http://ceph.com/download/ceph-<version>.tar.bz2
87
88Or from the EU mirror::
89
90 wget -P ~/rpmbuild/SOURCES/ http://eu.ceph.com/download/ceph-<version>.tar.bz2
91
92Extract the specfile::
93
94 tar --strip-components=1 -C ~/rpmbuild/SPECS/ --no-anchored -xvjf ~/rpmbuild/SOURCES/ceph-<version>.tar.bz2 "ceph.spec"
95
96Build the RPM packages::
97
98 rpmbuild -ba ~/rpmbuild/SPECS/ceph.spec
99
100For multi-processor CPUs use the ``-j`` option to accelerate the build.
101
102.. _Ceph: ../clone-source
103.. _Installing a Build: ../install-storage-cluster#installing-a-build