]>
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. | |
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 | Before you can build Ceph source code, you need to install several libraries | |
17 | and 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 | ||
24 | Build Ceph | |
25 | ========== | |
26 | ||
27 | Ceph is built using cmake. To build Ceph, navigate to your cloned Ceph | |
28 | repository 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 | ||
41 | See `Installing a Build`_ to install a build in user space. | |
42 | ||
43 | Build Ceph Packages | |
44 | =================== | |
45 | ||
46 | To build packages, you must clone the `Ceph`_ repository. You can create | |
47 | installation packages from the latest code using ``dpkg-buildpackage`` for | |
48 | Debian/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 | ||
55 | Advanced Package Tool (APT) | |
56 | --------------------------- | |
57 | ||
58 | To 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 | ||
64 | Once you have installed debhelper, you can build the packages:: | |
65 | ||
66 | sudo dpkg-buildpackage | |
67 | ||
68 | For multi-processor CPUs use the ``-j`` option to accelerate the build. | |
69 | ||
70 | ||
71 | RPM Package Manager | |
72 | ------------------- | |
73 | ||
74 | To create ``.rpm`` packages, ensure that you have cloned the `Ceph`_ repository, | |
75 | installed the `Build Prerequisites`_ and installed ``rpm-build`` and | |
76 | ``rpmdevtools``:: | |
77 | ||
78 | yum install rpm-build rpmdevtools | |
79 | ||
80 | Once you have installed the tools, setup an RPM compilation environment:: | |
81 | ||
82 | rpmdev-setuptree | |
83 | ||
84 | Fetch the source tarball for the RPM compilation environment:: | |
85 | ||
86 | wget -P ~/rpmbuild/SOURCES/ http://ceph.com/download/ceph-<version>.tar.bz2 | |
87 | ||
88 | Or from the EU mirror:: | |
89 | ||
90 | wget -P ~/rpmbuild/SOURCES/ http://eu.ceph.com/download/ceph-<version>.tar.bz2 | |
91 | ||
92 | Extract the specfile:: | |
93 | ||
94 | tar --strip-components=1 -C ~/rpmbuild/SPECS/ --no-anchored -xvjf ~/rpmbuild/SOURCES/ceph-<version>.tar.bz2 "ceph.spec" | |
95 | ||
96 | Build the RPM packages:: | |
97 | ||
98 | rpmbuild -ba ~/rpmbuild/SPECS/ceph.spec | |
99 | ||
100 | For 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 |