]> git.proxmox.com Git - ceph.git/blame - ceph/doc/install/build-ceph.rst
update sources to v12.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.
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
31f18b77 31 ./do_cmake.sh
7c673cae 32 cd build
7c673cae
FG
33 make
34
35.. topic:: Hyperthreading
36
37 You can use ``make -j`` to execute multiple jobs depending upon your system. For
38 example, ``make -j4`` for a dual core processor may build faster.
39
40See `Installing a Build`_ to install a build in user space.
41
42Build Ceph Packages
43===================
44
45To build packages, you must clone the `Ceph`_ repository. You can create
46installation packages from the latest code using ``dpkg-buildpackage`` for
47Debian/Ubuntu or ``rpmbuild`` for the RPM Package Manager.
48
49.. tip:: When building on a multi-core CPU, use the ``-j`` and the number of
50 cores * 2. For example, use ``-j4`` for a dual-core processor to accelerate
51 the build.
52
53
54Advanced Package Tool (APT)
55---------------------------
56
57To create ``.deb`` packages for Debian/Ubuntu, ensure that you have cloned the
58`Ceph`_ repository, installed the `Build Prerequisites`_ and installed
59``debhelper``::
60
61 sudo apt-get install debhelper
62
63Once you have installed debhelper, you can build the packages::
64
65 sudo dpkg-buildpackage
66
67For multi-processor CPUs use the ``-j`` option to accelerate the build.
68
69
70RPM Package Manager
71-------------------
72
73To create ``.rpm`` packages, ensure that you have cloned the `Ceph`_ repository,
74installed the `Build Prerequisites`_ and installed ``rpm-build`` and
75``rpmdevtools``::
76
77 yum install rpm-build rpmdevtools
78
79Once you have installed the tools, setup an RPM compilation environment::
80
81 rpmdev-setuptree
82
83Fetch the source tarball for the RPM compilation environment::
84
85 wget -P ~/rpmbuild/SOURCES/ http://ceph.com/download/ceph-<version>.tar.bz2
86
87Or from the EU mirror::
88
89 wget -P ~/rpmbuild/SOURCES/ http://eu.ceph.com/download/ceph-<version>.tar.bz2
90
91Extract the specfile::
92
93 tar --strip-components=1 -C ~/rpmbuild/SPECS/ --no-anchored -xvjf ~/rpmbuild/SOURCES/ceph-<version>.tar.bz2 "ceph.spec"
94
95Build the RPM packages::
96
97 rpmbuild -ba ~/rpmbuild/SPECS/ceph.spec
98
99For multi-processor CPUs use the ``-j`` option to accelerate the build.
100
101.. _Ceph: ../clone-source
102.. _Installing a Build: ../install-storage-cluster#installing-a-build