]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | ============ |
2 | Build Ceph | |
3 | ============ | |
4 | ||
5 | You can get Ceph software by retrieving Ceph source code and building it yourself. | |
f67539c2 TL |
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. | |
7c673cae FG |
8 | |
9 | Build 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 |
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 | ||
7c673cae FG |
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 | ||
35 | Ceph is built using cmake. To build Ceph, navigate to your cloned Ceph | |
36 | repository and execute the following:: | |
37 | ||
38 | cd ceph | |
31f18b77 | 39 | ./do_cmake.sh |
7c673cae | 40 | cd build |
7c673cae FG |
41 | make |
42 | ||
11fdf7f2 TL |
43 | .. note:: By default do_cmake.sh will build a debug version of ceph that may |
44 | perform up to 5 times slower with certain workloads. Pass | |
45 | '-DCMAKE_BUILD_TYPE=RelWithDebInfo' to do_cmake.sh if you would like to | |
46 | build a release version of the ceph executables instead. | |
47 | ||
7c673cae FG |
48 | .. topic:: Hyperthreading |
49 | ||
50 | You can use ``make -j`` to execute multiple jobs depending upon your system. For | |
51 | example, ``make -j4`` for a dual core processor may build faster. | |
52 | ||
53 | See `Installing a Build`_ to install a build in user space. | |
54 | ||
55 | Build Ceph Packages | |
56 | =================== | |
57 | ||
58 | To build packages, you must clone the `Ceph`_ repository. You can create | |
59 | installation packages from the latest code using ``dpkg-buildpackage`` for | |
60 | Debian/Ubuntu or ``rpmbuild`` for the RPM Package Manager. | |
61 | ||
62 | .. tip:: When building on a multi-core CPU, use the ``-j`` and the number of | |
63 | cores * 2. For example, use ``-j4`` for a dual-core processor to accelerate | |
64 | the build. | |
65 | ||
66 | ||
67 | Advanced Package Tool (APT) | |
68 | --------------------------- | |
69 | ||
70 | To create ``.deb`` packages for Debian/Ubuntu, ensure that you have cloned the | |
71 | `Ceph`_ repository, installed the `Build Prerequisites`_ and installed | |
72 | ``debhelper``:: | |
73 | ||
74 | sudo apt-get install debhelper | |
75 | ||
76 | Once you have installed debhelper, you can build the packages:: | |
77 | ||
78 | sudo dpkg-buildpackage | |
79 | ||
80 | For multi-processor CPUs use the ``-j`` option to accelerate the build. | |
81 | ||
82 | ||
83 | RPM Package Manager | |
84 | ------------------- | |
85 | ||
86 | To create ``.rpm`` packages, ensure that you have cloned the `Ceph`_ repository, | |
87 | installed the `Build Prerequisites`_ and installed ``rpm-build`` and | |
88 | ``rpmdevtools``:: | |
89 | ||
90 | yum install rpm-build rpmdevtools | |
91 | ||
92 | Once you have installed the tools, setup an RPM compilation environment:: | |
93 | ||
94 | rpmdev-setuptree | |
95 | ||
96 | Fetch the source tarball for the RPM compilation environment:: | |
97 | ||
11fdf7f2 | 98 | wget -P ~/rpmbuild/SOURCES/ https://download.ceph.com/tarballs/ceph-<version>.tar.bz2 |
7c673cae FG |
99 | |
100 | Or from the EU mirror:: | |
101 | ||
11fdf7f2 | 102 | wget -P ~/rpmbuild/SOURCES/ http://eu.ceph.com/tarballs/ceph-<version>.tar.bz2 |
7c673cae FG |
103 | |
104 | Extract the specfile:: | |
105 | ||
106 | tar --strip-components=1 -C ~/rpmbuild/SPECS/ --no-anchored -xvjf ~/rpmbuild/SOURCES/ceph-<version>.tar.bz2 "ceph.spec" | |
107 | ||
108 | Build the RPM packages:: | |
109 | ||
110 | rpmbuild -ba ~/rpmbuild/SPECS/ceph.spec | |
111 | ||
112 | For multi-processor CPUs use the ``-j`` option to accelerate the build. | |
113 | ||
114 | .. _Ceph: ../clone-source | |
115 | .. _Installing a Build: ../install-storage-cluster#installing-a-build |